From e65921484b1975fe013ab7b28bf5eaac6f8baa06 Mon Sep 17 00:00:00 2001 From: makspll Date: Mon, 10 Feb 2025 12:51:42 +0000 Subject: [PATCH 01/13] feat: refactor generated bindings to use new derive macro --- crates/bevy_api_gen/templates/footer.tera | 72 +++++++++++++---------- crates/bevy_api_gen/templates/header.tera | 3 + 2 files changed, 44 insertions(+), 31 deletions(-) diff --git a/crates/bevy_api_gen/templates/footer.tera b/crates/bevy_api_gen/templates/footer.tera index 5f32e86a59..f0231bd532 100644 --- a/crates/bevy_api_gen/templates/footer.tera +++ b/crates/bevy_api_gen/templates/footer.tera @@ -7,42 +7,52 @@ pub struct {{ "ScriptingPlugin" | prefix_cratename | convert_case(case="upper_camel")}}; +{% for item in items %} +#[script_bindings( + remote, + name = "{{ item.ident | convert_case(case="snake") }}", +)] +impl {{item.import_path}} { +{%- for function in item.functions -%} + + fn {{ function.ident }} ( + {%- for arg in function.args -%} + {%- if arg.proxy_ty is matching("Mut.*")-%} + mut {% endif -%} + {{- arg.ident | to_arg_pattern() -}} + : {{- arg.proxy_ty -}}, + {%- endfor -%} + ) { + let output: {{ function.output.proxy_ty }} = + {%- if function.from_trait_path -%} + {{- function_call_expression(type=item.import_path, trait=function.from_trait_path, function=function.ident) -}} + {%- else -%} + {{- function_call_expression(type=item.import_path, function=function.ident) -}} + {%- endif -%} + ( + {%- for arg in function.args -%} + {%- if arg.proxy_ty is matching("Ref.*")-%} + &{% endif -%} + {%- if arg.proxy_ty is matching ("Mut.*")-%} + &mut {% endif -%} + {{- arg.ident | to_arg_pattern() -}} + {%- if arg.proxy_ty is matching("Val.*")-%} + .into_inner() + {%- endif -%}, + {%- endfor -%} + ).into(); + output + } +{%- endfor -%}; +} +{% endfor %} + impl ::bevy::app::Plugin for {{ "ScriptingPlugin" | prefix_cratename | convert_case(case="upper_camel")}} { fn build(&self, app: &mut ::bevy::prelude::App) { let mut world = app.world_mut(); {% for item in items %} - NamespaceBuilder::<::{{ item.import_path }}>::new(world) - {%- for function in item.functions -%} - .register("{{ function.ident }}", | - {%- for arg in function.args -%} - {%- if arg.proxy_ty is matching("Mut.*")-%} - mut {% endif -%} - {{- arg.ident | to_arg_pattern() -}} - : {{- arg.proxy_ty -}}, - {%- endfor -%} - | { - let output: {{ function.output.proxy_ty }} = - {%- if function.from_trait_path -%} - {{- function_call_expression(type=item.import_path, trait=function.from_trait_path, function=function.ident) -}} - {%- else -%} - {{- function_call_expression(type=item.import_path, function=function.ident) -}} - {%- endif -%} - ( - {%- for arg in function.args -%} - {%- if arg.proxy_ty is matching("Ref.*")-%} - &{% endif -%} - {%- if arg.proxy_ty is matching ("Mut.*")-%} - &mut {% endif -%} - {{- arg.ident | to_arg_pattern() -}} - {%- if arg.proxy_ty is matching("Val.*")-%} - .into_inner() - {%- endif -%}, - {%- endfor -%} - ).into(); - output - }) - {%- endfor -%}; + register_{{ item.ident | convert_case(case="snake") }}(&mut world); {% endfor %} } } \ No newline at end of file diff --git a/crates/bevy_api_gen/templates/header.tera b/crates/bevy_api_gen/templates/header.tera index f50067afbb..2351731544 100644 --- a/crates/bevy_api_gen/templates/header.tera +++ b/crates/bevy_api_gen/templates/header.tera @@ -8,6 +8,9 @@ use bevy_mod_scripting_core::{ function::{from::{Ref, Mut, Val}, namespace::{NamespaceBuilder}} } }; + +use bevy_mod_scripting_derive::script_bindings; + {% if args.self_is_bms_lua %} use crate::*; {% else %} From 98c2e4d5d80e9f4ea2279ebde2d32581f822fc42 Mon Sep 17 00:00:00 2001 From: makspll Date: Mon, 10 Feb 2025 13:03:49 +0000 Subject: [PATCH 02/13] remove semicolon --- crates/bevy_api_gen/templates/footer.tera | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/bevy_api_gen/templates/footer.tera b/crates/bevy_api_gen/templates/footer.tera index f0231bd532..9708fd61d3 100644 --- a/crates/bevy_api_gen/templates/footer.tera +++ b/crates/bevy_api_gen/templates/footer.tera @@ -13,8 +13,7 @@ pub struct {{ "ScriptingPlugin" | prefix_cratename | convert_case(case="upper_ca name = "{{ item.ident | convert_case(case="snake") }}", )] impl {{item.import_path}} { -{%- for function in item.functions -%} - +{% for function in item.functions %} fn {{ function.ident }} ( {%- for arg in function.args -%} {%- if arg.proxy_ty is matching("Mut.*")-%} @@ -43,7 +42,7 @@ impl {{item.import_path}} { ).into(); output } -{%- endfor -%}; +{% endfor %} } {% endfor %} From cca591ad656d8ceaab2d3c8d087b7f18103927b9 Mon Sep 17 00:00:00 2001 From: Maksymilian Mozolewski Date: Mon, 10 Feb 2025 13:19:44 +0000 Subject: [PATCH 03/13] Update bevy bindings feat/refactor generated bindings use new macro (#269) chore(codegen): update bevy bindings Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../src/bevy_bindings/bevy_core.rs | 43 +- .../src/bevy_bindings/bevy_ecs.rs | 611 +- .../src/bevy_bindings/bevy_hierarchy.rs | 157 +- .../src/bevy_bindings/bevy_input.rs | 2758 +- .../src/bevy_bindings/bevy_math.rs | 7826 ++-- .../src/bevy_bindings/bevy_reflect.rs | 36835 +++++++--------- .../src/bevy_bindings/bevy_time.rs | 693 +- .../src/bevy_bindings/bevy_transform.rs | 1395 +- 8 files changed, 20558 insertions(+), 29760 deletions(-) diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_core.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_core.rs index be31d2d8fe..082d27f5a9 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_core.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_core.rs @@ -9,34 +9,29 @@ use bevy_mod_scripting_core::bindings::{ namespace::NamespaceBuilder, }, }; +use bevy_mod_scripting_derive::script_bindings; use crate::*; pub struct BevyCoreScriptingPlugin; +#[script_bindings(remote, name = "name")] +impl bevy::core::prelude::Name { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} impl ::bevy::app::Plugin for BevyCoreScriptingPlugin { fn build(&self, app: &mut ::bevy::prelude::App) { let mut world = app.world_mut(); - NamespaceBuilder::<::bevy::core::prelude::Name>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); + register_name(&mut world); } } diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_ecs.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_ecs.rs index a5881aedc4..b87c5fe438 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_ecs.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_ecs.rs @@ -9,376 +9,289 @@ use bevy_mod_scripting_core::bindings::{ namespace::NamespaceBuilder, }, }; +use bevy_mod_scripting_derive::script_bindings; use crate::*; pub struct BevyEcsScriptingPlugin; -impl ::bevy::app::Plugin for BevyEcsScriptingPlugin { - fn build(&self, app: &mut ::bevy::prelude::App) { - let mut world = app.world_mut(); - NamespaceBuilder::<::bevy::ecs::entity::Entity>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "from_bits", - |bits: u64| { - let output: Val = bevy::ecs::entity::Entity::from_bits( - bits, - ) - .into(); - output - }, - ) - .register( - "from_raw", - |index: u32| { - let output: Val = bevy::ecs::entity::Entity::from_raw( - index, - ) - .into(); - output - }, - ) - .register( - "generation", - |_self: Val| { - let output: u32 = bevy::ecs::entity::Entity::generation( - _self.into_inner(), - ) - .into(); - output - }, +#[script_bindings(remote, name = "entity")] +impl bevy::ecs::entity::Entity { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, ) - .register( - "index", - |_self: Val| { - let output: u32 = bevy::ecs::entity::Entity::index( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "to_bits", - |_self: Val| { - let output: u64 = bevy::ecs::entity::Entity::to_bits( - _self.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::ecs::world::OnAdd>::new(world); - NamespaceBuilder::<::bevy::ecs::world::OnInsert>::new(world); - NamespaceBuilder::<::bevy::ecs::world::OnRemove>::new(world); - NamespaceBuilder::<::bevy::ecs::world::OnReplace>::new(world); - NamespaceBuilder::<::bevy::ecs::component::ComponentId>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, + .into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn from_bits(bits: u64) { + let output: Val = bevy::ecs::entity::Entity::from_bits( + bits, ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, + .into(); + output + } + fn from_raw(index: u32) { + let output: Val = bevy::ecs::entity::Entity::from_raw( + index, ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, + .into(); + output + } + fn generation(_self: Val) { + let output: u32 = bevy::ecs::entity::Entity::generation(_self.into_inner()) + .into(); + output + } + fn index(_self: Val) { + let output: u32 = bevy::ecs::entity::Entity::index(_self.into_inner()).into(); + output + } + fn to_bits(_self: Val) { + let output: u64 = bevy::ecs::entity::Entity::to_bits(_self.into_inner()).into(); + output + } +} +#[script_bindings(remote, name = "on_add")] +impl bevy::ecs::world::OnAdd {} +#[script_bindings(remote, name = "on_insert")] +impl bevy::ecs::world::OnInsert {} +#[script_bindings(remote, name = "on_remove")] +impl bevy::ecs::world::OnRemove {} +#[script_bindings(remote, name = "on_replace")] +impl bevy::ecs::world::OnReplace {} +#[script_bindings(remote, name = "component_id")] +impl bevy::ecs::component::ComponentId { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, ) - .register( - "index", - |_self: Val| { - let output: usize = bevy::ecs::component::ComponentId::index( - _self.into_inner(), - ) - .into(); - output - }, + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, ) - .register( - "new", - |index: usize| { - let output: Val = bevy::ecs::component::ComponentId::new( - index, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::ecs::component::Tick>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn index(_self: Val) { + let output: usize = bevy::ecs::component::ComponentId::index(_self.into_inner()) + .into(); + output + } + fn new(index: usize) { + let output: Val = bevy::ecs::component::ComponentId::new( + index, ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, + .into(); + output + } +} +#[script_bindings(remote, name = "tick")] +impl bevy::ecs::component::Tick { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, ) - .register( - "get", - |_self: Val| { - let output: u32 = bevy::ecs::component::Tick::get(_self.into_inner()) - .into(); - output - }, + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn get(_self: Val) { + let output: u32 = bevy::ecs::component::Tick::get(_self.into_inner()).into(); + output + } + fn is_newer_than( + _self: Val, + last_run: Val, + this_run: Val, + ) { + let output: bool = bevy::ecs::component::Tick::is_newer_than( + _self.into_inner(), + last_run.into_inner(), + this_run.into_inner(), ) - .register( - "is_newer_than", - | - _self: Val, - last_run: Val, - this_run: Val| - { - let output: bool = bevy::ecs::component::Tick::is_newer_than( - _self.into_inner(), - last_run.into_inner(), - this_run.into_inner(), - ) - .into(); - output - }, + .into(); + output + } + fn new(tick: u32) { + let output: Val = bevy::ecs::component::Tick::new( + tick, ) - .register( - "new", - |tick: u32| { - let output: Val = bevy::ecs::component::Tick::new( - tick, - ) - .into(); - output - }, + .into(); + output + } + fn set(mut _self: Mut, tick: u32) { + let output: () = bevy::ecs::component::Tick::set(&mut _self, tick).into(); + output + } +} +#[script_bindings(remote, name = "component_ticks")] +impl bevy::ecs::component::ComponentTicks { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, ) - .register( - "set", - |mut _self: Mut, tick: u32| { - let output: () = bevy::ecs::component::Tick::set(&mut _self, tick) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::ecs::component::ComponentTicks>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, + .into(); + output + } + fn is_added( + _self: Ref, + last_run: Val, + this_run: Val, + ) { + let output: bool = bevy::ecs::component::ComponentTicks::is_added( + &_self, + last_run.into_inner(), + this_run.into_inner(), ) - .register( - "is_added", - | - _self: Ref, - last_run: Val, - this_run: Val| - { - let output: bool = bevy::ecs::component::ComponentTicks::is_added( - &_self, - last_run.into_inner(), - this_run.into_inner(), - ) - .into(); - output - }, + .into(); + output + } + fn is_changed( + _self: Ref, + last_run: Val, + this_run: Val, + ) { + let output: bool = bevy::ecs::component::ComponentTicks::is_changed( + &_self, + last_run.into_inner(), + this_run.into_inner(), ) - .register( - "is_changed", - | - _self: Ref, - last_run: Val, - this_run: Val| - { - let output: bool = bevy::ecs::component::ComponentTicks::is_changed( - &_self, - last_run.into_inner(), - this_run.into_inner(), - ) - .into(); - output - }, + .into(); + output + } + fn new(change_tick: Val) { + let output: Val = bevy::ecs::component::ComponentTicks::new( + change_tick.into_inner(), ) - .register( - "new", - |change_tick: Val| { - let output: Val = bevy::ecs::component::ComponentTicks::new( - change_tick.into_inner(), - ) - .into(); - output - }, + .into(); + output + } + fn set_changed( + mut _self: Mut, + change_tick: Val, + ) { + let output: () = bevy::ecs::component::ComponentTicks::set_changed( + &mut _self, + change_tick.into_inner(), ) - .register( - "set_changed", - | - mut _self: Mut, - change_tick: Val| - { - let output: () = bevy::ecs::component::ComponentTicks::set_changed( - &mut _self, - change_tick.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::ecs::identifier::Identifier>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, + .into(); + output + } +} +#[script_bindings(remote, name = "identifier")] +impl bevy::ecs::identifier::Identifier { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn from_bits(value: u64) { + let output: Val = bevy::ecs::identifier::Identifier::from_bits( + value, ) - .register( - "from_bits", - |value: u64| { - let output: Val = bevy::ecs::identifier::Identifier::from_bits( - value, - ) - .into(); - output - }, + .into(); + output + } + fn low(_self: Val) { + let output: u32 = bevy::ecs::identifier::Identifier::low(_self.into_inner()) + .into(); + output + } + fn masked_high(_self: Val) { + let output: u32 = bevy::ecs::identifier::Identifier::masked_high( + _self.into_inner(), ) - .register( - "low", - |_self: Val| { - let output: u32 = bevy::ecs::identifier::Identifier::low( - _self.into_inner(), - ) - .into(); - output - }, + .into(); + output + } + fn to_bits(_self: Val) { + let output: u64 = bevy::ecs::identifier::Identifier::to_bits(_self.into_inner()) + .into(); + output + } +} +#[script_bindings(remote, name = "entity_hash")] +impl bevy::ecs::entity::EntityHash { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, ) - .register( - "masked_high", - |_self: Val| { - let output: u32 = bevy::ecs::identifier::Identifier::masked_high( - _self.into_inner(), - ) - .into(); - output - }, + .into(); + output + } +} +#[script_bindings(remote, name = "removed_component_entity")] +impl bevy::ecs::removal_detection::RemovedComponentEntity { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, ) - .register( - "to_bits", - |_self: Val| { - let output: u64 = bevy::ecs::identifier::Identifier::to_bits( - _self.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::ecs::entity::EntityHash>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::< - ::bevy::ecs::removal_detection::RemovedComponentEntity, - >::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val< - bevy::ecs::removal_detection::RemovedComponentEntity, - > = ::clone( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::ecs::system::SystemIdMarker>::new(world); + .into(); + output + } +} +#[script_bindings(remote, name = "system_id_marker")] +impl bevy::ecs::system::SystemIdMarker {} +impl ::bevy::app::Plugin for BevyEcsScriptingPlugin { + fn build(&self, app: &mut ::bevy::prelude::App) { + let mut world = app.world_mut(); + register_entity(&mut world); + register_on_add(&mut world); + register_on_insert(&mut world); + register_on_remove(&mut world); + register_on_replace(&mut world); + register_component_id(&mut world); + register_tick(&mut world); + register_component_ticks(&mut world); + register_identifier(&mut world); + register_entity_hash(&mut world); + register_removed_component_entity(&mut world); + register_system_id_marker(&mut world); } } diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_hierarchy.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_hierarchy.rs index 45f345a6ee..778559f8f3 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_hierarchy.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_hierarchy.rs @@ -9,95 +9,84 @@ use bevy_mod_scripting_core::bindings::{ namespace::NamespaceBuilder, }, }; +use bevy_mod_scripting_derive::script_bindings; use crate::*; pub struct BevyHierarchyScriptingPlugin; -impl ::bevy::app::Plugin for BevyHierarchyScriptingPlugin { - fn build(&self, app: &mut ::bevy::prelude::App) { - let mut world = app.world_mut(); - NamespaceBuilder::<::bevy::hierarchy::prelude::Children>::new(world) - .register( - "swap", - | - mut _self: Mut, - a_index: usize, - b_index: usize| - { - let output: () = bevy::hierarchy::prelude::Children::swap( - &mut _self, - a_index, - b_index, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::hierarchy::prelude::Parent>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, +#[script_bindings(remote, name = "children")] +impl bevy::hierarchy::prelude::Children { + fn swap( + mut _self: Mut, + a_index: usize, + b_index: usize, + ) { + let output: () = bevy::hierarchy::prelude::Children::swap( + &mut _self, + a_index, + b_index, ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, + .into(); + output + } +} +#[script_bindings(remote, name = "parent")] +impl bevy::hierarchy::prelude::Parent { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, ) - .register( - "get", - |_self: Ref| { - let output: Val = bevy::hierarchy::prelude::Parent::get( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::hierarchy::HierarchyEvent>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn get(_self: Ref) { + let output: Val = bevy::hierarchy::prelude::Parent::get( + &_self, ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, + .into(); + output + } +} +#[script_bindings(remote, name = "hierarchy_event")] +impl bevy::hierarchy::HierarchyEvent { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +impl ::bevy::app::Plugin for BevyHierarchyScriptingPlugin { + fn build(&self, app: &mut ::bevy::prelude::App) { + let mut world = app.world_mut(); + register_children(&mut world); + register_parent(&mut world); + register_hierarchy_event(&mut world); } } diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_input.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_input.rs index 7a041086d2..f67a167e81 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_input.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_input.rs @@ -9,1530 +9,1248 @@ use bevy_mod_scripting_core::bindings::{ namespace::NamespaceBuilder, }, }; +use bevy_mod_scripting_derive::script_bindings; use crate::*; pub struct BevyInputScriptingPlugin; +#[script_bindings(remote, name = "gamepad")] +impl bevy::input::gamepad::Gamepad { + fn dpad(_self: Ref) { + let output: Val = bevy::input::gamepad::Gamepad::dpad(&_self) + .into(); + output + } + fn just_pressed( + _self: Ref, + button_type: Val, + ) { + let output: bool = bevy::input::gamepad::Gamepad::just_pressed( + &_self, + button_type.into_inner(), + ) + .into(); + output + } + fn just_released( + _self: Ref, + button_type: Val, + ) { + let output: bool = bevy::input::gamepad::Gamepad::just_released( + &_self, + button_type.into_inner(), + ) + .into(); + output + } + fn left_stick(_self: Ref) { + let output: Val = bevy::input::gamepad::Gamepad::left_stick( + &_self, + ) + .into(); + output + } + fn pressed( + _self: Ref, + button_type: Val, + ) { + let output: bool = bevy::input::gamepad::Gamepad::pressed( + &_self, + button_type.into_inner(), + ) + .into(); + output + } + fn product_id(_self: Ref) { + let output: std::option::Option = bevy::input::gamepad::Gamepad::product_id( + &_self, + ) + .into(); + output + } + fn right_stick(_self: Ref) { + let output: Val = bevy::input::gamepad::Gamepad::right_stick( + &_self, + ) + .into(); + output + } + fn vendor_id(_self: Ref) { + let output: std::option::Option = bevy::input::gamepad::Gamepad::vendor_id( + &_self, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "gamepad_axis")] +impl bevy::input::gamepad::GamepadAxis { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "gamepad_button")] +impl bevy::input::gamepad::GamepadButton { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "gamepad_settings")] +impl bevy::input::gamepad::GamepadSettings { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "key_code")] +impl bevy::input::keyboard::KeyCode { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "mouse_button")] +impl bevy::input::mouse::MouseButton { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "touch_input")] +impl bevy::input::touch::TouchInput { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "keyboard_focus_lost")] +impl bevy::input::keyboard::KeyboardFocusLost { + fn assert_receiver_is_total_eq( + _self: Ref, + ) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "keyboard_input")] +impl bevy::input::keyboard::KeyboardInput { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "accumulated_mouse_motion")] +impl bevy::input::mouse::AccumulatedMouseMotion { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "accumulated_mouse_scroll")] +impl bevy::input::mouse::AccumulatedMouseScroll { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "mouse_button_input")] +impl bevy::input::mouse::MouseButtonInput { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "mouse_motion")] +impl bevy::input::mouse::MouseMotion { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "mouse_wheel")] +impl bevy::input::mouse::MouseWheel { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "gamepad_axis_changed_event")] +impl bevy::input::gamepad::GamepadAxisChangedEvent { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn new( + entity: Val, + axis: Val, + value: f32, + ) { + let output: Val = bevy::input::gamepad::GamepadAxisChangedEvent::new( + entity.into_inner(), + axis.into_inner(), + value, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "gamepad_button_changed_event")] +impl bevy::input::gamepad::GamepadButtonChangedEvent { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn new( + entity: Val, + button: Val, + state: Val, + value: f32, + ) { + let output: Val = bevy::input::gamepad::GamepadButtonChangedEvent::new( + entity.into_inner(), + button.into_inner(), + state.into_inner(), + value, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "gamepad_button_state_changed_event")] +impl bevy::input::gamepad::GamepadButtonStateChangedEvent { + fn assert_receiver_is_total_eq( + _self: Ref, + ) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn new( + entity: Val, + button: Val, + state: Val, + ) { + let output: Val = bevy::input::gamepad::GamepadButtonStateChangedEvent::new( + entity.into_inner(), + button.into_inner(), + state.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "gamepad_connection")] +impl bevy::input::gamepad::GamepadConnection { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "gamepad_connection_event")] +impl bevy::input::gamepad::GamepadConnectionEvent { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn connected(_self: Ref) { + let output: bool = bevy::input::gamepad::GamepadConnectionEvent::connected( + &_self, + ) + .into(); + output + } + fn disconnected(_self: Ref) { + let output: bool = bevy::input::gamepad::GamepadConnectionEvent::disconnected( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn new( + gamepad: Val, + connection: Val, + ) { + let output: Val = bevy::input::gamepad::GamepadConnectionEvent::new( + gamepad.into_inner(), + connection.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "gamepad_event")] +impl bevy::input::gamepad::GamepadEvent { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "gamepad_input")] +impl bevy::input::gamepad::GamepadInput { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "gamepad_rumble_request")] +impl bevy::input::gamepad::GamepadRumbleRequest { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn gamepad(_self: Ref) { + let output: Val = bevy::input::gamepad::GamepadRumbleRequest::gamepad( + &_self, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "raw_gamepad_axis_changed_event")] +impl bevy::input::gamepad::RawGamepadAxisChangedEvent { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn new( + gamepad: Val, + axis_type: Val, + value: f32, + ) { + let output: Val = bevy::input::gamepad::RawGamepadAxisChangedEvent::new( + gamepad.into_inner(), + axis_type.into_inner(), + value, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "raw_gamepad_button_changed_event")] +impl bevy::input::gamepad::RawGamepadButtonChangedEvent { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn new( + gamepad: Val, + button_type: Val, + value: f32, + ) { + let output: Val = bevy::input::gamepad::RawGamepadButtonChangedEvent::new( + gamepad.into_inner(), + button_type.into_inner(), + value, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "raw_gamepad_event")] +impl bevy::input::gamepad::RawGamepadEvent { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "pinch_gesture")] +impl bevy::input::gestures::PinchGesture { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "rotation_gesture")] +impl bevy::input::gestures::RotationGesture { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "double_tap_gesture")] +impl bevy::input::gestures::DoubleTapGesture { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "pan_gesture")] +impl bevy::input::gestures::PanGesture { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "button_state")] +impl bevy::input::ButtonState { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn is_pressed(_self: Ref) { + let output: bool = bevy::input::ButtonState::is_pressed(&_self).into(); + output + } +} +#[script_bindings(remote, name = "button_settings")] +impl bevy::input::gamepad::ButtonSettings { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn is_pressed(_self: Ref, value: f32) { + let output: bool = bevy::input::gamepad::ButtonSettings::is_pressed( + &_self, + value, + ) + .into(); + output + } + fn is_released(_self: Ref, value: f32) { + let output: bool = bevy::input::gamepad::ButtonSettings::is_released( + &_self, + value, + ) + .into(); + output + } + fn press_threshold(_self: Ref) { + let output: f32 = bevy::input::gamepad::ButtonSettings::press_threshold(&_self) + .into(); + output + } + fn release_threshold(_self: Ref) { + let output: f32 = bevy::input::gamepad::ButtonSettings::release_threshold(&_self) + .into(); + output + } + fn set_press_threshold( + mut _self: Mut, + value: f32, + ) { + let output: f32 = bevy::input::gamepad::ButtonSettings::set_press_threshold( + &mut _self, + value, + ) + .into(); + output + } + fn set_release_threshold( + mut _self: Mut, + value: f32, + ) { + let output: f32 = bevy::input::gamepad::ButtonSettings::set_release_threshold( + &mut _self, + value, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "axis_settings")] +impl bevy::input::gamepad::AxisSettings { + fn clamp(_self: Ref, new_value: f32) { + let output: f32 = bevy::input::gamepad::AxisSettings::clamp(&_self, new_value) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn deadzone_lowerbound(_self: Ref) { + let output: f32 = bevy::input::gamepad::AxisSettings::deadzone_lowerbound(&_self) + .into(); + output + } + fn deadzone_upperbound(_self: Ref) { + let output: f32 = bevy::input::gamepad::AxisSettings::deadzone_upperbound(&_self) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn filter( + _self: Ref, + new_value: f32, + old_value: std::option::Option, + ) { + let output: std::option::Option = bevy::input::gamepad::AxisSettings::filter( + &_self, + new_value, + old_value, + ) + .into(); + output + } + fn livezone_lowerbound(_self: Ref) { + let output: f32 = bevy::input::gamepad::AxisSettings::livezone_lowerbound(&_self) + .into(); + output + } + fn livezone_upperbound(_self: Ref) { + let output: f32 = bevy::input::gamepad::AxisSettings::livezone_upperbound(&_self) + .into(); + output + } + fn set_deadzone_lowerbound( + mut _self: Mut, + value: f32, + ) { + let output: f32 = bevy::input::gamepad::AxisSettings::set_deadzone_lowerbound( + &mut _self, + value, + ) + .into(); + output + } + fn set_deadzone_upperbound( + mut _self: Mut, + value: f32, + ) { + let output: f32 = bevy::input::gamepad::AxisSettings::set_deadzone_upperbound( + &mut _self, + value, + ) + .into(); + output + } + fn set_livezone_lowerbound( + mut _self: Mut, + value: f32, + ) { + let output: f32 = bevy::input::gamepad::AxisSettings::set_livezone_lowerbound( + &mut _self, + value, + ) + .into(); + output + } + fn set_livezone_upperbound( + mut _self: Mut, + value: f32, + ) { + let output: f32 = bevy::input::gamepad::AxisSettings::set_livezone_upperbound( + &mut _self, + value, + ) + .into(); + output + } + fn set_threshold(mut _self: Mut, value: f32) { + let output: f32 = bevy::input::gamepad::AxisSettings::set_threshold( + &mut _self, + value, + ) + .into(); + output + } + fn threshold(_self: Ref) { + let output: f32 = bevy::input::gamepad::AxisSettings::threshold(&_self).into(); + output + } +} +#[script_bindings(remote, name = "button_axis_settings")] +impl bevy::input::gamepad::ButtonAxisSettings { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn filter( + _self: Ref, + new_value: f32, + old_value: std::option::Option, + ) { + let output: std::option::Option = bevy::input::gamepad::ButtonAxisSettings::filter( + &_self, + new_value, + old_value, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "gamepad_rumble_intensity")] +impl bevy::input::gamepad::GamepadRumbleIntensity { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn strong_motor(intensity: f32) { + let output: Val = bevy::input::gamepad::GamepadRumbleIntensity::strong_motor( + intensity, + ) + .into(); + output + } + fn weak_motor(intensity: f32) { + let output: Val = bevy::input::gamepad::GamepadRumbleIntensity::weak_motor( + intensity, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "key")] +impl bevy::input::keyboard::Key { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "native_key_code")] +impl bevy::input::keyboard::NativeKeyCode { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "native_key")] +impl bevy::input::keyboard::NativeKey { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "mouse_scroll_unit")] +impl bevy::input::mouse::MouseScrollUnit { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "touch_phase")] +impl bevy::input::touch::TouchPhase { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "force_touch")] +impl bevy::input::touch::ForceTouch { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} impl ::bevy::app::Plugin for BevyInputScriptingPlugin { fn build(&self, app: &mut ::bevy::prelude::App) { let mut world = app.world_mut(); - NamespaceBuilder::<::bevy::input::gamepad::Gamepad>::new(world) - .register( - "dpad", - |_self: Ref| { - let output: Val = bevy::input::gamepad::Gamepad::dpad( - &_self, - ) - .into(); - output - }, - ) - .register( - "just_pressed", - | - _self: Ref, - button_type: Val| - { - let output: bool = bevy::input::gamepad::Gamepad::just_pressed( - &_self, - button_type.into_inner(), - ) - .into(); - output - }, - ) - .register( - "just_released", - | - _self: Ref, - button_type: Val| - { - let output: bool = bevy::input::gamepad::Gamepad::just_released( - &_self, - button_type.into_inner(), - ) - .into(); - output - }, - ) - .register( - "left_stick", - |_self: Ref| { - let output: Val = bevy::input::gamepad::Gamepad::left_stick( - &_self, - ) - .into(); - output - }, - ) - .register( - "pressed", - | - _self: Ref, - button_type: Val| - { - let output: bool = bevy::input::gamepad::Gamepad::pressed( - &_self, - button_type.into_inner(), - ) - .into(); - output - }, - ) - .register( - "product_id", - |_self: Ref| { - let output: std::option::Option = bevy::input::gamepad::Gamepad::product_id( - &_self, - ) - .into(); - output - }, - ) - .register( - "right_stick", - |_self: Ref| { - let output: Val = bevy::input::gamepad::Gamepad::right_stick( - &_self, - ) - .into(); - output - }, - ) - .register( - "vendor_id", - |_self: Ref| { - let output: std::option::Option = bevy::input::gamepad::Gamepad::vendor_id( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::gamepad::GamepadAxis>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::gamepad::GamepadButton>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::gamepad::GamepadSettings>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::keyboard::KeyCode>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::mouse::MouseButton>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::touch::TouchInput>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::keyboard::KeyboardFocusLost>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::keyboard::KeyboardInput>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::mouse::AccumulatedMouseMotion>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::mouse::AccumulatedMouseScroll>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::mouse::MouseButtonInput>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::mouse::MouseMotion>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::mouse::MouseWheel>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::gamepad::GamepadAxisChangedEvent>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "new", - | - entity: Val, - axis: Val, - value: f32| - { - let output: Val = bevy::input::gamepad::GamepadAxisChangedEvent::new( - entity.into_inner(), - axis.into_inner(), - value, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::gamepad::GamepadButtonChangedEvent>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "new", - | - entity: Val, - button: Val, - state: Val, - value: f32| - { - let output: Val = bevy::input::gamepad::GamepadButtonChangedEvent::new( - entity.into_inner(), - button.into_inner(), - state.into_inner(), - value, - ) - .into(); - output - }, - ); - NamespaceBuilder::< - ::bevy::input::gamepad::GamepadButtonStateChangedEvent, - >::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val< - bevy::input::gamepad::GamepadButtonStateChangedEvent, - > = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "new", - | - entity: Val, - button: Val, - state: Val| - { - let output: Val< - bevy::input::gamepad::GamepadButtonStateChangedEvent, - > = bevy::input::gamepad::GamepadButtonStateChangedEvent::new( - entity.into_inner(), - button.into_inner(), - state.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::gamepad::GamepadConnection>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::gamepad::GamepadConnectionEvent>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "connected", - |_self: Ref| { - let output: bool = bevy::input::gamepad::GamepadConnectionEvent::connected( - &_self, - ) - .into(); - output - }, - ) - .register( - "disconnected", - |_self: Ref| { - let output: bool = bevy::input::gamepad::GamepadConnectionEvent::disconnected( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "new", - | - gamepad: Val, - connection: Val| - { - let output: Val = bevy::input::gamepad::GamepadConnectionEvent::new( - gamepad.into_inner(), - connection.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::gamepad::GamepadEvent>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::gamepad::GamepadInput>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::gamepad::GamepadRumbleRequest>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "gamepad", - |_self: Ref| { - let output: Val = bevy::input::gamepad::GamepadRumbleRequest::gamepad( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::< - ::bevy::input::gamepad::RawGamepadAxisChangedEvent, - >::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "new", - | - gamepad: Val, - axis_type: Val, - value: f32| - { - let output: Val = bevy::input::gamepad::RawGamepadAxisChangedEvent::new( - gamepad.into_inner(), - axis_type.into_inner(), - value, - ) - .into(); - output - }, - ); - NamespaceBuilder::< - ::bevy::input::gamepad::RawGamepadButtonChangedEvent, - >::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val< - bevy::input::gamepad::RawGamepadButtonChangedEvent, - > = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "new", - | - gamepad: Val, - button_type: Val, - value: f32| - { - let output: Val< - bevy::input::gamepad::RawGamepadButtonChangedEvent, - > = bevy::input::gamepad::RawGamepadButtonChangedEvent::new( - gamepad.into_inner(), - button_type.into_inner(), - value, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::gamepad::RawGamepadEvent>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::gestures::PinchGesture>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::gestures::RotationGesture>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::gestures::DoubleTapGesture>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::gestures::PanGesture>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::ButtonState>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "is_pressed", - |_self: Ref| { - let output: bool = bevy::input::ButtonState::is_pressed(&_self) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::gamepad::ButtonSettings>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "is_pressed", - |_self: Ref, value: f32| { - let output: bool = bevy::input::gamepad::ButtonSettings::is_pressed( - &_self, - value, - ) - .into(); - output - }, - ) - .register( - "is_released", - |_self: Ref, value: f32| { - let output: bool = bevy::input::gamepad::ButtonSettings::is_released( - &_self, - value, - ) - .into(); - output - }, - ) - .register( - "press_threshold", - |_self: Ref| { - let output: f32 = bevy::input::gamepad::ButtonSettings::press_threshold( - &_self, - ) - .into(); - output - }, - ) - .register( - "release_threshold", - |_self: Ref| { - let output: f32 = bevy::input::gamepad::ButtonSettings::release_threshold( - &_self, - ) - .into(); - output - }, - ) - .register( - "set_press_threshold", - |mut _self: Mut, value: f32| { - let output: f32 = bevy::input::gamepad::ButtonSettings::set_press_threshold( - &mut _self, - value, - ) - .into(); - output - }, - ) - .register( - "set_release_threshold", - |mut _self: Mut, value: f32| { - let output: f32 = bevy::input::gamepad::ButtonSettings::set_release_threshold( - &mut _self, - value, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::gamepad::AxisSettings>::new(world) - .register( - "clamp", - |_self: Ref, new_value: f32| { - let output: f32 = bevy::input::gamepad::AxisSettings::clamp( - &_self, - new_value, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "deadzone_lowerbound", - |_self: Ref| { - let output: f32 = bevy::input::gamepad::AxisSettings::deadzone_lowerbound( - &_self, - ) - .into(); - output - }, - ) - .register( - "deadzone_upperbound", - |_self: Ref| { - let output: f32 = bevy::input::gamepad::AxisSettings::deadzone_upperbound( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "filter", - | - _self: Ref, - new_value: f32, - old_value: std::option::Option| - { - let output: std::option::Option = bevy::input::gamepad::AxisSettings::filter( - &_self, - new_value, - old_value, - ) - .into(); - output - }, - ) - .register( - "livezone_lowerbound", - |_self: Ref| { - let output: f32 = bevy::input::gamepad::AxisSettings::livezone_lowerbound( - &_self, - ) - .into(); - output - }, - ) - .register( - "livezone_upperbound", - |_self: Ref| { - let output: f32 = bevy::input::gamepad::AxisSettings::livezone_upperbound( - &_self, - ) - .into(); - output - }, - ) - .register( - "set_deadzone_lowerbound", - |mut _self: Mut, value: f32| { - let output: f32 = bevy::input::gamepad::AxisSettings::set_deadzone_lowerbound( - &mut _self, - value, - ) - .into(); - output - }, - ) - .register( - "set_deadzone_upperbound", - |mut _self: Mut, value: f32| { - let output: f32 = bevy::input::gamepad::AxisSettings::set_deadzone_upperbound( - &mut _self, - value, - ) - .into(); - output - }, - ) - .register( - "set_livezone_lowerbound", - |mut _self: Mut, value: f32| { - let output: f32 = bevy::input::gamepad::AxisSettings::set_livezone_lowerbound( - &mut _self, - value, - ) - .into(); - output - }, - ) - .register( - "set_livezone_upperbound", - |mut _self: Mut, value: f32| { - let output: f32 = bevy::input::gamepad::AxisSettings::set_livezone_upperbound( - &mut _self, - value, - ) - .into(); - output - }, - ) - .register( - "set_threshold", - |mut _self: Mut, value: f32| { - let output: f32 = bevy::input::gamepad::AxisSettings::set_threshold( - &mut _self, - value, - ) - .into(); - output - }, - ) - .register( - "threshold", - |_self: Ref| { - let output: f32 = bevy::input::gamepad::AxisSettings::threshold( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::gamepad::ButtonAxisSettings>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "filter", - | - _self: Ref, - new_value: f32, - old_value: std::option::Option| - { - let output: std::option::Option = bevy::input::gamepad::ButtonAxisSettings::filter( - &_self, - new_value, - old_value, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::gamepad::GamepadRumbleIntensity>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "strong_motor", - |intensity: f32| { - let output: Val = bevy::input::gamepad::GamepadRumbleIntensity::strong_motor( - intensity, - ) - .into(); - output - }, - ) - .register( - "weak_motor", - |intensity: f32| { - let output: Val = bevy::input::gamepad::GamepadRumbleIntensity::weak_motor( - intensity, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::keyboard::Key>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::keyboard::NativeKeyCode>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::keyboard::NativeKey>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::mouse::MouseScrollUnit>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::touch::TouchPhase>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::input::touch::ForceTouch>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); + register_gamepad(&mut world); + register_gamepad_axis(&mut world); + register_gamepad_button(&mut world); + register_gamepad_settings(&mut world); + register_key_code(&mut world); + register_mouse_button(&mut world); + register_touch_input(&mut world); + register_keyboard_focus_lost(&mut world); + register_keyboard_input(&mut world); + register_accumulated_mouse_motion(&mut world); + register_accumulated_mouse_scroll(&mut world); + register_mouse_button_input(&mut world); + register_mouse_motion(&mut world); + register_mouse_wheel(&mut world); + register_gamepad_axis_changed_event(&mut world); + register_gamepad_button_changed_event(&mut world); + register_gamepad_button_state_changed_event(&mut world); + register_gamepad_connection(&mut world); + register_gamepad_connection_event(&mut world); + register_gamepad_event(&mut world); + register_gamepad_input(&mut world); + register_gamepad_rumble_request(&mut world); + register_raw_gamepad_axis_changed_event(&mut world); + register_raw_gamepad_button_changed_event(&mut world); + register_raw_gamepad_event(&mut world); + register_pinch_gesture(&mut world); + register_rotation_gesture(&mut world); + register_double_tap_gesture(&mut world); + register_pan_gesture(&mut world); + register_button_state(&mut world); + register_button_settings(&mut world); + register_axis_settings(&mut world); + register_button_axis_settings(&mut world); + register_gamepad_rumble_intensity(&mut world); + register_key(&mut world); + register_native_key_code(&mut world); + register_native_key(&mut world); + register_mouse_scroll_unit(&mut world); + register_touch_phase(&mut world); + register_force_touch(&mut world); } } diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_math.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_math.rs index 0a6ef265da..23c55f007a 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_math.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_math.rs @@ -9,4539 +9,3307 @@ use bevy_mod_scripting_core::bindings::{ namespace::NamespaceBuilder, }, }; +use bevy_mod_scripting_derive::script_bindings; use crate::*; pub struct BevyMathScriptingPlugin; +#[script_bindings(remote, name = "aspect_ratio")] +impl bevy::math::AspectRatio { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn inverse(_self: Ref) { + let output: Val = bevy::math::AspectRatio::inverse( + &_self, + ) + .into(); + output + } + fn is_landscape(_self: Ref) { + let output: bool = bevy::math::AspectRatio::is_landscape(&_self).into(); + output + } + fn is_portrait(_self: Ref) { + let output: bool = bevy::math::AspectRatio::is_portrait(&_self).into(); + output + } + fn is_square(_self: Ref) { + let output: bool = bevy::math::AspectRatio::is_square(&_self).into(); + output + } + fn ratio(_self: Ref) { + let output: f32 = bevy::math::AspectRatio::ratio(&_self).into(); + output + } +} +#[script_bindings(remote, name = "compass_octant")] +impl bevy::math::CompassOctant { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "compass_quadrant")] +impl bevy::math::CompassQuadrant { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "isometry_2_d")] +impl bevy::math::Isometry2d { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn from_rotation(rotation: Val) { + let output: Val = bevy::math::Isometry2d::from_rotation( + rotation.into_inner(), + ) + .into(); + output + } + fn from_translation(translation: Val) { + let output: Val = bevy::math::Isometry2d::from_translation( + translation.into_inner(), + ) + .into(); + output + } + fn from_xy(x: f32, y: f32) { + let output: Val = bevy::math::Isometry2d::from_xy(x, y) + .into(); + output + } + fn inverse(_self: Ref) { + let output: Val = bevy::math::Isometry2d::inverse(&_self) + .into(); + output + } + fn inverse_mul( + _self: Ref, + rhs: Val, + ) { + let output: Val = bevy::math::Isometry2d::inverse_mul( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn inverse_transform_point( + _self: Ref, + point: Val, + ) { + let output: Val = bevy::math::Isometry2d::inverse_transform_point( + &_self, + point.into_inner(), + ) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn new( + translation: Val, + rotation: Val, + ) { + let output: Val = bevy::math::Isometry2d::new( + translation.into_inner(), + rotation.into_inner(), + ) + .into(); + output + } + fn transform_point( + _self: Ref, + point: Val, + ) { + let output: Val = bevy::math::Isometry2d::transform_point( + &_self, + point.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "isometry_3_d")] +impl bevy::math::Isometry3d { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn from_rotation(rotation: Val) { + let output: Val = bevy::math::Isometry3d::from_rotation( + rotation.into_inner(), + ) + .into(); + output + } + fn from_xyz(x: f32, y: f32, z: f32) { + let output: Val = bevy::math::Isometry3d::from_xyz( + x, + y, + z, + ) + .into(); + output + } + fn inverse(_self: Ref) { + let output: Val = bevy::math::Isometry3d::inverse(&_self) + .into(); + output + } + fn inverse_mul( + _self: Ref, + rhs: Val, + ) { + let output: Val = bevy::math::Isometry3d::inverse_mul( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } +} +#[script_bindings(remote, name = "ray_2_d")] +impl bevy::math::Ray2d { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn get_point(_self: Ref, distance: f32) { + let output: Val = bevy::math::Ray2d::get_point( + &_self, + distance, + ) + .into(); + output + } + fn intersect_plane( + _self: Ref, + plane_origin: Val, + plane: Val, + ) { + let output: std::option::Option = bevy::math::Ray2d::intersect_plane( + &_self, + plane_origin.into_inner(), + plane.into_inner(), + ) + .into(); + output + } + fn new( + origin: Val, + direction: Val, + ) { + let output: Val = bevy::math::Ray2d::new( + origin.into_inner(), + direction.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "ray_3_d")] +impl bevy::math::Ray3d { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn get_point(_self: Ref, distance: f32) { + let output: Val = bevy::math::Ray3d::get_point( + &_self, + distance, + ) + .into(); + output + } + fn intersect_plane( + _self: Ref, + plane_origin: Val, + plane: Val, + ) { + let output: std::option::Option = bevy::math::Ray3d::intersect_plane( + &_self, + plane_origin.into_inner(), + plane.into_inner(), + ) + .into(); + output + } + fn new( + origin: Val, + direction: Val, + ) { + let output: Val = bevy::math::Ray3d::new( + origin.into_inner(), + direction.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "rot_2")] +impl bevy::math::Rot2 { + fn angle_between(_self: Val, other: Val) { + let output: f32 = bevy::math::Rot2::angle_between( + _self.into_inner(), + other.into_inner(), + ) + .into(); + output + } + fn angle_to(_self: Val, other: Val) { + let output: f32 = bevy::math::Rot2::angle_to( + _self.into_inner(), + other.into_inner(), + ) + .into(); + output + } + fn as_degrees(_self: Val) { + let output: f32 = bevy::math::Rot2::as_degrees(_self.into_inner()).into(); + output + } + fn as_radians(_self: Val) { + let output: f32 = bevy::math::Rot2::as_radians(_self.into_inner()).into(); + output + } + fn as_turn_fraction(_self: Val) { + let output: f32 = bevy::math::Rot2::as_turn_fraction(_self.into_inner()).into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn degrees(degrees: f32) { + let output: Val = bevy::math::Rot2::degrees(degrees).into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn fast_renormalize(_self: Val) { + let output: Val = bevy::math::Rot2::fast_renormalize( + _self.into_inner(), + ) + .into(); + output + } + fn from_sin_cos(sin: f32, cos: f32) { + let output: Val = bevy::math::Rot2::from_sin_cos(sin, cos) + .into(); + output + } + fn inverse(_self: Val) { + let output: Val = bevy::math::Rot2::inverse(_self.into_inner()) + .into(); + output + } + fn is_finite(_self: Val) { + let output: bool = bevy::math::Rot2::is_finite(_self.into_inner()).into(); + output + } + fn is_nan(_self: Val) { + let output: bool = bevy::math::Rot2::is_nan(_self.into_inner()).into(); + output + } + fn is_near_identity(_self: Val) { + let output: bool = bevy::math::Rot2::is_near_identity(_self.into_inner()).into(); + output + } + fn is_normalized(_self: Val) { + let output: bool = bevy::math::Rot2::is_normalized(_self.into_inner()).into(); + output + } + fn length(_self: Val) { + let output: f32 = bevy::math::Rot2::length(_self.into_inner()).into(); + output + } + fn length_recip(_self: Val) { + let output: f32 = bevy::math::Rot2::length_recip(_self.into_inner()).into(); + output + } + fn length_squared(_self: Val) { + let output: f32 = bevy::math::Rot2::length_squared(_self.into_inner()).into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, direction: Val) { + let output: Val = >::mul(_self.into_inner(), direction.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn nlerp(_self: Val, end: Val, s: f32) { + let output: Val = bevy::math::Rot2::nlerp( + _self.into_inner(), + end.into_inner(), + s, + ) + .into(); + output + } + fn normalize(_self: Val) { + let output: Val = bevy::math::Rot2::normalize( + _self.into_inner(), + ) + .into(); + output + } + fn radians(radians: f32) { + let output: Val = bevy::math::Rot2::radians(radians).into(); + output + } + fn sin_cos(_self: Val) { + let output: (f32, f32) = bevy::math::Rot2::sin_cos(_self.into_inner()).into(); + output + } + fn slerp(_self: Val, end: Val, s: f32) { + let output: Val = bevy::math::Rot2::slerp( + _self.into_inner(), + end.into_inner(), + s, + ) + .into(); + output + } + fn turn_fraction(fraction: f32) { + let output: Val = bevy::math::Rot2::turn_fraction(fraction) + .into(); + output + } +} +#[script_bindings(remote, name = "dir_2")] +impl bevy::math::prelude::Dir2 { + fn as_vec2(_self: Ref) { + let output: Val = bevy::math::prelude::Dir2::as_vec2( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn fast_renormalize(_self: Val) { + let output: Val = bevy::math::prelude::Dir2::fast_renormalize( + _self.into_inner(), + ) + .into(); + output + } + fn from_xy_unchecked(x: f32, y: f32) { + let output: Val = bevy::math::prelude::Dir2::from_xy_unchecked( + x, + y, + ) + .into(); + output + } + fn mul(_self: Val, rhs: f32) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn new_unchecked(value: Val) { + let output: Val = bevy::math::prelude::Dir2::new_unchecked( + value.into_inner(), + ) + .into(); + output + } + fn rotation_from( + _self: Val, + other: Val, + ) { + let output: Val = bevy::math::prelude::Dir2::rotation_from( + _self.into_inner(), + other.into_inner(), + ) + .into(); + output + } + fn rotation_from_x(_self: Val) { + let output: Val = bevy::math::prelude::Dir2::rotation_from_x( + _self.into_inner(), + ) + .into(); + output + } + fn rotation_from_y(_self: Val) { + let output: Val = bevy::math::prelude::Dir2::rotation_from_y( + _self.into_inner(), + ) + .into(); + output + } + fn rotation_to( + _self: Val, + other: Val, + ) { + let output: Val = bevy::math::prelude::Dir2::rotation_to( + _self.into_inner(), + other.into_inner(), + ) + .into(); + output + } + fn rotation_to_x(_self: Val) { + let output: Val = bevy::math::prelude::Dir2::rotation_to_x( + _self.into_inner(), + ) + .into(); + output + } + fn rotation_to_y(_self: Val) { + let output: Val = bevy::math::prelude::Dir2::rotation_to_y( + _self.into_inner(), + ) + .into(); + output + } + fn slerp( + _self: Val, + rhs: Val, + s: f32, + ) { + let output: Val = bevy::math::prelude::Dir2::slerp( + _self.into_inner(), + rhs.into_inner(), + s, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "dir_3")] +impl bevy::math::prelude::Dir3 { + fn as_vec3(_self: Ref) { + let output: Val = bevy::math::prelude::Dir3::as_vec3( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn fast_renormalize(_self: Val) { + let output: Val = bevy::math::prelude::Dir3::fast_renormalize( + _self.into_inner(), + ) + .into(); + output + } + fn from_xyz_unchecked(x: f32, y: f32, z: f32) { + let output: Val = bevy::math::prelude::Dir3::from_xyz_unchecked( + x, + y, + z, + ) + .into(); + output + } + fn mul(_self: Val, rhs: f32) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn new_unchecked(value: Val) { + let output: Val = bevy::math::prelude::Dir3::new_unchecked( + value.into_inner(), + ) + .into(); + output + } + fn slerp( + _self: Val, + rhs: Val, + s: f32, + ) { + let output: Val = bevy::math::prelude::Dir3::slerp( + _self.into_inner(), + rhs.into_inner(), + s, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "dir_3_a")] +impl bevy::math::prelude::Dir3A { + fn as_vec3a(_self: Ref) { + let output: Val = bevy::math::prelude::Dir3A::as_vec3a(&_self) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn fast_renormalize(_self: Val) { + let output: Val = bevy::math::prelude::Dir3A::fast_renormalize( + _self.into_inner(), + ) + .into(); + output + } + fn from_xyz_unchecked(x: f32, y: f32, z: f32) { + let output: Val = bevy::math::prelude::Dir3A::from_xyz_unchecked( + x, + y, + z, + ) + .into(); + output + } + fn mul(_self: Val, rhs: f32) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn new_unchecked(value: Val) { + let output: Val = bevy::math::prelude::Dir3A::new_unchecked( + value.into_inner(), + ) + .into(); + output + } + fn slerp( + _self: Val, + rhs: Val, + s: f32, + ) { + let output: Val = bevy::math::prelude::Dir3A::slerp( + _self.into_inner(), + rhs.into_inner(), + s, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "i_rect")] +impl bevy::math::prelude::IRect { + fn as_rect(_self: Ref) { + let output: Val = bevy::math::prelude::IRect::as_rect( + &_self, + ) + .into(); + output + } + fn as_urect(_self: Ref) { + let output: Val = bevy::math::prelude::IRect::as_urect( + &_self, + ) + .into(); + output + } + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn center(_self: Ref) { + let output: Val = bevy::math::prelude::IRect::center( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn contains( + _self: Ref, + point: Val, + ) { + let output: bool = bevy::math::prelude::IRect::contains( + &_self, + point.into_inner(), + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn from_center_half_size( + origin: Val, + half_size: Val, + ) { + let output: Val = bevy::math::prelude::IRect::from_center_half_size( + origin.into_inner(), + half_size.into_inner(), + ) + .into(); + output + } + fn from_center_size( + origin: Val, + size: Val, + ) { + let output: Val = bevy::math::prelude::IRect::from_center_size( + origin.into_inner(), + size.into_inner(), + ) + .into(); + output + } + fn from_corners( + p0: Val, + p1: Val, + ) { + let output: Val = bevy::math::prelude::IRect::from_corners( + p0.into_inner(), + p1.into_inner(), + ) + .into(); + output + } + fn half_size(_self: Ref) { + let output: Val = bevy::math::prelude::IRect::half_size( + &_self, + ) + .into(); + output + } + fn height(_self: Ref) { + let output: i32 = bevy::math::prelude::IRect::height(&_self).into(); + output + } + fn inflate(_self: Ref, expansion: i32) { + let output: Val = bevy::math::prelude::IRect::inflate( + &_self, + expansion, + ) + .into(); + output + } + fn intersect( + _self: Ref, + other: Val, + ) { + let output: Val = bevy::math::prelude::IRect::intersect( + &_self, + other.into_inner(), + ) + .into(); + output + } + fn is_empty(_self: Ref) { + let output: bool = bevy::math::prelude::IRect::is_empty(&_self).into(); + output + } + fn new(x0: i32, y0: i32, x1: i32, y1: i32) { + let output: Val = bevy::math::prelude::IRect::new( + x0, + y0, + x1, + y1, + ) + .into(); + output + } + fn size(_self: Ref) { + let output: Val = bevy::math::prelude::IRect::size( + &_self, + ) + .into(); + output + } + fn union( + _self: Ref, + other: Val, + ) { + let output: Val = bevy::math::prelude::IRect::union( + &_self, + other.into_inner(), + ) + .into(); + output + } + fn union_point( + _self: Ref, + other: Val, + ) { + let output: Val = bevy::math::prelude::IRect::union_point( + &_self, + other.into_inner(), + ) + .into(); + output + } + fn width(_self: Ref) { + let output: i32 = bevy::math::prelude::IRect::width(&_self).into(); + output + } +} +#[script_bindings(remote, name = "rect")] +impl bevy::math::prelude::Rect { + fn as_irect(_self: Ref) { + let output: Val = bevy::math::prelude::Rect::as_irect( + &_self, + ) + .into(); + output + } + fn as_urect(_self: Ref) { + let output: Val = bevy::math::prelude::Rect::as_urect( + &_self, + ) + .into(); + output + } + fn center(_self: Ref) { + let output: Val = bevy::math::prelude::Rect::center( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn contains( + _self: Ref, + point: Val, + ) { + let output: bool = bevy::math::prelude::Rect::contains( + &_self, + point.into_inner(), + ) + .into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn from_center_half_size( + origin: Val, + half_size: Val, + ) { + let output: Val = bevy::math::prelude::Rect::from_center_half_size( + origin.into_inner(), + half_size.into_inner(), + ) + .into(); + output + } + fn from_center_size( + origin: Val, + size: Val, + ) { + let output: Val = bevy::math::prelude::Rect::from_center_size( + origin.into_inner(), + size.into_inner(), + ) + .into(); + output + } + fn from_corners( + p0: Val, + p1: Val, + ) { + let output: Val = bevy::math::prelude::Rect::from_corners( + p0.into_inner(), + p1.into_inner(), + ) + .into(); + output + } + fn half_size(_self: Ref) { + let output: Val = bevy::math::prelude::Rect::half_size( + &_self, + ) + .into(); + output + } + fn height(_self: Ref) { + let output: f32 = bevy::math::prelude::Rect::height(&_self).into(); + output + } + fn inflate(_self: Ref, expansion: f32) { + let output: Val = bevy::math::prelude::Rect::inflate( + &_self, + expansion, + ) + .into(); + output + } + fn intersect( + _self: Ref, + other: Val, + ) { + let output: Val = bevy::math::prelude::Rect::intersect( + &_self, + other.into_inner(), + ) + .into(); + output + } + fn is_empty(_self: Ref) { + let output: bool = bevy::math::prelude::Rect::is_empty(&_self).into(); + output + } + fn new(x0: f32, y0: f32, x1: f32, y1: f32) { + let output: Val = bevy::math::prelude::Rect::new( + x0, + y0, + x1, + y1, + ) + .into(); + output + } + fn normalize( + _self: Ref, + other: Val, + ) { + let output: Val = bevy::math::prelude::Rect::normalize( + &_self, + other.into_inner(), + ) + .into(); + output + } + fn size(_self: Ref) { + let output: Val = bevy::math::prelude::Rect::size( + &_self, + ) + .into(); + output + } + fn union( + _self: Ref, + other: Val, + ) { + let output: Val = bevy::math::prelude::Rect::union( + &_self, + other.into_inner(), + ) + .into(); + output + } + fn union_point( + _self: Ref, + other: Val, + ) { + let output: Val = bevy::math::prelude::Rect::union_point( + &_self, + other.into_inner(), + ) + .into(); + output + } + fn width(_self: Ref) { + let output: f32 = bevy::math::prelude::Rect::width(&_self).into(); + output + } +} +#[script_bindings(remote, name = "u_rect")] +impl bevy::math::prelude::URect { + fn as_irect(_self: Ref) { + let output: Val = bevy::math::prelude::URect::as_irect( + &_self, + ) + .into(); + output + } + fn as_rect(_self: Ref) { + let output: Val = bevy::math::prelude::URect::as_rect( + &_self, + ) + .into(); + output + } + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn center(_self: Ref) { + let output: Val = bevy::math::prelude::URect::center( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn contains( + _self: Ref, + point: Val, + ) { + let output: bool = bevy::math::prelude::URect::contains( + &_self, + point.into_inner(), + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn from_center_half_size( + origin: Val, + half_size: Val, + ) { + let output: Val = bevy::math::prelude::URect::from_center_half_size( + origin.into_inner(), + half_size.into_inner(), + ) + .into(); + output + } + fn from_center_size( + origin: Val, + size: Val, + ) { + let output: Val = bevy::math::prelude::URect::from_center_size( + origin.into_inner(), + size.into_inner(), + ) + .into(); + output + } + fn from_corners( + p0: Val, + p1: Val, + ) { + let output: Val = bevy::math::prelude::URect::from_corners( + p0.into_inner(), + p1.into_inner(), + ) + .into(); + output + } + fn half_size(_self: Ref) { + let output: Val = bevy::math::prelude::URect::half_size( + &_self, + ) + .into(); + output + } + fn height(_self: Ref) { + let output: u32 = bevy::math::prelude::URect::height(&_self).into(); + output + } + fn inflate(_self: Ref, expansion: i32) { + let output: Val = bevy::math::prelude::URect::inflate( + &_self, + expansion, + ) + .into(); + output + } + fn intersect( + _self: Ref, + other: Val, + ) { + let output: Val = bevy::math::prelude::URect::intersect( + &_self, + other.into_inner(), + ) + .into(); + output + } + fn is_empty(_self: Ref) { + let output: bool = bevy::math::prelude::URect::is_empty(&_self).into(); + output + } + fn new(x0: u32, y0: u32, x1: u32, y1: u32) { + let output: Val = bevy::math::prelude::URect::new( + x0, + y0, + x1, + y1, + ) + .into(); + output + } + fn size(_self: Ref) { + let output: Val = bevy::math::prelude::URect::size( + &_self, + ) + .into(); + output + } + fn union( + _self: Ref, + other: Val, + ) { + let output: Val = bevy::math::prelude::URect::union( + &_self, + other.into_inner(), + ) + .into(); + output + } + fn union_point( + _self: Ref, + other: Val, + ) { + let output: Val = bevy::math::prelude::URect::union_point( + &_self, + other.into_inner(), + ) + .into(); + output + } + fn width(_self: Ref) { + let output: u32 = bevy::math::prelude::URect::width(&_self).into(); + output + } +} +#[script_bindings(remote, name = "affine_3")] +impl bevy::math::Affine3 {} +#[script_bindings(remote, name = "aabb_2_d")] +impl bevy::math::bounding::Aabb2d { + fn bounding_circle(_self: Ref) { + let output: Val = bevy::math::bounding::Aabb2d::bounding_circle( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn closest_point( + _self: Ref, + point: Val, + ) { + let output: Val = bevy::math::bounding::Aabb2d::closest_point( + &_self, + point.into_inner(), + ) + .into(); + output + } + fn new( + center: Val, + half_size: Val, + ) { + let output: Val = bevy::math::bounding::Aabb2d::new( + center.into_inner(), + half_size.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "bounding_circle")] +impl bevy::math::bounding::BoundingCircle { + fn aabb_2d(_self: Ref) { + let output: Val = bevy::math::bounding::BoundingCircle::aabb_2d( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn closest_point( + _self: Ref, + point: Val, + ) { + let output: Val = bevy::math::bounding::BoundingCircle::closest_point( + &_self, + point.into_inner(), + ) + .into(); + output + } + fn new(center: Val, radius: f32) { + let output: Val = bevy::math::bounding::BoundingCircle::new( + center.into_inner(), + radius, + ) + .into(); + output + } + fn radius(_self: Ref) { + let output: f32 = bevy::math::bounding::BoundingCircle::radius(&_self).into(); + output + } +} +#[script_bindings(remote, name = "circle")] +impl bevy::math::primitives::Circle { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn closest_point( + _self: Ref, + point: Val, + ) { + let output: Val = bevy::math::primitives::Circle::closest_point( + &_self, + point.into_inner(), + ) + .into(); + output + } + fn diameter(_self: Ref) { + let output: f32 = bevy::math::primitives::Circle::diameter(&_self).into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn new(radius: f32) { + let output: Val = bevy::math::primitives::Circle::new( + radius, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "annulus")] +impl bevy::math::primitives::Annulus { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn closest_point( + _self: Ref, + point: Val, + ) { + let output: Val = bevy::math::primitives::Annulus::closest_point( + &_self, + point.into_inner(), + ) + .into(); + output + } + fn diameter(_self: Ref) { + let output: f32 = bevy::math::primitives::Annulus::diameter(&_self).into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn new(inner_radius: f32, outer_radius: f32) { + let output: Val = bevy::math::primitives::Annulus::new( + inner_radius, + outer_radius, + ) + .into(); + output + } + fn thickness(_self: Ref) { + let output: f32 = bevy::math::primitives::Annulus::thickness(&_self).into(); + output + } +} +#[script_bindings(remote, name = "arc_2_d")] +impl bevy::math::primitives::Arc2d { + fn angle(_self: Ref) { + let output: f32 = bevy::math::primitives::Arc2d::angle(&_self).into(); + output + } + fn apothem(_self: Ref) { + let output: f32 = bevy::math::primitives::Arc2d::apothem(&_self).into(); + output + } + fn chord_length(_self: Ref) { + let output: f32 = bevy::math::primitives::Arc2d::chord_length(&_self).into(); + output + } + fn chord_midpoint(_self: Ref) { + let output: Val = bevy::math::primitives::Arc2d::chord_midpoint( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn from_degrees(radius: f32, angle: f32) { + let output: Val = bevy::math::primitives::Arc2d::from_degrees( + radius, + angle, + ) + .into(); + output + } + fn from_radians(radius: f32, angle: f32) { + let output: Val = bevy::math::primitives::Arc2d::from_radians( + radius, + angle, + ) + .into(); + output + } + fn from_turns(radius: f32, fraction: f32) { + let output: Val = bevy::math::primitives::Arc2d::from_turns( + radius, + fraction, + ) + .into(); + output + } + fn half_chord_length(_self: Ref) { + let output: f32 = bevy::math::primitives::Arc2d::half_chord_length(&_self) + .into(); + output + } + fn is_major(_self: Ref) { + let output: bool = bevy::math::primitives::Arc2d::is_major(&_self).into(); + output + } + fn is_minor(_self: Ref) { + let output: bool = bevy::math::primitives::Arc2d::is_minor(&_self).into(); + output + } + fn left_endpoint(_self: Ref) { + let output: Val = bevy::math::primitives::Arc2d::left_endpoint( + &_self, + ) + .into(); + output + } + fn length(_self: Ref) { + let output: f32 = bevy::math::primitives::Arc2d::length(&_self).into(); + output + } + fn midpoint(_self: Ref) { + let output: Val = bevy::math::primitives::Arc2d::midpoint( + &_self, + ) + .into(); + output + } + fn new(radius: f32, half_angle: f32) { + let output: Val = bevy::math::primitives::Arc2d::new( + radius, + half_angle, + ) + .into(); + output + } + fn right_endpoint(_self: Ref) { + let output: Val = bevy::math::primitives::Arc2d::right_endpoint( + &_self, + ) + .into(); + output + } + fn sagitta(_self: Ref) { + let output: f32 = bevy::math::primitives::Arc2d::sagitta(&_self).into(); + output + } +} +#[script_bindings(remote, name = "capsule_2_d")] +impl bevy::math::primitives::Capsule2d { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn new(radius: f32, length: f32) { + let output: Val = bevy::math::primitives::Capsule2d::new( + radius, + length, + ) + .into(); + output + } + fn to_inner_rectangle(_self: Ref) { + let output: Val = bevy::math::primitives::Capsule2d::to_inner_rectangle( + &_self, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "circular_sector")] +impl bevy::math::primitives::CircularSector { + fn angle(_self: Ref) { + let output: f32 = bevy::math::primitives::CircularSector::angle(&_self).into(); + output + } + fn apothem(_self: Ref) { + let output: f32 = bevy::math::primitives::CircularSector::apothem(&_self).into(); + output + } + fn arc_length(_self: Ref) { + let output: f32 = bevy::math::primitives::CircularSector::arc_length(&_self) + .into(); + output + } + fn chord_length(_self: Ref) { + let output: f32 = bevy::math::primitives::CircularSector::chord_length(&_self) + .into(); + output + } + fn chord_midpoint(_self: Ref) { + let output: Val = bevy::math::primitives::CircularSector::chord_midpoint( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn from_degrees(radius: f32, angle: f32) { + let output: Val = bevy::math::primitives::CircularSector::from_degrees( + radius, + angle, + ) + .into(); + output + } + fn from_radians(radius: f32, angle: f32) { + let output: Val = bevy::math::primitives::CircularSector::from_radians( + radius, + angle, + ) + .into(); + output + } + fn from_turns(radius: f32, fraction: f32) { + let output: Val = bevy::math::primitives::CircularSector::from_turns( + radius, + fraction, + ) + .into(); + output + } + fn half_angle(_self: Ref) { + let output: f32 = bevy::math::primitives::CircularSector::half_angle(&_self) + .into(); + output + } + fn half_chord_length(_self: Ref) { + let output: f32 = bevy::math::primitives::CircularSector::half_chord_length( + &_self, + ) + .into(); + output + } + fn new(radius: f32, angle: f32) { + let output: Val = bevy::math::primitives::CircularSector::new( + radius, + angle, + ) + .into(); + output + } + fn radius(_self: Ref) { + let output: f32 = bevy::math::primitives::CircularSector::radius(&_self).into(); + output + } + fn sagitta(_self: Ref) { + let output: f32 = bevy::math::primitives::CircularSector::sagitta(&_self).into(); + output + } +} +#[script_bindings(remote, name = "circular_segment")] +impl bevy::math::primitives::CircularSegment { + fn angle(_self: Ref) { + let output: f32 = bevy::math::primitives::CircularSegment::angle(&_self).into(); + output + } + fn apothem(_self: Ref) { + let output: f32 = bevy::math::primitives::CircularSegment::apothem(&_self) + .into(); + output + } + fn arc_length(_self: Ref) { + let output: f32 = bevy::math::primitives::CircularSegment::arc_length(&_self) + .into(); + output + } + fn chord_length(_self: Ref) { + let output: f32 = bevy::math::primitives::CircularSegment::chord_length(&_self) + .into(); + output + } + fn chord_midpoint(_self: Ref) { + let output: Val = bevy::math::primitives::CircularSegment::chord_midpoint( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn from_degrees(radius: f32, angle: f32) { + let output: Val = bevy::math::primitives::CircularSegment::from_degrees( + radius, + angle, + ) + .into(); + output + } + fn from_radians(radius: f32, angle: f32) { + let output: Val = bevy::math::primitives::CircularSegment::from_radians( + radius, + angle, + ) + .into(); + output + } + fn from_turns(radius: f32, fraction: f32) { + let output: Val = bevy::math::primitives::CircularSegment::from_turns( + radius, + fraction, + ) + .into(); + output + } + fn half_angle(_self: Ref) { + let output: f32 = bevy::math::primitives::CircularSegment::half_angle(&_self) + .into(); + output + } + fn half_chord_length(_self: Ref) { + let output: f32 = bevy::math::primitives::CircularSegment::half_chord_length( + &_self, + ) + .into(); + output + } + fn new(radius: f32, angle: f32) { + let output: Val = bevy::math::primitives::CircularSegment::new( + radius, + angle, + ) + .into(); + output + } + fn radius(_self: Ref) { + let output: f32 = bevy::math::primitives::CircularSegment::radius(&_self).into(); + output + } + fn sagitta(_self: Ref) { + let output: f32 = bevy::math::primitives::CircularSegment::sagitta(&_self) + .into(); + output + } +} +#[script_bindings(remote, name = "ellipse")] +impl bevy::math::primitives::Ellipse { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eccentricity(_self: Ref) { + let output: f32 = bevy::math::primitives::Ellipse::eccentricity(&_self).into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn focal_length(_self: Ref) { + let output: f32 = bevy::math::primitives::Ellipse::focal_length(&_self).into(); + output + } + fn from_size(size: Val) { + let output: Val = bevy::math::primitives::Ellipse::from_size( + size.into_inner(), + ) + .into(); + output + } + fn new(half_width: f32, half_height: f32) { + let output: Val = bevy::math::primitives::Ellipse::new( + half_width, + half_height, + ) + .into(); + output + } + fn semi_major(_self: Ref) { + let output: f32 = bevy::math::primitives::Ellipse::semi_major(&_self).into(); + output + } + fn semi_minor(_self: Ref) { + let output: f32 = bevy::math::primitives::Ellipse::semi_minor(&_self).into(); + output + } +} +#[script_bindings(remote, name = "line_2_d")] +impl bevy::math::primitives::Line2d { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "plane_2_d")] +impl bevy::math::primitives::Plane2d { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn new(normal: Val) { + let output: Val = bevy::math::primitives::Plane2d::new( + normal.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "rectangle")] +impl bevy::math::primitives::Rectangle { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn closest_point( + _self: Ref, + point: Val, + ) { + let output: Val = bevy::math::primitives::Rectangle::closest_point( + &_self, + point.into_inner(), + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn from_corners( + point1: Val, + point2: Val, + ) { + let output: Val = bevy::math::primitives::Rectangle::from_corners( + point1.into_inner(), + point2.into_inner(), + ) + .into(); + output + } + fn from_length(length: f32) { + let output: Val = bevy::math::primitives::Rectangle::from_length( + length, + ) + .into(); + output + } + fn from_size(size: Val) { + let output: Val = bevy::math::primitives::Rectangle::from_size( + size.into_inner(), + ) + .into(); + output + } + fn new(width: f32, height: f32) { + let output: Val = bevy::math::primitives::Rectangle::new( + width, + height, + ) + .into(); + output + } + fn size(_self: Ref) { + let output: Val = bevy::math::primitives::Rectangle::size( + &_self, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "regular_polygon")] +impl bevy::math::primitives::RegularPolygon { + fn circumradius(_self: Ref) { + let output: f32 = bevy::math::primitives::RegularPolygon::circumradius(&_self) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn external_angle_degrees(_self: Ref) { + let output: f32 = bevy::math::primitives::RegularPolygon::external_angle_degrees( + &_self, + ) + .into(); + output + } + fn external_angle_radians(_self: Ref) { + let output: f32 = bevy::math::primitives::RegularPolygon::external_angle_radians( + &_self, + ) + .into(); + output + } + fn inradius(_self: Ref) { + let output: f32 = bevy::math::primitives::RegularPolygon::inradius(&_self) + .into(); + output + } + fn internal_angle_degrees(_self: Ref) { + let output: f32 = bevy::math::primitives::RegularPolygon::internal_angle_degrees( + &_self, + ) + .into(); + output + } + fn internal_angle_radians(_self: Ref) { + let output: f32 = bevy::math::primitives::RegularPolygon::internal_angle_radians( + &_self, + ) + .into(); + output + } + fn new(circumradius: f32, sides: u32) { + let output: Val = bevy::math::primitives::RegularPolygon::new( + circumradius, + sides, + ) + .into(); + output + } + fn side_length(_self: Ref) { + let output: f32 = bevy::math::primitives::RegularPolygon::side_length(&_self) + .into(); + output + } +} +#[script_bindings(remote, name = "rhombus")] +impl bevy::math::primitives::Rhombus { + fn circumradius(_self: Ref) { + let output: f32 = bevy::math::primitives::Rhombus::circumradius(&_self).into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn closest_point( + _self: Ref, + point: Val, + ) { + let output: Val = bevy::math::primitives::Rhombus::closest_point( + &_self, + point.into_inner(), + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn from_inradius(inradius: f32) { + let output: Val = bevy::math::primitives::Rhombus::from_inradius( + inradius, + ) + .into(); + output + } + fn from_side(side: f32) { + let output: Val = bevy::math::primitives::Rhombus::from_side( + side, + ) + .into(); + output + } + fn inradius(_self: Ref) { + let output: f32 = bevy::math::primitives::Rhombus::inradius(&_self).into(); + output + } + fn new(horizontal_diagonal: f32, vertical_diagonal: f32) { + let output: Val = bevy::math::primitives::Rhombus::new( + horizontal_diagonal, + vertical_diagonal, + ) + .into(); + output + } + fn side(_self: Ref) { + let output: f32 = bevy::math::primitives::Rhombus::side(&_self).into(); + output + } +} +#[script_bindings(remote, name = "segment_2_d")] +impl bevy::math::primitives::Segment2d { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn new(direction: Val, length: f32) { + let output: Val = bevy::math::primitives::Segment2d::new( + direction.into_inner(), + length, + ) + .into(); + output + } + fn point1(_self: Ref) { + let output: Val = bevy::math::primitives::Segment2d::point1( + &_self, + ) + .into(); + output + } + fn point2(_self: Ref) { + let output: Val = bevy::math::primitives::Segment2d::point2( + &_self, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "triangle_2_d")] +impl bevy::math::primitives::Triangle2d { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn is_acute(_self: Ref) { + let output: bool = bevy::math::primitives::Triangle2d::is_acute(&_self).into(); + output + } + fn is_degenerate(_self: Ref) { + let output: bool = bevy::math::primitives::Triangle2d::is_degenerate(&_self) + .into(); + output + } + fn is_obtuse(_self: Ref) { + let output: bool = bevy::math::primitives::Triangle2d::is_obtuse(&_self).into(); + output + } + fn new( + a: Val, + b: Val, + c: Val, + ) { + let output: Val = bevy::math::primitives::Triangle2d::new( + a.into_inner(), + b.into_inner(), + c.into_inner(), + ) + .into(); + output + } + fn reverse(mut _self: Mut) { + let output: () = bevy::math::primitives::Triangle2d::reverse(&mut _self).into(); + output + } + fn reversed(_self: Val) { + let output: Val = bevy::math::primitives::Triangle2d::reversed( + _self.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "aabb_3_d")] +impl bevy::math::bounding::Aabb3d { + fn bounding_sphere(_self: Ref) { + let output: Val = bevy::math::bounding::Aabb3d::bounding_sphere( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "bounding_sphere")] +impl bevy::math::bounding::BoundingSphere { + fn aabb_3d(_self: Ref) { + let output: Val = bevy::math::bounding::BoundingSphere::aabb_3d( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn radius(_self: Ref) { + let output: f32 = bevy::math::bounding::BoundingSphere::radius(&_self).into(); + output + } +} +#[script_bindings(remote, name = "sphere")] +impl bevy::math::primitives::Sphere { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn closest_point( + _self: Ref, + point: Val, + ) { + let output: Val = bevy::math::primitives::Sphere::closest_point( + &_self, + point.into_inner(), + ) + .into(); + output + } + fn diameter(_self: Ref) { + let output: f32 = bevy::math::primitives::Sphere::diameter(&_self).into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn new(radius: f32) { + let output: Val = bevy::math::primitives::Sphere::new( + radius, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "cuboid")] +impl bevy::math::primitives::Cuboid { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn closest_point( + _self: Ref, + point: Val, + ) { + let output: Val = bevy::math::primitives::Cuboid::closest_point( + &_self, + point.into_inner(), + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn from_corners( + point1: Val, + point2: Val, + ) { + let output: Val = bevy::math::primitives::Cuboid::from_corners( + point1.into_inner(), + point2.into_inner(), + ) + .into(); + output + } + fn from_length(length: f32) { + let output: Val = bevy::math::primitives::Cuboid::from_length( + length, + ) + .into(); + output + } + fn from_size(size: Val) { + let output: Val = bevy::math::primitives::Cuboid::from_size( + size.into_inner(), + ) + .into(); + output + } + fn new(x_length: f32, y_length: f32, z_length: f32) { + let output: Val = bevy::math::primitives::Cuboid::new( + x_length, + y_length, + z_length, + ) + .into(); + output + } + fn size(_self: Ref) { + let output: Val = bevy::math::primitives::Cuboid::size( + &_self, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "cylinder")] +impl bevy::math::primitives::Cylinder { + fn base(_self: Ref) { + let output: Val = bevy::math::primitives::Cylinder::base( + &_self, + ) + .into(); + output + } + fn base_area(_self: Ref) { + let output: f32 = bevy::math::primitives::Cylinder::base_area(&_self).into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn lateral_area(_self: Ref) { + let output: f32 = bevy::math::primitives::Cylinder::lateral_area(&_self).into(); + output + } + fn new(radius: f32, height: f32) { + let output: Val = bevy::math::primitives::Cylinder::new( + radius, + height, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "capsule_3_d")] +impl bevy::math::primitives::Capsule3d { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn new(radius: f32, length: f32) { + let output: Val = bevy::math::primitives::Capsule3d::new( + radius, + length, + ) + .into(); + output + } + fn to_cylinder(_self: Ref) { + let output: Val = bevy::math::primitives::Capsule3d::to_cylinder( + &_self, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "cone")] +impl bevy::math::primitives::Cone { + fn base(_self: Ref) { + let output: Val = bevy::math::primitives::Cone::base( + &_self, + ) + .into(); + output + } + fn base_area(_self: Ref) { + let output: f32 = bevy::math::primitives::Cone::base_area(&_self).into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn lateral_area(_self: Ref) { + let output: f32 = bevy::math::primitives::Cone::lateral_area(&_self).into(); + output + } + fn new(radius: f32, height: f32) { + let output: Val = bevy::math::primitives::Cone::new( + radius, + height, + ) + .into(); + output + } + fn slant_height(_self: Ref) { + let output: f32 = bevy::math::primitives::Cone::slant_height(&_self).into(); + output + } +} +#[script_bindings(remote, name = "conical_frustum")] +impl bevy::math::primitives::ConicalFrustum { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "infinite_plane_3_d")] +impl bevy::math::primitives::InfinitePlane3d { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn isometry_from_xy( + _self: Ref, + origin: Val, + ) { + let output: Val = bevy::math::primitives::InfinitePlane3d::isometry_from_xy( + &_self, + origin.into_inner(), + ) + .into(); + output + } + fn isometry_into_xy( + _self: Ref, + origin: Val, + ) { + let output: Val = bevy::math::primitives::InfinitePlane3d::isometry_into_xy( + &_self, + origin.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "line_3_d")] +impl bevy::math::primitives::Line3d { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "segment_3_d")] +impl bevy::math::primitives::Segment3d { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn new(direction: Val, length: f32) { + let output: Val = bevy::math::primitives::Segment3d::new( + direction.into_inner(), + length, + ) + .into(); + output + } + fn point1(_self: Ref) { + let output: Val = bevy::math::primitives::Segment3d::point1( + &_self, + ) + .into(); + output + } + fn point2(_self: Ref) { + let output: Val = bevy::math::primitives::Segment3d::point2( + &_self, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "torus")] +impl bevy::math::primitives::Torus { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn inner_radius(_self: Ref) { + let output: f32 = bevy::math::primitives::Torus::inner_radius(&_self).into(); + output + } + fn new(inner_radius: f32, outer_radius: f32) { + let output: Val = bevy::math::primitives::Torus::new( + inner_radius, + outer_radius, + ) + .into(); + output + } + fn outer_radius(_self: Ref) { + let output: f32 = bevy::math::primitives::Torus::outer_radius(&_self).into(); + output + } +} +#[script_bindings(remote, name = "triangle_3_d")] +impl bevy::math::primitives::Triangle3d { + fn centroid(_self: Ref) { + let output: Val = bevy::math::primitives::Triangle3d::centroid( + &_self, + ) + .into(); + output + } + fn circumcenter(_self: Ref) { + let output: Val = bevy::math::primitives::Triangle3d::circumcenter( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn is_acute(_self: Ref) { + let output: bool = bevy::math::primitives::Triangle3d::is_acute(&_self).into(); + output + } + fn is_degenerate(_self: Ref) { + let output: bool = bevy::math::primitives::Triangle3d::is_degenerate(&_self) + .into(); + output + } + fn is_obtuse(_self: Ref) { + let output: bool = bevy::math::primitives::Triangle3d::is_obtuse(&_self).into(); + output + } + fn new( + a: Val, + b: Val, + c: Val, + ) { + let output: Val = bevy::math::primitives::Triangle3d::new( + a.into_inner(), + b.into_inner(), + c.into_inner(), + ) + .into(); + output + } + fn reverse(mut _self: Mut) { + let output: () = bevy::math::primitives::Triangle3d::reverse(&mut _self).into(); + output + } + fn reversed(_self: Val) { + let output: Val = bevy::math::primitives::Triangle3d::reversed( + _self.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "ray_cast_2_d")] +impl bevy::math::bounding::RayCast2d { + fn aabb_intersection_at( + _self: Ref, + aabb: Ref, + ) { + let output: std::option::Option = bevy::math::bounding::RayCast2d::aabb_intersection_at( + &_self, + &aabb, + ) + .into(); + output + } + fn circle_intersection_at( + _self: Ref, + circle: Ref, + ) { + let output: std::option::Option = bevy::math::bounding::RayCast2d::circle_intersection_at( + &_self, + &circle, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn direction_recip(_self: Ref) { + let output: Val = bevy::math::bounding::RayCast2d::direction_recip( + &_self, + ) + .into(); + output + } + fn from_ray(ray: Val, max: f32) { + let output: Val = bevy::math::bounding::RayCast2d::from_ray( + ray.into_inner(), + max, + ) + .into(); + output + } + fn new( + origin: Val, + direction: Val, + max: f32, + ) { + let output: Val = bevy::math::bounding::RayCast2d::new( + origin.into_inner(), + direction.into_inner(), + max, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "aabb_cast_2_d")] +impl bevy::math::bounding::AabbCast2d { + fn aabb_collision_at( + _self: Ref, + aabb: Val, + ) { + let output: std::option::Option = bevy::math::bounding::AabbCast2d::aabb_collision_at( + &_self, + aabb.into_inner(), + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn from_ray( + aabb: Val, + ray: Val, + max: f32, + ) { + let output: Val = bevy::math::bounding::AabbCast2d::from_ray( + aabb.into_inner(), + ray.into_inner(), + max, + ) + .into(); + output + } + fn new( + aabb: Val, + origin: Val, + direction: Val, + max: f32, + ) { + let output: Val = bevy::math::bounding::AabbCast2d::new( + aabb.into_inner(), + origin.into_inner(), + direction.into_inner(), + max, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "bounding_circle_cast")] +impl bevy::math::bounding::BoundingCircleCast { + fn circle_collision_at( + _self: Ref, + circle: Val, + ) { + let output: std::option::Option = bevy::math::bounding::BoundingCircleCast::circle_collision_at( + &_self, + circle.into_inner(), + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn from_ray( + circle: Val, + ray: Val, + max: f32, + ) { + let output: Val = bevy::math::bounding::BoundingCircleCast::from_ray( + circle.into_inner(), + ray.into_inner(), + max, + ) + .into(); + output + } + fn new( + circle: Val, + origin: Val, + direction: Val, + max: f32, + ) { + let output: Val = bevy::math::bounding::BoundingCircleCast::new( + circle.into_inner(), + origin.into_inner(), + direction.into_inner(), + max, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "ray_cast_3_d")] +impl bevy::math::bounding::RayCast3d { + fn aabb_intersection_at( + _self: Ref, + aabb: Ref, + ) { + let output: std::option::Option = bevy::math::bounding::RayCast3d::aabb_intersection_at( + &_self, + &aabb, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn direction_recip(_self: Ref) { + let output: Val = bevy::math::bounding::RayCast3d::direction_recip( + &_self, + ) + .into(); + output + } + fn from_ray(ray: Val, max: f32) { + let output: Val = bevy::math::bounding::RayCast3d::from_ray( + ray.into_inner(), + max, + ) + .into(); + output + } + fn sphere_intersection_at( + _self: Ref, + sphere: Ref, + ) { + let output: std::option::Option = bevy::math::bounding::RayCast3d::sphere_intersection_at( + &_self, + &sphere, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "aabb_cast_3_d")] +impl bevy::math::bounding::AabbCast3d { + fn aabb_collision_at( + _self: Ref, + aabb: Val, + ) { + let output: std::option::Option = bevy::math::bounding::AabbCast3d::aabb_collision_at( + &_self, + aabb.into_inner(), + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn from_ray( + aabb: Val, + ray: Val, + max: f32, + ) { + let output: Val = bevy::math::bounding::AabbCast3d::from_ray( + aabb.into_inner(), + ray.into_inner(), + max, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "bounding_sphere_cast")] +impl bevy::math::bounding::BoundingSphereCast { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn from_ray( + sphere: Val, + ray: Val, + max: f32, + ) { + let output: Val = bevy::math::bounding::BoundingSphereCast::from_ray( + sphere.into_inner(), + ray.into_inner(), + max, + ) + .into(); + output + } + fn sphere_collision_at( + _self: Ref, + sphere: Val, + ) { + let output: std::option::Option = bevy::math::bounding::BoundingSphereCast::sphere_collision_at( + &_self, + sphere.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "interval")] +impl bevy::math::curve::interval::Interval { + fn clamp(_self: Val, value: f32) { + let output: f32 = bevy::math::curve::interval::Interval::clamp( + _self.into_inner(), + value, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn contains(_self: Val, item: f32) { + let output: bool = bevy::math::curve::interval::Interval::contains( + _self.into_inner(), + item, + ) + .into(); + output + } + fn contains_interval( + _self: Val, + other: Val, + ) { + let output: bool = bevy::math::curve::interval::Interval::contains_interval( + _self.into_inner(), + other.into_inner(), + ) + .into(); + output + } + fn end(_self: Val) { + let output: f32 = bevy::math::curve::interval::Interval::end(_self.into_inner()) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn has_finite_end(_self: Val) { + let output: bool = bevy::math::curve::interval::Interval::has_finite_end( + _self.into_inner(), + ) + .into(); + output + } + fn has_finite_start(_self: Val) { + let output: bool = bevy::math::curve::interval::Interval::has_finite_start( + _self.into_inner(), + ) + .into(); + output + } + fn is_bounded(_self: Val) { + let output: bool = bevy::math::curve::interval::Interval::is_bounded( + _self.into_inner(), + ) + .into(); + output + } + fn length(_self: Val) { + let output: f32 = bevy::math::curve::interval::Interval::length( + _self.into_inner(), + ) + .into(); + output + } + fn start(_self: Val) { + let output: f32 = bevy::math::curve::interval::Interval::start( + _self.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "float_ord")] +impl bevy::math::FloatOrd { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn ge(_self: Ref, other: Ref) { + let output: bool = >::ge(&_self, &other) + .into(); + output + } + fn gt(_self: Ref, other: Ref) { + let output: bool = >::gt(&_self, &other) + .into(); + output + } + fn le(_self: Ref, other: Ref) { + let output: bool = >::le(&_self, &other) + .into(); + output + } + fn lt(_self: Ref, other: Ref) { + let output: bool = >::lt(&_self, &other) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "plane_3_d")] +impl bevy::math::primitives::Plane3d { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn new( + normal: Val, + half_size: Val, + ) { + let output: Val = bevy::math::primitives::Plane3d::new( + normal.into_inner(), + half_size.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "tetrahedron")] +impl bevy::math::primitives::Tetrahedron { + fn centroid(_self: Ref) { + let output: Val = bevy::math::primitives::Tetrahedron::centroid( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn new( + a: Val, + b: Val, + c: Val, + d: Val, + ) { + let output: Val = bevy::math::primitives::Tetrahedron::new( + a.into_inner(), + b.into_inner(), + c.into_inner(), + d.into_inner(), + ) + .into(); + output + } + fn signed_volume(_self: Ref) { + let output: f32 = bevy::math::primitives::Tetrahedron::signed_volume(&_self) + .into(); + output + } +} +#[script_bindings(remote, name = "ease_function")] +impl bevy::math::curve::easing::EaseFunction { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} impl ::bevy::app::Plugin for BevyMathScriptingPlugin { fn build(&self, app: &mut ::bevy::prelude::App) { let mut world = app.world_mut(); - NamespaceBuilder::<::bevy::math::AspectRatio>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "inverse", - |_self: Ref| { - let output: Val = bevy::math::AspectRatio::inverse( - &_self, - ) - .into(); - output - }, - ) - .register( - "is_landscape", - |_self: Ref| { - let output: bool = bevy::math::AspectRatio::is_landscape(&_self) - .into(); - output - }, - ) - .register( - "is_portrait", - |_self: Ref| { - let output: bool = bevy::math::AspectRatio::is_portrait(&_self) - .into(); - output - }, - ) - .register( - "is_square", - |_self: Ref| { - let output: bool = bevy::math::AspectRatio::is_square(&_self).into(); - output - }, - ) - .register( - "ratio", - |_self: Ref| { - let output: f32 = bevy::math::AspectRatio::ratio(&_self).into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::CompassOctant>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::CompassQuadrant>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::Isometry2d>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "from_rotation", - |rotation: Val| { - let output: Val = bevy::math::Isometry2d::from_rotation( - rotation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_translation", - |translation: Val| { - let output: Val = bevy::math::Isometry2d::from_translation( - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_xy", - |x: f32, y: f32| { - let output: Val = bevy::math::Isometry2d::from_xy( - x, - y, - ) - .into(); - output - }, - ) - .register( - "inverse", - |_self: Ref| { - let output: Val = bevy::math::Isometry2d::inverse( - &_self, - ) - .into(); - output - }, - ) - .register( - "inverse_mul", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Isometry2d::inverse_mul( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "inverse_transform_point", - | - _self: Ref, - point: Val| - { - let output: Val = bevy::math::Isometry2d::inverse_transform_point( - &_self, - point.into_inner(), - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - | - _self: Val, - rhs: Val| - { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - | - _self: Val, - rhs: Val| - { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "new", - | - translation: Val, - rotation: Val| - { - let output: Val = bevy::math::Isometry2d::new( - translation.into_inner(), - rotation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transform_point", - | - _self: Ref, - point: Val| - { - let output: Val = bevy::math::Isometry2d::transform_point( - &_self, - point.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::Isometry3d>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "from_rotation", - |rotation: Val| { - let output: Val = bevy::math::Isometry3d::from_rotation( - rotation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_xyz", - |x: f32, y: f32, z: f32| { - let output: Val = bevy::math::Isometry3d::from_xyz( - x, - y, - z, - ) - .into(); - output - }, - ) - .register( - "inverse", - |_self: Ref| { - let output: Val = bevy::math::Isometry3d::inverse( - &_self, - ) - .into(); - output - }, - ) - .register( - "inverse_mul", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Isometry3d::inverse_mul( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - | - _self: Val, - rhs: Val| - { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - | - _self: Val, - rhs: Val| - { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::Ray2d>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "get_point", - |_self: Ref, distance: f32| { - let output: Val = bevy::math::Ray2d::get_point( - &_self, - distance, - ) - .into(); - output - }, - ) - .register( - "intersect_plane", - | - _self: Ref, - plane_origin: Val, - plane: Val| - { - let output: std::option::Option = bevy::math::Ray2d::intersect_plane( - &_self, - plane_origin.into_inner(), - plane.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - | - origin: Val, - direction: Val| - { - let output: Val = bevy::math::Ray2d::new( - origin.into_inner(), - direction.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::Ray3d>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "get_point", - |_self: Ref, distance: f32| { - let output: Val = bevy::math::Ray3d::get_point( - &_self, - distance, - ) - .into(); - output - }, - ) - .register( - "intersect_plane", - | - _self: Ref, - plane_origin: Val, - plane: Val| - { - let output: std::option::Option = bevy::math::Ray3d::intersect_plane( - &_self, - plane_origin.into_inner(), - plane.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - | - origin: Val, - direction: Val| - { - let output: Val = bevy::math::Ray3d::new( - origin.into_inner(), - direction.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::Rot2>::new(world) - .register( - "angle_between", - |_self: Val, other: Val| { - let output: f32 = bevy::math::Rot2::angle_between( - _self.into_inner(), - other.into_inner(), - ) - .into(); - output - }, - ) - .register( - "angle_to", - |_self: Val, other: Val| { - let output: f32 = bevy::math::Rot2::angle_to( - _self.into_inner(), - other.into_inner(), - ) - .into(); - output - }, - ) - .register( - "as_degrees", - |_self: Val| { - let output: f32 = bevy::math::Rot2::as_degrees(_self.into_inner()) - .into(); - output - }, - ) - .register( - "as_radians", - |_self: Val| { - let output: f32 = bevy::math::Rot2::as_radians(_self.into_inner()) - .into(); - output - }, - ) - .register( - "as_turn_fraction", - |_self: Val| { - let output: f32 = bevy::math::Rot2::as_turn_fraction( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "degrees", - |degrees: f32| { - let output: Val = bevy::math::Rot2::degrees( - degrees, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "fast_renormalize", - |_self: Val| { - let output: Val = bevy::math::Rot2::fast_renormalize( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_sin_cos", - |sin: f32, cos: f32| { - let output: Val = bevy::math::Rot2::from_sin_cos( - sin, - cos, - ) - .into(); - output - }, - ) - .register( - "inverse", - |_self: Val| { - let output: Val = bevy::math::Rot2::inverse( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_finite", - |_self: Val| { - let output: bool = bevy::math::Rot2::is_finite(_self.into_inner()) - .into(); - output - }, - ) - .register( - "is_nan", - |_self: Val| { - let output: bool = bevy::math::Rot2::is_nan(_self.into_inner()) - .into(); - output - }, - ) - .register( - "is_near_identity", - |_self: Val| { - let output: bool = bevy::math::Rot2::is_near_identity( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_normalized", - |_self: Val| { - let output: bool = bevy::math::Rot2::is_normalized( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "length", - |_self: Val| { - let output: f32 = bevy::math::Rot2::length(_self.into_inner()) - .into(); - output - }, - ) - .register( - "length_recip", - |_self: Val| { - let output: f32 = bevy::math::Rot2::length_recip(_self.into_inner()) - .into(); - output - }, - ) - .register( - "length_squared", - |_self: Val| { - let output: f32 = bevy::math::Rot2::length_squared( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - | - _self: Val, - direction: Val| - { - let output: Val = >::mul(_self.into_inner(), direction.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "nlerp", - |_self: Val, end: Val, s: f32| { - let output: Val = bevy::math::Rot2::nlerp( - _self.into_inner(), - end.into_inner(), - s, - ) - .into(); - output - }, - ) - .register( - "normalize", - |_self: Val| { - let output: Val = bevy::math::Rot2::normalize( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "radians", - |radians: f32| { - let output: Val = bevy::math::Rot2::radians( - radians, - ) - .into(); - output - }, - ) - .register( - "sin_cos", - |_self: Val| { - let output: (f32, f32) = bevy::math::Rot2::sin_cos( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "slerp", - |_self: Val, end: Val, s: f32| { - let output: Val = bevy::math::Rot2::slerp( - _self.into_inner(), - end.into_inner(), - s, - ) - .into(); - output - }, - ) - .register( - "turn_fraction", - |fraction: f32| { - let output: Val = bevy::math::Rot2::turn_fraction( - fraction, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::prelude::Dir2>::new(world) - .register( - "as_vec2", - |_self: Ref| { - let output: Val = bevy::math::prelude::Dir2::as_vec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "fast_renormalize", - |_self: Val| { - let output: Val = bevy::math::prelude::Dir2::fast_renormalize( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_xy_unchecked", - |x: f32, y: f32| { - let output: Val = bevy::math::prelude::Dir2::from_xy_unchecked( - x, - y, - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: f32| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new_unchecked", - |value: Val| { - let output: Val = bevy::math::prelude::Dir2::new_unchecked( - value.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rotation_from", - | - _self: Val, - other: Val| - { - let output: Val = bevy::math::prelude::Dir2::rotation_from( - _self.into_inner(), - other.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rotation_from_x", - |_self: Val| { - let output: Val = bevy::math::prelude::Dir2::rotation_from_x( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rotation_from_y", - |_self: Val| { - let output: Val = bevy::math::prelude::Dir2::rotation_from_y( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rotation_to", - | - _self: Val, - other: Val| - { - let output: Val = bevy::math::prelude::Dir2::rotation_to( - _self.into_inner(), - other.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rotation_to_x", - |_self: Val| { - let output: Val = bevy::math::prelude::Dir2::rotation_to_x( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rotation_to_y", - |_self: Val| { - let output: Val = bevy::math::prelude::Dir2::rotation_to_y( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "slerp", - | - _self: Val, - rhs: Val, - s: f32| - { - let output: Val = bevy::math::prelude::Dir2::slerp( - _self.into_inner(), - rhs.into_inner(), - s, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::prelude::Dir3>::new(world) - .register( - "as_vec3", - |_self: Ref| { - let output: Val = bevy::math::prelude::Dir3::as_vec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "fast_renormalize", - |_self: Val| { - let output: Val = bevy::math::prelude::Dir3::fast_renormalize( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_xyz_unchecked", - |x: f32, y: f32, z: f32| { - let output: Val = bevy::math::prelude::Dir3::from_xyz_unchecked( - x, - y, - z, - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: f32| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new_unchecked", - |value: Val| { - let output: Val = bevy::math::prelude::Dir3::new_unchecked( - value.into_inner(), - ) - .into(); - output - }, - ) - .register( - "slerp", - | - _self: Val, - rhs: Val, - s: f32| - { - let output: Val = bevy::math::prelude::Dir3::slerp( - _self.into_inner(), - rhs.into_inner(), - s, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::prelude::Dir3A>::new(world) - .register( - "as_vec3a", - |_self: Ref| { - let output: Val = bevy::math::prelude::Dir3A::as_vec3a( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "fast_renormalize", - |_self: Val| { - let output: Val = bevy::math::prelude::Dir3A::fast_renormalize( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_xyz_unchecked", - |x: f32, y: f32, z: f32| { - let output: Val = bevy::math::prelude::Dir3A::from_xyz_unchecked( - x, - y, - z, - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: f32| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new_unchecked", - |value: Val| { - let output: Val = bevy::math::prelude::Dir3A::new_unchecked( - value.into_inner(), - ) - .into(); - output - }, - ) - .register( - "slerp", - | - _self: Val, - rhs: Val, - s: f32| - { - let output: Val = bevy::math::prelude::Dir3A::slerp( - _self.into_inner(), - rhs.into_inner(), - s, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::prelude::IRect>::new(world) - .register( - "as_rect", - |_self: Ref| { - let output: Val = bevy::math::prelude::IRect::as_rect( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_urect", - |_self: Ref| { - let output: Val = bevy::math::prelude::IRect::as_urect( - &_self, - ) - .into(); - output - }, - ) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "center", - |_self: Ref| { - let output: Val = bevy::math::prelude::IRect::center( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "contains", - | - _self: Ref, - point: Val| - { - let output: bool = bevy::math::prelude::IRect::contains( - &_self, - point.into_inner(), - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "from_center_half_size", - | - origin: Val, - half_size: Val| - { - let output: Val = bevy::math::prelude::IRect::from_center_half_size( - origin.into_inner(), - half_size.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_center_size", - | - origin: Val, - size: Val| - { - let output: Val = bevy::math::prelude::IRect::from_center_size( - origin.into_inner(), - size.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_corners", - | - p0: Val, - p1: Val| - { - let output: Val = bevy::math::prelude::IRect::from_corners( - p0.into_inner(), - p1.into_inner(), - ) - .into(); - output - }, - ) - .register( - "half_size", - |_self: Ref| { - let output: Val = bevy::math::prelude::IRect::half_size( - &_self, - ) - .into(); - output - }, - ) - .register( - "height", - |_self: Ref| { - let output: i32 = bevy::math::prelude::IRect::height(&_self).into(); - output - }, - ) - .register( - "inflate", - |_self: Ref, expansion: i32| { - let output: Val = bevy::math::prelude::IRect::inflate( - &_self, - expansion, - ) - .into(); - output - }, - ) - .register( - "intersect", - | - _self: Ref, - other: Val| - { - let output: Val = bevy::math::prelude::IRect::intersect( - &_self, - other.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_empty", - |_self: Ref| { - let output: bool = bevy::math::prelude::IRect::is_empty(&_self) - .into(); - output - }, - ) - .register( - "new", - |x0: i32, y0: i32, x1: i32, y1: i32| { - let output: Val = bevy::math::prelude::IRect::new( - x0, - y0, - x1, - y1, - ) - .into(); - output - }, - ) - .register( - "size", - |_self: Ref| { - let output: Val = bevy::math::prelude::IRect::size( - &_self, - ) - .into(); - output - }, - ) - .register( - "union", - | - _self: Ref, - other: Val| - { - let output: Val = bevy::math::prelude::IRect::union( - &_self, - other.into_inner(), - ) - .into(); - output - }, - ) - .register( - "union_point", - | - _self: Ref, - other: Val| - { - let output: Val = bevy::math::prelude::IRect::union_point( - &_self, - other.into_inner(), - ) - .into(); - output - }, - ) - .register( - "width", - |_self: Ref| { - let output: i32 = bevy::math::prelude::IRect::width(&_self).into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::prelude::Rect>::new(world) - .register( - "as_irect", - |_self: Ref| { - let output: Val = bevy::math::prelude::Rect::as_irect( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_urect", - |_self: Ref| { - let output: Val = bevy::math::prelude::Rect::as_urect( - &_self, - ) - .into(); - output - }, - ) - .register( - "center", - |_self: Ref| { - let output: Val = bevy::math::prelude::Rect::center( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "contains", - | - _self: Ref, - point: Val| - { - let output: bool = bevy::math::prelude::Rect::contains( - &_self, - point.into_inner(), - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "from_center_half_size", - | - origin: Val, - half_size: Val| - { - let output: Val = bevy::math::prelude::Rect::from_center_half_size( - origin.into_inner(), - half_size.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_center_size", - | - origin: Val, - size: Val| - { - let output: Val = bevy::math::prelude::Rect::from_center_size( - origin.into_inner(), - size.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_corners", - |p0: Val, p1: Val| { - let output: Val = bevy::math::prelude::Rect::from_corners( - p0.into_inner(), - p1.into_inner(), - ) - .into(); - output - }, - ) - .register( - "half_size", - |_self: Ref| { - let output: Val = bevy::math::prelude::Rect::half_size( - &_self, - ) - .into(); - output - }, - ) - .register( - "height", - |_self: Ref| { - let output: f32 = bevy::math::prelude::Rect::height(&_self).into(); - output - }, - ) - .register( - "inflate", - |_self: Ref, expansion: f32| { - let output: Val = bevy::math::prelude::Rect::inflate( - &_self, - expansion, - ) - .into(); - output - }, - ) - .register( - "intersect", - | - _self: Ref, - other: Val| - { - let output: Val = bevy::math::prelude::Rect::intersect( - &_self, - other.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_empty", - |_self: Ref| { - let output: bool = bevy::math::prelude::Rect::is_empty(&_self) - .into(); - output - }, - ) - .register( - "new", - |x0: f32, y0: f32, x1: f32, y1: f32| { - let output: Val = bevy::math::prelude::Rect::new( - x0, - y0, - x1, - y1, - ) - .into(); - output - }, - ) - .register( - "normalize", - | - _self: Ref, - other: Val| - { - let output: Val = bevy::math::prelude::Rect::normalize( - &_self, - other.into_inner(), - ) - .into(); - output - }, - ) - .register( - "size", - |_self: Ref| { - let output: Val = bevy::math::prelude::Rect::size( - &_self, - ) - .into(); - output - }, - ) - .register( - "union", - | - _self: Ref, - other: Val| - { - let output: Val = bevy::math::prelude::Rect::union( - &_self, - other.into_inner(), - ) - .into(); - output - }, - ) - .register( - "union_point", - | - _self: Ref, - other: Val| - { - let output: Val = bevy::math::prelude::Rect::union_point( - &_self, - other.into_inner(), - ) - .into(); - output - }, - ) - .register( - "width", - |_self: Ref| { - let output: f32 = bevy::math::prelude::Rect::width(&_self).into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::prelude::URect>::new(world) - .register( - "as_irect", - |_self: Ref| { - let output: Val = bevy::math::prelude::URect::as_irect( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_rect", - |_self: Ref| { - let output: Val = bevy::math::prelude::URect::as_rect( - &_self, - ) - .into(); - output - }, - ) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "center", - |_self: Ref| { - let output: Val = bevy::math::prelude::URect::center( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "contains", - | - _self: Ref, - point: Val| - { - let output: bool = bevy::math::prelude::URect::contains( - &_self, - point.into_inner(), - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "from_center_half_size", - | - origin: Val, - half_size: Val| - { - let output: Val = bevy::math::prelude::URect::from_center_half_size( - origin.into_inner(), - half_size.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_center_size", - | - origin: Val, - size: Val| - { - let output: Val = bevy::math::prelude::URect::from_center_size( - origin.into_inner(), - size.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_corners", - | - p0: Val, - p1: Val| - { - let output: Val = bevy::math::prelude::URect::from_corners( - p0.into_inner(), - p1.into_inner(), - ) - .into(); - output - }, - ) - .register( - "half_size", - |_self: Ref| { - let output: Val = bevy::math::prelude::URect::half_size( - &_self, - ) - .into(); - output - }, - ) - .register( - "height", - |_self: Ref| { - let output: u32 = bevy::math::prelude::URect::height(&_self).into(); - output - }, - ) - .register( - "inflate", - |_self: Ref, expansion: i32| { - let output: Val = bevy::math::prelude::URect::inflate( - &_self, - expansion, - ) - .into(); - output - }, - ) - .register( - "intersect", - | - _self: Ref, - other: Val| - { - let output: Val = bevy::math::prelude::URect::intersect( - &_self, - other.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_empty", - |_self: Ref| { - let output: bool = bevy::math::prelude::URect::is_empty(&_self) - .into(); - output - }, - ) - .register( - "new", - |x0: u32, y0: u32, x1: u32, y1: u32| { - let output: Val = bevy::math::prelude::URect::new( - x0, - y0, - x1, - y1, - ) - .into(); - output - }, - ) - .register( - "size", - |_self: Ref| { - let output: Val = bevy::math::prelude::URect::size( - &_self, - ) - .into(); - output - }, - ) - .register( - "union", - | - _self: Ref, - other: Val| - { - let output: Val = bevy::math::prelude::URect::union( - &_self, - other.into_inner(), - ) - .into(); - output - }, - ) - .register( - "union_point", - | - _self: Ref, - other: Val| - { - let output: Val = bevy::math::prelude::URect::union_point( - &_self, - other.into_inner(), - ) - .into(); - output - }, - ) - .register( - "width", - |_self: Ref| { - let output: u32 = bevy::math::prelude::URect::width(&_self).into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::Affine3>::new(world); - NamespaceBuilder::<::bevy::math::bounding::Aabb2d>::new(world) - .register( - "bounding_circle", - |_self: Ref| { - let output: Val = bevy::math::bounding::Aabb2d::bounding_circle( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "closest_point", - | - _self: Ref, - point: Val| - { - let output: Val = bevy::math::bounding::Aabb2d::closest_point( - &_self, - point.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - | - center: Val, - half_size: Val| - { - let output: Val = bevy::math::bounding::Aabb2d::new( - center.into_inner(), - half_size.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::bounding::BoundingCircle>::new(world) - .register( - "aabb_2d", - |_self: Ref| { - let output: Val = bevy::math::bounding::BoundingCircle::aabb_2d( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "closest_point", - | - _self: Ref, - point: Val| - { - let output: Val = bevy::math::bounding::BoundingCircle::closest_point( - &_self, - point.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |center: Val, radius: f32| { - let output: Val = bevy::math::bounding::BoundingCircle::new( - center.into_inner(), - radius, - ) - .into(); - output - }, - ) - .register( - "radius", - |_self: Ref| { - let output: f32 = bevy::math::bounding::BoundingCircle::radius( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::Circle>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "closest_point", - | - _self: Ref, - point: Val| - { - let output: Val = bevy::math::primitives::Circle::closest_point( - &_self, - point.into_inner(), - ) - .into(); - output - }, - ) - .register( - "diameter", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Circle::diameter(&_self) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "new", - |radius: f32| { - let output: Val = bevy::math::primitives::Circle::new( - radius, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::Annulus>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "closest_point", - | - _self: Ref, - point: Val| - { - let output: Val = bevy::math::primitives::Annulus::closest_point( - &_self, - point.into_inner(), - ) - .into(); - output - }, - ) - .register( - "diameter", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Annulus::diameter(&_self) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "new", - |inner_radius: f32, outer_radius: f32| { - let output: Val = bevy::math::primitives::Annulus::new( - inner_radius, - outer_radius, - ) - .into(); - output - }, - ) - .register( - "thickness", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Annulus::thickness(&_self) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::Arc2d>::new(world) - .register( - "angle", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Arc2d::angle(&_self) - .into(); - output - }, - ) - .register( - "apothem", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Arc2d::apothem(&_self) - .into(); - output - }, - ) - .register( - "chord_length", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Arc2d::chord_length(&_self) - .into(); - output - }, - ) - .register( - "chord_midpoint", - |_self: Ref| { - let output: Val = bevy::math::primitives::Arc2d::chord_midpoint( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "from_degrees", - |radius: f32, angle: f32| { - let output: Val = bevy::math::primitives::Arc2d::from_degrees( - radius, - angle, - ) - .into(); - output - }, - ) - .register( - "from_radians", - |radius: f32, angle: f32| { - let output: Val = bevy::math::primitives::Arc2d::from_radians( - radius, - angle, - ) - .into(); - output - }, - ) - .register( - "from_turns", - |radius: f32, fraction: f32| { - let output: Val = bevy::math::primitives::Arc2d::from_turns( - radius, - fraction, - ) - .into(); - output - }, - ) - .register( - "half_chord_length", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Arc2d::half_chord_length( - &_self, - ) - .into(); - output - }, - ) - .register( - "is_major", - |_self: Ref| { - let output: bool = bevy::math::primitives::Arc2d::is_major(&_self) - .into(); - output - }, - ) - .register( - "is_minor", - |_self: Ref| { - let output: bool = bevy::math::primitives::Arc2d::is_minor(&_self) - .into(); - output - }, - ) - .register( - "left_endpoint", - |_self: Ref| { - let output: Val = bevy::math::primitives::Arc2d::left_endpoint( - &_self, - ) - .into(); - output - }, - ) - .register( - "length", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Arc2d::length(&_self) - .into(); - output - }, - ) - .register( - "midpoint", - |_self: Ref| { - let output: Val = bevy::math::primitives::Arc2d::midpoint( - &_self, - ) - .into(); - output - }, - ) - .register( - "new", - |radius: f32, half_angle: f32| { - let output: Val = bevy::math::primitives::Arc2d::new( - radius, - half_angle, - ) - .into(); - output - }, - ) - .register( - "right_endpoint", - |_self: Ref| { - let output: Val = bevy::math::primitives::Arc2d::right_endpoint( - &_self, - ) - .into(); - output - }, - ) - .register( - "sagitta", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Arc2d::sagitta(&_self) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::Capsule2d>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "new", - |radius: f32, length: f32| { - let output: Val = bevy::math::primitives::Capsule2d::new( - radius, - length, - ) - .into(); - output - }, - ) - .register( - "to_inner_rectangle", - |_self: Ref| { - let output: Val = bevy::math::primitives::Capsule2d::to_inner_rectangle( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::CircularSector>::new(world) - .register( - "angle", - |_self: Ref| { - let output: f32 = bevy::math::primitives::CircularSector::angle( - &_self, - ) - .into(); - output - }, - ) - .register( - "apothem", - |_self: Ref| { - let output: f32 = bevy::math::primitives::CircularSector::apothem( - &_self, - ) - .into(); - output - }, - ) - .register( - "arc_length", - |_self: Ref| { - let output: f32 = bevy::math::primitives::CircularSector::arc_length( - &_self, - ) - .into(); - output - }, - ) - .register( - "chord_length", - |_self: Ref| { - let output: f32 = bevy::math::primitives::CircularSector::chord_length( - &_self, - ) - .into(); - output - }, - ) - .register( - "chord_midpoint", - |_self: Ref| { - let output: Val = bevy::math::primitives::CircularSector::chord_midpoint( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "from_degrees", - |radius: f32, angle: f32| { - let output: Val = bevy::math::primitives::CircularSector::from_degrees( - radius, - angle, - ) - .into(); - output - }, - ) - .register( - "from_radians", - |radius: f32, angle: f32| { - let output: Val = bevy::math::primitives::CircularSector::from_radians( - radius, - angle, - ) - .into(); - output - }, - ) - .register( - "from_turns", - |radius: f32, fraction: f32| { - let output: Val = bevy::math::primitives::CircularSector::from_turns( - radius, - fraction, - ) - .into(); - output - }, - ) - .register( - "half_angle", - |_self: Ref| { - let output: f32 = bevy::math::primitives::CircularSector::half_angle( - &_self, - ) - .into(); - output - }, - ) - .register( - "half_chord_length", - |_self: Ref| { - let output: f32 = bevy::math::primitives::CircularSector::half_chord_length( - &_self, - ) - .into(); - output - }, - ) - .register( - "new", - |radius: f32, angle: f32| { - let output: Val = bevy::math::primitives::CircularSector::new( - radius, - angle, - ) - .into(); - output - }, - ) - .register( - "radius", - |_self: Ref| { - let output: f32 = bevy::math::primitives::CircularSector::radius( - &_self, - ) - .into(); - output - }, - ) - .register( - "sagitta", - |_self: Ref| { - let output: f32 = bevy::math::primitives::CircularSector::sagitta( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::CircularSegment>::new(world) - .register( - "angle", - |_self: Ref| { - let output: f32 = bevy::math::primitives::CircularSegment::angle( - &_self, - ) - .into(); - output - }, - ) - .register( - "apothem", - |_self: Ref| { - let output: f32 = bevy::math::primitives::CircularSegment::apothem( - &_self, - ) - .into(); - output - }, - ) - .register( - "arc_length", - |_self: Ref| { - let output: f32 = bevy::math::primitives::CircularSegment::arc_length( - &_self, - ) - .into(); - output - }, - ) - .register( - "chord_length", - |_self: Ref| { - let output: f32 = bevy::math::primitives::CircularSegment::chord_length( - &_self, - ) - .into(); - output - }, - ) - .register( - "chord_midpoint", - |_self: Ref| { - let output: Val = bevy::math::primitives::CircularSegment::chord_midpoint( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "from_degrees", - |radius: f32, angle: f32| { - let output: Val = bevy::math::primitives::CircularSegment::from_degrees( - radius, - angle, - ) - .into(); - output - }, - ) - .register( - "from_radians", - |radius: f32, angle: f32| { - let output: Val = bevy::math::primitives::CircularSegment::from_radians( - radius, - angle, - ) - .into(); - output - }, - ) - .register( - "from_turns", - |radius: f32, fraction: f32| { - let output: Val = bevy::math::primitives::CircularSegment::from_turns( - radius, - fraction, - ) - .into(); - output - }, - ) - .register( - "half_angle", - |_self: Ref| { - let output: f32 = bevy::math::primitives::CircularSegment::half_angle( - &_self, - ) - .into(); - output - }, - ) - .register( - "half_chord_length", - |_self: Ref| { - let output: f32 = bevy::math::primitives::CircularSegment::half_chord_length( - &_self, - ) - .into(); - output - }, - ) - .register( - "new", - |radius: f32, angle: f32| { - let output: Val = bevy::math::primitives::CircularSegment::new( - radius, - angle, - ) - .into(); - output - }, - ) - .register( - "radius", - |_self: Ref| { - let output: f32 = bevy::math::primitives::CircularSegment::radius( - &_self, - ) - .into(); - output - }, - ) - .register( - "sagitta", - |_self: Ref| { - let output: f32 = bevy::math::primitives::CircularSegment::sagitta( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::Ellipse>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eccentricity", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Ellipse::eccentricity( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "focal_length", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Ellipse::focal_length( - &_self, - ) - .into(); - output - }, - ) - .register( - "from_size", - |size: Val| { - let output: Val = bevy::math::primitives::Ellipse::from_size( - size.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |half_width: f32, half_height: f32| { - let output: Val = bevy::math::primitives::Ellipse::new( - half_width, - half_height, - ) - .into(); - output - }, - ) - .register( - "semi_major", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Ellipse::semi_major(&_self) - .into(); - output - }, - ) - .register( - "semi_minor", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Ellipse::semi_minor(&_self) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::Line2d>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::Plane2d>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "new", - |normal: Val| { - let output: Val = bevy::math::primitives::Plane2d::new( - normal.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::Rectangle>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "closest_point", - | - _self: Ref, - point: Val| - { - let output: Val = bevy::math::primitives::Rectangle::closest_point( - &_self, - point.into_inner(), - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "from_corners", - | - point1: Val, - point2: Val| - { - let output: Val = bevy::math::primitives::Rectangle::from_corners( - point1.into_inner(), - point2.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_length", - |length: f32| { - let output: Val = bevy::math::primitives::Rectangle::from_length( - length, - ) - .into(); - output - }, - ) - .register( - "from_size", - |size: Val| { - let output: Val = bevy::math::primitives::Rectangle::from_size( - size.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |width: f32, height: f32| { - let output: Val = bevy::math::primitives::Rectangle::new( - width, - height, - ) - .into(); - output - }, - ) - .register( - "size", - |_self: Ref| { - let output: Val = bevy::math::primitives::Rectangle::size( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::RegularPolygon>::new(world) - .register( - "circumradius", - |_self: Ref| { - let output: f32 = bevy::math::primitives::RegularPolygon::circumradius( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "external_angle_degrees", - |_self: Ref| { - let output: f32 = bevy::math::primitives::RegularPolygon::external_angle_degrees( - &_self, - ) - .into(); - output - }, - ) - .register( - "external_angle_radians", - |_self: Ref| { - let output: f32 = bevy::math::primitives::RegularPolygon::external_angle_radians( - &_self, - ) - .into(); - output - }, - ) - .register( - "inradius", - |_self: Ref| { - let output: f32 = bevy::math::primitives::RegularPolygon::inradius( - &_self, - ) - .into(); - output - }, - ) - .register( - "internal_angle_degrees", - |_self: Ref| { - let output: f32 = bevy::math::primitives::RegularPolygon::internal_angle_degrees( - &_self, - ) - .into(); - output - }, - ) - .register( - "internal_angle_radians", - |_self: Ref| { - let output: f32 = bevy::math::primitives::RegularPolygon::internal_angle_radians( - &_self, - ) - .into(); - output - }, - ) - .register( - "new", - |circumradius: f32, sides: u32| { - let output: Val = bevy::math::primitives::RegularPolygon::new( - circumradius, - sides, - ) - .into(); - output - }, - ) - .register( - "side_length", - |_self: Ref| { - let output: f32 = bevy::math::primitives::RegularPolygon::side_length( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::Rhombus>::new(world) - .register( - "circumradius", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Rhombus::circumradius( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "closest_point", - | - _self: Ref, - point: Val| - { - let output: Val = bevy::math::primitives::Rhombus::closest_point( - &_self, - point.into_inner(), - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "from_inradius", - |inradius: f32| { - let output: Val = bevy::math::primitives::Rhombus::from_inradius( - inradius, - ) - .into(); - output - }, - ) - .register( - "from_side", - |side: f32| { - let output: Val = bevy::math::primitives::Rhombus::from_side( - side, - ) - .into(); - output - }, - ) - .register( - "inradius", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Rhombus::inradius(&_self) - .into(); - output - }, - ) - .register( - "new", - |horizontal_diagonal: f32, vertical_diagonal: f32| { - let output: Val = bevy::math::primitives::Rhombus::new( - horizontal_diagonal, - vertical_diagonal, - ) - .into(); - output - }, - ) - .register( - "side", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Rhombus::side(&_self) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::Segment2d>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "new", - |direction: Val, length: f32| { - let output: Val = bevy::math::primitives::Segment2d::new( - direction.into_inner(), - length, - ) - .into(); - output - }, - ) - .register( - "point1", - |_self: Ref| { - let output: Val = bevy::math::primitives::Segment2d::point1( - &_self, - ) - .into(); - output - }, - ) - .register( - "point2", - |_self: Ref| { - let output: Val = bevy::math::primitives::Segment2d::point2( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::Triangle2d>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "is_acute", - |_self: Ref| { - let output: bool = bevy::math::primitives::Triangle2d::is_acute( - &_self, - ) - .into(); - output - }, - ) - .register( - "is_degenerate", - |_self: Ref| { - let output: bool = bevy::math::primitives::Triangle2d::is_degenerate( - &_self, - ) - .into(); - output - }, - ) - .register( - "is_obtuse", - |_self: Ref| { - let output: bool = bevy::math::primitives::Triangle2d::is_obtuse( - &_self, - ) - .into(); - output - }, - ) - .register( - "new", - | - a: Val, - b: Val, - c: Val| - { - let output: Val = bevy::math::primitives::Triangle2d::new( - a.into_inner(), - b.into_inner(), - c.into_inner(), - ) - .into(); - output - }, - ) - .register( - "reverse", - |mut _self: Mut| { - let output: () = bevy::math::primitives::Triangle2d::reverse( - &mut _self, - ) - .into(); - output - }, - ) - .register( - "reversed", - |_self: Val| { - let output: Val = bevy::math::primitives::Triangle2d::reversed( - _self.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::bounding::Aabb3d>::new(world) - .register( - "bounding_sphere", - |_self: Ref| { - let output: Val = bevy::math::bounding::Aabb3d::bounding_sphere( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::bounding::BoundingSphere>::new(world) - .register( - "aabb_3d", - |_self: Ref| { - let output: Val = bevy::math::bounding::BoundingSphere::aabb_3d( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "radius", - |_self: Ref| { - let output: f32 = bevy::math::bounding::BoundingSphere::radius( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::Sphere>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "closest_point", - | - _self: Ref, - point: Val| - { - let output: Val = bevy::math::primitives::Sphere::closest_point( - &_self, - point.into_inner(), - ) - .into(); - output - }, - ) - .register( - "diameter", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Sphere::diameter(&_self) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "new", - |radius: f32| { - let output: Val = bevy::math::primitives::Sphere::new( - radius, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::Cuboid>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "closest_point", - | - _self: Ref, - point: Val| - { - let output: Val = bevy::math::primitives::Cuboid::closest_point( - &_self, - point.into_inner(), - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "from_corners", - | - point1: Val, - point2: Val| - { - let output: Val = bevy::math::primitives::Cuboid::from_corners( - point1.into_inner(), - point2.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_length", - |length: f32| { - let output: Val = bevy::math::primitives::Cuboid::from_length( - length, - ) - .into(); - output - }, - ) - .register( - "from_size", - |size: Val| { - let output: Val = bevy::math::primitives::Cuboid::from_size( - size.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |x_length: f32, y_length: f32, z_length: f32| { - let output: Val = bevy::math::primitives::Cuboid::new( - x_length, - y_length, - z_length, - ) - .into(); - output - }, - ) - .register( - "size", - |_self: Ref| { - let output: Val = bevy::math::primitives::Cuboid::size( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::Cylinder>::new(world) - .register( - "base", - |_self: Ref| { - let output: Val = bevy::math::primitives::Cylinder::base( - &_self, - ) - .into(); - output - }, - ) - .register( - "base_area", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Cylinder::base_area(&_self) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "lateral_area", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Cylinder::lateral_area( - &_self, - ) - .into(); - output - }, - ) - .register( - "new", - |radius: f32, height: f32| { - let output: Val = bevy::math::primitives::Cylinder::new( - radius, - height, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::Capsule3d>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "new", - |radius: f32, length: f32| { - let output: Val = bevy::math::primitives::Capsule3d::new( - radius, - length, - ) - .into(); - output - }, - ) - .register( - "to_cylinder", - |_self: Ref| { - let output: Val = bevy::math::primitives::Capsule3d::to_cylinder( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::Cone>::new(world) - .register( - "base", - |_self: Ref| { - let output: Val = bevy::math::primitives::Cone::base( - &_self, - ) - .into(); - output - }, - ) - .register( - "base_area", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Cone::base_area(&_self) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "lateral_area", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Cone::lateral_area(&_self) - .into(); - output - }, - ) - .register( - "new", - |radius: f32, height: f32| { - let output: Val = bevy::math::primitives::Cone::new( - radius, - height, - ) - .into(); - output - }, - ) - .register( - "slant_height", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Cone::slant_height(&_self) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::ConicalFrustum>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::InfinitePlane3d>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "isometry_from_xy", - | - _self: Ref, - origin: Val| - { - let output: Val = bevy::math::primitives::InfinitePlane3d::isometry_from_xy( - &_self, - origin.into_inner(), - ) - .into(); - output - }, - ) - .register( - "isometry_into_xy", - | - _self: Ref, - origin: Val| - { - let output: Val = bevy::math::primitives::InfinitePlane3d::isometry_into_xy( - &_self, - origin.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::Line3d>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::Segment3d>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "new", - |direction: Val, length: f32| { - let output: Val = bevy::math::primitives::Segment3d::new( - direction.into_inner(), - length, - ) - .into(); - output - }, - ) - .register( - "point1", - |_self: Ref| { - let output: Val = bevy::math::primitives::Segment3d::point1( - &_self, - ) - .into(); - output - }, - ) - .register( - "point2", - |_self: Ref| { - let output: Val = bevy::math::primitives::Segment3d::point2( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::Torus>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "inner_radius", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Torus::inner_radius(&_self) - .into(); - output - }, - ) - .register( - "new", - |inner_radius: f32, outer_radius: f32| { - let output: Val = bevy::math::primitives::Torus::new( - inner_radius, - outer_radius, - ) - .into(); - output - }, - ) - .register( - "outer_radius", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Torus::outer_radius(&_self) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::Triangle3d>::new(world) - .register( - "centroid", - |_self: Ref| { - let output: Val = bevy::math::primitives::Triangle3d::centroid( - &_self, - ) - .into(); - output - }, - ) - .register( - "circumcenter", - |_self: Ref| { - let output: Val = bevy::math::primitives::Triangle3d::circumcenter( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "is_acute", - |_self: Ref| { - let output: bool = bevy::math::primitives::Triangle3d::is_acute( - &_self, - ) - .into(); - output - }, - ) - .register( - "is_degenerate", - |_self: Ref| { - let output: bool = bevy::math::primitives::Triangle3d::is_degenerate( - &_self, - ) - .into(); - output - }, - ) - .register( - "is_obtuse", - |_self: Ref| { - let output: bool = bevy::math::primitives::Triangle3d::is_obtuse( - &_self, - ) - .into(); - output - }, - ) - .register( - "new", - | - a: Val, - b: Val, - c: Val| - { - let output: Val = bevy::math::primitives::Triangle3d::new( - a.into_inner(), - b.into_inner(), - c.into_inner(), - ) - .into(); - output - }, - ) - .register( - "reverse", - |mut _self: Mut| { - let output: () = bevy::math::primitives::Triangle3d::reverse( - &mut _self, - ) - .into(); - output - }, - ) - .register( - "reversed", - |_self: Val| { - let output: Val = bevy::math::primitives::Triangle3d::reversed( - _self.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::bounding::RayCast2d>::new(world) - .register( - "aabb_intersection_at", - | - _self: Ref, - aabb: Ref| - { - let output: std::option::Option = bevy::math::bounding::RayCast2d::aabb_intersection_at( - &_self, - &aabb, - ) - .into(); - output - }, - ) - .register( - "circle_intersection_at", - | - _self: Ref, - circle: Ref| - { - let output: std::option::Option = bevy::math::bounding::RayCast2d::circle_intersection_at( - &_self, - &circle, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "direction_recip", - |_self: Ref| { - let output: Val = bevy::math::bounding::RayCast2d::direction_recip( - &_self, - ) - .into(); - output - }, - ) - .register( - "from_ray", - |ray: Val, max: f32| { - let output: Val = bevy::math::bounding::RayCast2d::from_ray( - ray.into_inner(), - max, - ) - .into(); - output - }, - ) - .register( - "new", - | - origin: Val, - direction: Val, - max: f32| - { - let output: Val = bevy::math::bounding::RayCast2d::new( - origin.into_inner(), - direction.into_inner(), - max, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::bounding::AabbCast2d>::new(world) - .register( - "aabb_collision_at", - | - _self: Ref, - aabb: Val| - { - let output: std::option::Option = bevy::math::bounding::AabbCast2d::aabb_collision_at( - &_self, - aabb.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "from_ray", - | - aabb: Val, - ray: Val, - max: f32| - { - let output: Val = bevy::math::bounding::AabbCast2d::from_ray( - aabb.into_inner(), - ray.into_inner(), - max, - ) - .into(); - output - }, - ) - .register( - "new", - | - aabb: Val, - origin: Val, - direction: Val, - max: f32| - { - let output: Val = bevy::math::bounding::AabbCast2d::new( - aabb.into_inner(), - origin.into_inner(), - direction.into_inner(), - max, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::bounding::BoundingCircleCast>::new(world) - .register( - "circle_collision_at", - | - _self: Ref, - circle: Val| - { - let output: std::option::Option = bevy::math::bounding::BoundingCircleCast::circle_collision_at( - &_self, - circle.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "from_ray", - | - circle: Val, - ray: Val, - max: f32| - { - let output: Val = bevy::math::bounding::BoundingCircleCast::from_ray( - circle.into_inner(), - ray.into_inner(), - max, - ) - .into(); - output - }, - ) - .register( - "new", - | - circle: Val, - origin: Val, - direction: Val, - max: f32| - { - let output: Val = bevy::math::bounding::BoundingCircleCast::new( - circle.into_inner(), - origin.into_inner(), - direction.into_inner(), - max, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::bounding::RayCast3d>::new(world) - .register( - "aabb_intersection_at", - | - _self: Ref, - aabb: Ref| - { - let output: std::option::Option = bevy::math::bounding::RayCast3d::aabb_intersection_at( - &_self, - &aabb, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "direction_recip", - |_self: Ref| { - let output: Val = bevy::math::bounding::RayCast3d::direction_recip( - &_self, - ) - .into(); - output - }, - ) - .register( - "from_ray", - |ray: Val, max: f32| { - let output: Val = bevy::math::bounding::RayCast3d::from_ray( - ray.into_inner(), - max, - ) - .into(); - output - }, - ) - .register( - "sphere_intersection_at", - | - _self: Ref, - sphere: Ref| - { - let output: std::option::Option = bevy::math::bounding::RayCast3d::sphere_intersection_at( - &_self, - &sphere, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::bounding::AabbCast3d>::new(world) - .register( - "aabb_collision_at", - | - _self: Ref, - aabb: Val| - { - let output: std::option::Option = bevy::math::bounding::AabbCast3d::aabb_collision_at( - &_self, - aabb.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "from_ray", - | - aabb: Val, - ray: Val, - max: f32| - { - let output: Val = bevy::math::bounding::AabbCast3d::from_ray( - aabb.into_inner(), - ray.into_inner(), - max, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::bounding::BoundingSphereCast>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "from_ray", - | - sphere: Val, - ray: Val, - max: f32| - { - let output: Val = bevy::math::bounding::BoundingSphereCast::from_ray( - sphere.into_inner(), - ray.into_inner(), - max, - ) - .into(); - output - }, - ) - .register( - "sphere_collision_at", - | - _self: Ref, - sphere: Val| - { - let output: std::option::Option = bevy::math::bounding::BoundingSphereCast::sphere_collision_at( - &_self, - sphere.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::curve::interval::Interval>::new(world) - .register( - "clamp", - |_self: Val, value: f32| { - let output: f32 = bevy::math::curve::interval::Interval::clamp( - _self.into_inner(), - value, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "contains", - |_self: Val, item: f32| { - let output: bool = bevy::math::curve::interval::Interval::contains( - _self.into_inner(), - item, - ) - .into(); - output - }, - ) - .register( - "contains_interval", - | - _self: Val, - other: Val| - { - let output: bool = bevy::math::curve::interval::Interval::contains_interval( - _self.into_inner(), - other.into_inner(), - ) - .into(); - output - }, - ) - .register( - "end", - |_self: Val| { - let output: f32 = bevy::math::curve::interval::Interval::end( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "has_finite_end", - |_self: Val| { - let output: bool = bevy::math::curve::interval::Interval::has_finite_end( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "has_finite_start", - |_self: Val| { - let output: bool = bevy::math::curve::interval::Interval::has_finite_start( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_bounded", - |_self: Val| { - let output: bool = bevy::math::curve::interval::Interval::is_bounded( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "length", - |_self: Val| { - let output: f32 = bevy::math::curve::interval::Interval::length( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "start", - |_self: Val| { - let output: f32 = bevy::math::curve::interval::Interval::start( - _self.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::FloatOrd>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "ge", - |_self: Ref, other: Ref| { - let output: bool = >::ge(&_self, &other) - .into(); - output - }, - ) - .register( - "gt", - |_self: Ref, other: Ref| { - let output: bool = >::gt(&_self, &other) - .into(); - output - }, - ) - .register( - "le", - |_self: Ref, other: Ref| { - let output: bool = >::le(&_self, &other) - .into(); - output - }, - ) - .register( - "lt", - |_self: Ref, other: Ref| { - let output: bool = >::lt(&_self, &other) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::Plane3d>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "new", - | - normal: Val, - half_size: Val| - { - let output: Val = bevy::math::primitives::Plane3d::new( - normal.into_inner(), - half_size.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::primitives::Tetrahedron>::new(world) - .register( - "centroid", - |_self: Ref| { - let output: Val = bevy::math::primitives::Tetrahedron::centroid( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "new", - | - a: Val, - b: Val, - c: Val, - d: Val| - { - let output: Val = bevy::math::primitives::Tetrahedron::new( - a.into_inner(), - b.into_inner(), - c.into_inner(), - d.into_inner(), - ) - .into(); - output - }, - ) - .register( - "signed_volume", - |_self: Ref| { - let output: f32 = bevy::math::primitives::Tetrahedron::signed_volume( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::curve::easing::EaseFunction>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); + register_aspect_ratio(&mut world); + register_compass_octant(&mut world); + register_compass_quadrant(&mut world); + register_isometry_2_d(&mut world); + register_isometry_3_d(&mut world); + register_ray_2_d(&mut world); + register_ray_3_d(&mut world); + register_rot_2(&mut world); + register_dir_2(&mut world); + register_dir_3(&mut world); + register_dir_3_a(&mut world); + register_i_rect(&mut world); + register_rect(&mut world); + register_u_rect(&mut world); + register_affine_3(&mut world); + register_aabb_2_d(&mut world); + register_bounding_circle(&mut world); + register_circle(&mut world); + register_annulus(&mut world); + register_arc_2_d(&mut world); + register_capsule_2_d(&mut world); + register_circular_sector(&mut world); + register_circular_segment(&mut world); + register_ellipse(&mut world); + register_line_2_d(&mut world); + register_plane_2_d(&mut world); + register_rectangle(&mut world); + register_regular_polygon(&mut world); + register_rhombus(&mut world); + register_segment_2_d(&mut world); + register_triangle_2_d(&mut world); + register_aabb_3_d(&mut world); + register_bounding_sphere(&mut world); + register_sphere(&mut world); + register_cuboid(&mut world); + register_cylinder(&mut world); + register_capsule_3_d(&mut world); + register_cone(&mut world); + register_conical_frustum(&mut world); + register_infinite_plane_3_d(&mut world); + register_line_3_d(&mut world); + register_segment_3_d(&mut world); + register_torus(&mut world); + register_triangle_3_d(&mut world); + register_ray_cast_2_d(&mut world); + register_aabb_cast_2_d(&mut world); + register_bounding_circle_cast(&mut world); + register_ray_cast_3_d(&mut world); + register_aabb_cast_3_d(&mut world); + register_bounding_sphere_cast(&mut world); + register_interval(&mut world); + register_float_ord(&mut world); + register_plane_3_d(&mut world); + register_tetrahedron(&mut world); + register_ease_function(&mut world); } } diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_reflect.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_reflect.rs index bd06a19b80..6d72171c8d 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_reflect.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_reflect.rs @@ -9,22060 +9,14795 @@ use bevy_mod_scripting_core::bindings::{ namespace::NamespaceBuilder, }, }; +use bevy_mod_scripting_derive::script_bindings; use crate::*; pub struct BevyReflectScriptingPlugin; +#[script_bindings(remote, name = "atomic_bool")] +impl std::sync::atomic::AtomicBool { + fn into_inner(_self: Val) { + let output: bool = std::sync::atomic::AtomicBool::into_inner(_self.into_inner()) + .into(); + output + } + fn new(v: bool) { + let output: Val = std::sync::atomic::AtomicBool::new( + v, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "atomic_i_16")] +impl std::sync::atomic::AtomicI16 { + fn into_inner(_self: Val) { + let output: i16 = std::sync::atomic::AtomicI16::into_inner(_self.into_inner()) + .into(); + output + } + fn new(v: i16) { + let output: Val = std::sync::atomic::AtomicI16::new( + v, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "atomic_i_32")] +impl std::sync::atomic::AtomicI32 { + fn into_inner(_self: Val) { + let output: i32 = std::sync::atomic::AtomicI32::into_inner(_self.into_inner()) + .into(); + output + } + fn new(v: i32) { + let output: Val = std::sync::atomic::AtomicI32::new( + v, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "atomic_i_64")] +impl std::sync::atomic::AtomicI64 { + fn into_inner(_self: Val) { + let output: i64 = std::sync::atomic::AtomicI64::into_inner(_self.into_inner()) + .into(); + output + } + fn new(v: i64) { + let output: Val = std::sync::atomic::AtomicI64::new( + v, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "atomic_i_8")] +impl std::sync::atomic::AtomicI8 { + fn into_inner(_self: Val) { + let output: i8 = std::sync::atomic::AtomicI8::into_inner(_self.into_inner()) + .into(); + output + } + fn new(v: i8) { + let output: Val = std::sync::atomic::AtomicI8::new( + v, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "atomic_isize")] +impl std::sync::atomic::AtomicIsize { + fn into_inner(_self: Val) { + let output: isize = std::sync::atomic::AtomicIsize::into_inner( + _self.into_inner(), + ) + .into(); + output + } + fn new(v: isize) { + let output: Val = std::sync::atomic::AtomicIsize::new( + v, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "atomic_u_16")] +impl std::sync::atomic::AtomicU16 { + fn into_inner(_self: Val) { + let output: u16 = std::sync::atomic::AtomicU16::into_inner(_self.into_inner()) + .into(); + output + } + fn new(v: u16) { + let output: Val = std::sync::atomic::AtomicU16::new( + v, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "atomic_u_32")] +impl std::sync::atomic::AtomicU32 { + fn into_inner(_self: Val) { + let output: u32 = std::sync::atomic::AtomicU32::into_inner(_self.into_inner()) + .into(); + output + } + fn new(v: u32) { + let output: Val = std::sync::atomic::AtomicU32::new( + v, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "atomic_u_64")] +impl std::sync::atomic::AtomicU64 { + fn into_inner(_self: Val) { + let output: u64 = std::sync::atomic::AtomicU64::into_inner(_self.into_inner()) + .into(); + output + } + fn new(v: u64) { + let output: Val = std::sync::atomic::AtomicU64::new( + v, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "atomic_u_8")] +impl std::sync::atomic::AtomicU8 { + fn into_inner(_self: Val) { + let output: u8 = std::sync::atomic::AtomicU8::into_inner(_self.into_inner()) + .into(); + output + } + fn new(v: u8) { + let output: Val = std::sync::atomic::AtomicU8::new( + v, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "atomic_usize")] +impl std::sync::atomic::AtomicUsize { + fn into_inner(_self: Val) { + let output: usize = std::sync::atomic::AtomicUsize::into_inner( + _self.into_inner(), + ) + .into(); + output + } + fn new(v: usize) { + let output: Val = std::sync::atomic::AtomicUsize::new( + v, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "duration")] +impl bevy::utils::Duration { + fn abs_diff(_self: Val, other: Val) { + let output: Val = bevy::utils::Duration::abs_diff( + _self.into_inner(), + other.into_inner(), + ) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn as_micros(_self: Ref) { + let output: u128 = bevy::utils::Duration::as_micros(&_self).into(); + output + } + fn as_millis(_self: Ref) { + let output: u128 = bevy::utils::Duration::as_millis(&_self).into(); + output + } + fn as_nanos(_self: Ref) { + let output: u128 = bevy::utils::Duration::as_nanos(&_self).into(); + output + } + fn as_secs(_self: Ref) { + let output: u64 = bevy::utils::Duration::as_secs(&_self).into(); + output + } + fn as_secs_f32(_self: Ref) { + let output: f32 = bevy::utils::Duration::as_secs_f32(&_self).into(); + output + } + fn as_secs_f64(_self: Ref) { + let output: f64 = bevy::utils::Duration::as_secs_f64(&_self).into(); + output + } + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn div(_self: Val, rhs: u32) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn div_duration_f32( + _self: Val, + rhs: Val, + ) { + let output: f32 = bevy::utils::Duration::div_duration_f32( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn div_duration_f64( + _self: Val, + rhs: Val, + ) { + let output: f64 = bevy::utils::Duration::div_duration_f64( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn div_f32(_self: Val, rhs: f32) { + let output: Val = bevy::utils::Duration::div_f32( + _self.into_inner(), + rhs, + ) + .into(); + output + } + fn div_f64(_self: Val, rhs: f64) { + let output: Val = bevy::utils::Duration::div_f64( + _self.into_inner(), + rhs, + ) + .into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn from_micros(micros: u64) { + let output: Val = bevy::utils::Duration::from_micros( + micros, + ) + .into(); + output + } + fn from_millis(millis: u64) { + let output: Val = bevy::utils::Duration::from_millis( + millis, + ) + .into(); + output + } + fn from_nanos(nanos: u64) { + let output: Val = bevy::utils::Duration::from_nanos(nanos) + .into(); + output + } + fn from_secs(secs: u64) { + let output: Val = bevy::utils::Duration::from_secs(secs) + .into(); + output + } + fn from_secs_f32(secs: f32) { + let output: Val = bevy::utils::Duration::from_secs_f32( + secs, + ) + .into(); + output + } + fn from_secs_f64(secs: f64) { + let output: Val = bevy::utils::Duration::from_secs_f64( + secs, + ) + .into(); + output + } + fn is_zero(_self: Ref) { + let output: bool = bevy::utils::Duration::is_zero(&_self).into(); + output + } + fn mul(_self: Val, rhs: u32) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn mul_f32(_self: Val, rhs: f32) { + let output: Val = bevy::utils::Duration::mul_f32( + _self.into_inner(), + rhs, + ) + .into(); + output + } + fn mul_f64(_self: Val, rhs: f64) { + let output: Val = bevy::utils::Duration::mul_f64( + _self.into_inner(), + rhs, + ) + .into(); + output + } + fn new(secs: u64, nanos: u32) { + let output: Val = bevy::utils::Duration::new(secs, nanos) + .into(); + output + } + fn saturating_add( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::utils::Duration::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_mul(_self: Val, rhs: u32) { + let output: Val = bevy::utils::Duration::saturating_mul( + _self.into_inner(), + rhs, + ) + .into(); + output + } + fn saturating_sub( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::utils::Duration::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn subsec_micros(_self: Ref) { + let output: u32 = bevy::utils::Duration::subsec_micros(&_self).into(); + output + } + fn subsec_millis(_self: Ref) { + let output: u32 = bevy::utils::Duration::subsec_millis(&_self).into(); + output + } + fn subsec_nanos(_self: Ref) { + let output: u32 = bevy::utils::Duration::subsec_nanos(&_self).into(); + output + } +} +#[script_bindings(remote, name = "instant")] +impl bevy::utils::Instant { + fn add(_self: Val, other: Val) { + let output: Val = >::add(_self.into_inner(), other.into_inner()) + .into(); + output + } + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn duration_since( + _self: Ref, + earlier: Val, + ) { + let output: Val = bevy::utils::Instant::duration_since( + &_self, + earlier.into_inner(), + ) + .into(); + output + } + fn elapsed(_self: Ref) { + let output: Val = bevy::utils::Instant::elapsed(&_self) + .into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn now() { + let output: Val = bevy::utils::Instant::now().into(); + output + } + fn saturating_duration_since( + _self: Ref, + earlier: Val, + ) { + let output: Val = bevy::utils::Instant::saturating_duration_since( + &_self, + earlier.into_inner(), + ) + .into(); + output + } + fn sub(_self: Val, other: Val) { + let output: Val = >::sub(_self.into_inner(), other.into_inner()) + .into(); + output + } + fn sub(_self: Val, other: Val) { + let output: Val = >::sub(_self.into_inner(), other.into_inner()) + .into(); + output + } +} +#[script_bindings(remote, name = "range_full")] +impl std::ops::RangeFull { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "quat")] +impl bevy::math::Quat { + fn abs_diff_eq( + _self: Val, + rhs: Val, + max_abs_diff: f32, + ) { + let output: bool = bevy::math::Quat::abs_diff_eq( + _self.into_inner(), + rhs.into_inner(), + max_abs_diff, + ) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn angle_between(_self: Val, rhs: Val) { + let output: f32 = bevy::math::Quat::angle_between( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn as_dquat(_self: Val) { + let output: Val = bevy::math::Quat::as_dquat( + _self.into_inner(), + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn conjugate(_self: Val) { + let output: Val = bevy::math::Quat::conjugate( + _self.into_inner(), + ) + .into(); + output + } + fn div(_self: Val, rhs: f32) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn dot(_self: Val, rhs: Val) { + let output: f32 = bevy::math::Quat::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn eq(_self: Ref, rhs: Ref) { + let output: bool = >::eq(&_self, &rhs) + .into(); + output + } + fn from_affine3(a: Ref) { + let output: Val = bevy::math::Quat::from_affine3(&a).into(); + output + } + fn from_array(a: [f32; 4]) { + let output: Val = bevy::math::Quat::from_array(a).into(); + output + } + fn from_axis_angle(axis: Val, angle: f32) { + let output: Val = bevy::math::Quat::from_axis_angle( + axis.into_inner(), + angle, + ) + .into(); + output + } + fn from_euler(euler: Val, a: f32, b: f32, c: f32) { + let output: Val = bevy::math::Quat::from_euler( + euler.into_inner(), + a, + b, + c, + ) + .into(); + output + } + fn from_mat3(mat: Ref) { + let output: Val = bevy::math::Quat::from_mat3(&mat).into(); + output + } + fn from_mat3a(mat: Ref) { + let output: Val = bevy::math::Quat::from_mat3a(&mat).into(); + output + } + fn from_mat4(mat: Ref) { + let output: Val = bevy::math::Quat::from_mat4(&mat).into(); + output + } + fn from_rotation_arc(from: Val, to: Val) { + let output: Val = bevy::math::Quat::from_rotation_arc( + from.into_inner(), + to.into_inner(), + ) + .into(); + output + } + fn from_rotation_arc_2d(from: Val, to: Val) { + let output: Val = bevy::math::Quat::from_rotation_arc_2d( + from.into_inner(), + to.into_inner(), + ) + .into(); + output + } + fn from_rotation_arc_colinear( + from: Val, + to: Val, + ) { + let output: Val = bevy::math::Quat::from_rotation_arc_colinear( + from.into_inner(), + to.into_inner(), + ) + .into(); + output + } + fn from_rotation_x(angle: f32) { + let output: Val = bevy::math::Quat::from_rotation_x(angle) + .into(); + output + } + fn from_rotation_y(angle: f32) { + let output: Val = bevy::math::Quat::from_rotation_y(angle) + .into(); + output + } + fn from_rotation_z(angle: f32) { + let output: Val = bevy::math::Quat::from_rotation_z(angle) + .into(); + output + } + fn from_scaled_axis(v: Val) { + let output: Val = bevy::math::Quat::from_scaled_axis( + v.into_inner(), + ) + .into(); + output + } + fn from_vec4(v: Val) { + let output: Val = bevy::math::Quat::from_vec4(v.into_inner()) + .into(); + output + } + fn from_xyzw(x: f32, y: f32, z: f32, w: f32) { + let output: Val = bevy::math::Quat::from_xyzw(x, y, z, w) + .into(); + output + } + fn inverse(_self: Val) { + let output: Val = bevy::math::Quat::inverse(_self.into_inner()) + .into(); + output + } + fn is_finite(_self: Val) { + let output: bool = bevy::math::Quat::is_finite(_self.into_inner()).into(); + output + } + fn is_nan(_self: Val) { + let output: bool = bevy::math::Quat::is_nan(_self.into_inner()).into(); + output + } + fn is_near_identity(_self: Val) { + let output: bool = bevy::math::Quat::is_near_identity(_self.into_inner()).into(); + output + } + fn is_normalized(_self: Val) { + let output: bool = bevy::math::Quat::is_normalized(_self.into_inner()).into(); + output + } + fn length(_self: Val) { + let output: f32 = bevy::math::Quat::length(_self.into_inner()).into(); + output + } + fn length_recip(_self: Val) { + let output: f32 = bevy::math::Quat::length_recip(_self.into_inner()).into(); + output + } + fn length_squared(_self: Val) { + let output: f32 = bevy::math::Quat::length_squared(_self.into_inner()).into(); + output + } + fn lerp(_self: Val, end: Val, s: f32) { + let output: Val = bevy::math::Quat::lerp( + _self.into_inner(), + end.into_inner(), + s, + ) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: f32) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn mul_quat(_self: Val, rhs: Val) { + let output: Val = bevy::math::Quat::mul_quat( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn mul_vec3(_self: Val, rhs: Val) { + let output: Val = bevy::math::Quat::mul_vec3( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn mul_vec3a(_self: Val, rhs: Val) { + let output: Val = bevy::math::Quat::mul_vec3a( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn normalize(_self: Val) { + let output: Val = bevy::math::Quat::normalize( + _self.into_inner(), + ) + .into(); + output + } + fn rotate_towards( + _self: Ref, + rhs: Val, + max_angle: f32, + ) { + let output: Val = bevy::math::Quat::rotate_towards( + &_self, + rhs.into_inner(), + max_angle, + ) + .into(); + output + } + fn slerp(_self: Val, end: Val, s: f32) { + let output: Val = bevy::math::Quat::slerp( + _self.into_inner(), + end.into_inner(), + s, + ) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn to_array(_self: Ref) { + let output: [f32; 4] = bevy::math::Quat::to_array(&_self).into(); + output + } + fn to_euler(_self: Val, order: Val) { + let output: (f32, f32, f32) = bevy::math::Quat::to_euler( + _self.into_inner(), + order.into_inner(), + ) + .into(); + output + } + fn to_scaled_axis(_self: Val) { + let output: Val = bevy::math::Quat::to_scaled_axis( + _self.into_inner(), + ) + .into(); + output + } + fn xyz(_self: Val) { + let output: Val = bevy::math::Quat::xyz(_self.into_inner()) + .into(); + output + } +} +#[script_bindings(remote, name = "vec_3")] +impl bevy::math::Vec3 { + fn abs(_self: Val) { + let output: Val = bevy::math::Vec3::abs(_self.into_inner()) + .into(); + output + } + fn abs_diff_eq( + _self: Val, + rhs: Val, + max_abs_diff: f32, + ) { + let output: bool = bevy::math::Vec3::abs_diff_eq( + _self.into_inner(), + rhs.into_inner(), + max_abs_diff, + ) + .into(); + output + } + fn add(_self: Val, rhs: Ref) { + let output: Val = >::add(_self.into_inner(), &rhs) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add(_self: Val, rhs: f32) { + let output: Val = >::add(_self.into_inner(), rhs) + .into(); + output + } + fn angle_between(_self: Val, rhs: Val) { + let output: f32 = bevy::math::Vec3::angle_between( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn any_orthogonal_vector(_self: Ref) { + let output: Val = bevy::math::Vec3::any_orthogonal_vector( + &_self, + ) + .into(); + output + } + fn any_orthonormal_vector(_self: Ref) { + let output: Val = bevy::math::Vec3::any_orthonormal_vector( + &_self, + ) + .into(); + output + } + fn as_dvec3(_self: Ref) { + let output: Val = bevy::math::Vec3::as_dvec3(&_self).into(); + output + } + fn as_i64vec3(_self: Ref) { + let output: Val = bevy::math::Vec3::as_i64vec3(&_self) + .into(); + output + } + fn as_ivec3(_self: Ref) { + let output: Val = bevy::math::Vec3::as_ivec3(&_self).into(); + output + } + fn as_u64vec3(_self: Ref) { + let output: Val = bevy::math::Vec3::as_u64vec3(&_self) + .into(); + output + } + fn as_uvec3(_self: Ref) { + let output: Val = bevy::math::Vec3::as_uvec3(&_self).into(); + output + } + fn ceil(_self: Val) { + let output: Val = bevy::math::Vec3::ceil(_self.into_inner()) + .into(); + output + } + fn clamp( + _self: Val, + min: Val, + max: Val, + ) { + let output: Val = bevy::math::Vec3::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + fn clamp_length(_self: Val, min: f32, max: f32) { + let output: Val = bevy::math::Vec3::clamp_length( + _self.into_inner(), + min, + max, + ) + .into(); + output + } + fn clamp_length_max(_self: Val, max: f32) { + let output: Val = bevy::math::Vec3::clamp_length_max( + _self.into_inner(), + max, + ) + .into(); + output + } + fn clamp_length_min(_self: Val, min: f32) { + let output: Val = bevy::math::Vec3::clamp_length_min( + _self.into_inner(), + min, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn cmpeq(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpge(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpgt(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmple(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmplt(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpne(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn copysign(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3::copysign( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cross(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3::cross( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn distance(_self: Val, rhs: Val) { + let output: f32 = bevy::math::Vec3::distance( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn distance_squared(_self: Val, rhs: Val) { + let output: f32 = bevy::math::Vec3::distance_squared( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn div(_self: Val, rhs: Ref) { + let output: Val = >::div(_self.into_inner(), &rhs) + .into(); + output + } + fn div(_self: Val, rhs: Val) { + let output: Val = >::div(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn div(_self: Val, rhs: f32) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn div_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3::div_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn dot(_self: Val, rhs: Val) { + let output: f32 = bevy::math::Vec3::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn dot_into_vec(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn element_product(_self: Val) { + let output: f32 = bevy::math::Vec3::element_product(_self.into_inner()).into(); + output + } + fn element_sum(_self: Val) { + let output: f32 = bevy::math::Vec3::element_sum(_self.into_inner()).into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn exp(_self: Val) { + let output: Val = bevy::math::Vec3::exp(_self.into_inner()) + .into(); + output + } + fn extend(_self: Val, w: f32) { + let output: Val = bevy::math::Vec3::extend( + _self.into_inner(), + w, + ) + .into(); + output + } + fn floor(_self: Val) { + let output: Val = bevy::math::Vec3::floor(_self.into_inner()) + .into(); + output + } + fn fract(_self: Val) { + let output: Val = bevy::math::Vec3::fract(_self.into_inner()) + .into(); + output + } + fn fract_gl(_self: Val) { + let output: Val = bevy::math::Vec3::fract_gl( + _self.into_inner(), + ) + .into(); + output + } + fn from_array(a: [f32; 3]) { + let output: Val = bevy::math::Vec3::from_array(a).into(); + output + } + fn is_finite(_self: Val) { + let output: bool = bevy::math::Vec3::is_finite(_self.into_inner()).into(); + output + } + fn is_finite_mask(_self: Val) { + let output: Val = bevy::math::Vec3::is_finite_mask( + _self.into_inner(), + ) + .into(); + output + } + fn is_nan(_self: Val) { + let output: bool = bevy::math::Vec3::is_nan(_self.into_inner()).into(); + output + } + fn is_nan_mask(_self: Val) { + let output: Val = bevy::math::Vec3::is_nan_mask( + _self.into_inner(), + ) + .into(); + output + } + fn is_negative_bitmask(_self: Val) { + let output: u32 = bevy::math::Vec3::is_negative_bitmask(_self.into_inner()) + .into(); + output + } + fn is_normalized(_self: Val) { + let output: bool = bevy::math::Vec3::is_normalized(_self.into_inner()).into(); + output + } + fn length(_self: Val) { + let output: f32 = bevy::math::Vec3::length(_self.into_inner()).into(); + output + } + fn length_recip(_self: Val) { + let output: f32 = bevy::math::Vec3::length_recip(_self.into_inner()).into(); + output + } + fn length_squared(_self: Val) { + let output: f32 = bevy::math::Vec3::length_squared(_self.into_inner()).into(); + output + } + fn lerp(_self: Val, rhs: Val, s: f32) { + let output: Val = bevy::math::Vec3::lerp( + _self.into_inner(), + rhs.into_inner(), + s, + ) + .into(); + output + } + fn max(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn max_element(_self: Val) { + let output: f32 = bevy::math::Vec3::max_element(_self.into_inner()).into(); + output + } + fn midpoint(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3::midpoint( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min_element(_self: Val) { + let output: f32 = bevy::math::Vec3::min_element(_self.into_inner()).into(); + output + } + fn move_towards(_self: Ref, rhs: Val, d: f32) { + let output: Val = bevy::math::Vec3::move_towards( + &_self, + rhs.into_inner(), + d, + ) + .into(); + output + } + fn mul(_self: Val, rhs: Ref) { + let output: Val = >::mul(_self.into_inner(), &rhs) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: f32) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn mul_add( + _self: Val, + a: Val, + b: Val, + ) { + let output: Val = bevy::math::Vec3::mul_add( + _self.into_inner(), + a.into_inner(), + b.into_inner(), + ) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn new(x: f32, y: f32, z: f32) { + let output: Val = bevy::math::Vec3::new(x, y, z).into(); + output + } + fn normalize(_self: Val) { + let output: Val = bevy::math::Vec3::normalize( + _self.into_inner(), + ) + .into(); + output + } + fn normalize_or(_self: Val, fallback: Val) { + let output: Val = bevy::math::Vec3::normalize_or( + _self.into_inner(), + fallback.into_inner(), + ) + .into(); + output + } + fn normalize_or_zero(_self: Val) { + let output: Val = bevy::math::Vec3::normalize_or_zero( + _self.into_inner(), + ) + .into(); + output + } + fn powf(_self: Val, n: f32) { + let output: Val = bevy::math::Vec3::powf(_self.into_inner(), n) + .into(); + output + } + fn project_onto(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3::project_onto( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn project_onto_normalized( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::Vec3::project_onto_normalized( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn recip(_self: Val) { + let output: Val = bevy::math::Vec3::recip(_self.into_inner()) + .into(); + output + } + fn reflect(_self: Val, normal: Val) { + let output: Val = bevy::math::Vec3::reflect( + _self.into_inner(), + normal.into_inner(), + ) + .into(); + output + } + fn refract(_self: Val, normal: Val, eta: f32) { + let output: Val = bevy::math::Vec3::refract( + _self.into_inner(), + normal.into_inner(), + eta, + ) + .into(); + output + } + fn reject_from(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3::reject_from( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn reject_from_normalized(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3::reject_from_normalized( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn rem(_self: Val, rhs: Ref) { + let output: Val = >::rem(_self.into_inner(), &rhs) + .into(); + output + } + fn rem(_self: Val, rhs: Val) { + let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn rem(_self: Val, rhs: f32) { + let output: Val = >::rem(_self.into_inner(), rhs) + .into(); + output + } + fn rem_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3::rem_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn round(_self: Val) { + let output: Val = bevy::math::Vec3::round(_self.into_inner()) + .into(); + output + } + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) { + let output: Val = bevy::math::Vec3::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + fn signum(_self: Val) { + let output: Val = bevy::math::Vec3::signum(_self.into_inner()) + .into(); + output + } + fn splat(v: f32) { + let output: Val = bevy::math::Vec3::splat(v).into(); + output + } + fn sub(_self: Val, rhs: Ref) { + let output: Val = >::sub(_self.into_inner(), &rhs) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub(_self: Val, rhs: f32) { + let output: Val = >::sub(_self.into_inner(), rhs) + .into(); + output + } + fn to_array(_self: Ref) { + let output: [f32; 3] = bevy::math::Vec3::to_array(&_self).into(); + output + } + fn trunc(_self: Val) { + let output: Val = bevy::math::Vec3::trunc(_self.into_inner()) + .into(); + output + } + fn truncate(_self: Val) { + let output: Val = bevy::math::Vec3::truncate( + _self.into_inner(), + ) + .into(); + output + } + fn with_x(_self: Val, x: f32) { + let output: Val = bevy::math::Vec3::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + fn with_y(_self: Val, y: f32) { + let output: Val = bevy::math::Vec3::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + fn with_z(_self: Val, z: f32) { + let output: Val = bevy::math::Vec3::with_z( + _self.into_inner(), + z, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "i_vec_2")] +impl bevy::math::IVec2 { + fn abs(_self: Val) { + let output: Val = bevy::math::IVec2::abs(_self.into_inner()) + .into(); + output + } + fn add(_self: Val, rhs: Ref) { + let output: Val = >::add(_self.into_inner(), &rhs) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add(_self: Val, rhs: i32) { + let output: Val = >::add(_self.into_inner(), rhs) + .into(); + output + } + fn as_dvec2(_self: Ref) { + let output: Val = bevy::math::IVec2::as_dvec2(&_self).into(); + output + } + fn as_i64vec2(_self: Ref) { + let output: Val = bevy::math::IVec2::as_i64vec2(&_self) + .into(); + output + } + fn as_u64vec2(_self: Ref) { + let output: Val = bevy::math::IVec2::as_u64vec2(&_self) + .into(); + output + } + fn as_uvec2(_self: Ref) { + let output: Val = bevy::math::IVec2::as_uvec2(&_self).into(); + output + } + fn as_vec2(_self: Ref) { + let output: Val = bevy::math::IVec2::as_vec2(&_self).into(); + output + } + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clamp( + _self: Val, + min: Val, + max: Val, + ) { + let output: Val = bevy::math::IVec2::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn cmpeq(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec2::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpge(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec2::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpgt(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec2::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmple(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec2::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmplt(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec2::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpne(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec2::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn distance_squared(_self: Val, rhs: Val) { + let output: i32 = bevy::math::IVec2::distance_squared( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn div(_self: Val, rhs: Ref) { + let output: Val = >::div(_self.into_inner(), &rhs) + .into(); + output + } + fn div(_self: Val, rhs: Val) { + let output: Val = >::div(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn div(_self: Val, rhs: i32) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn div_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec2::div_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn dot(_self: Val, rhs: Val) { + let output: i32 = bevy::math::IVec2::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn dot_into_vec(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec2::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn element_product(_self: Val) { + let output: i32 = bevy::math::IVec2::element_product(_self.into_inner()).into(); + output + } + fn element_sum(_self: Val) { + let output: i32 = bevy::math::IVec2::element_sum(_self.into_inner()).into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn extend(_self: Val, z: i32) { + let output: Val = bevy::math::IVec2::extend( + _self.into_inner(), + z, + ) + .into(); + output + } + fn from_array(a: [i32; 2]) { + let output: Val = bevy::math::IVec2::from_array(a).into(); + output + } + fn is_negative_bitmask(_self: Val) { + let output: u32 = bevy::math::IVec2::is_negative_bitmask(_self.into_inner()) + .into(); + output + } + fn length_squared(_self: Val) { + let output: i32 = bevy::math::IVec2::length_squared(_self.into_inner()).into(); + output + } + fn max(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec2::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn max_element(_self: Val) { + let output: i32 = bevy::math::IVec2::max_element(_self.into_inner()).into(); + output + } + fn min(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec2::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min_element(_self: Val) { + let output: i32 = bevy::math::IVec2::min_element(_self.into_inner()).into(); + output + } + fn mul(_self: Val, rhs: Ref) { + let output: Val = >::mul(_self.into_inner(), &rhs) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: i32) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn new(x: i32, y: i32) { + let output: Val = bevy::math::IVec2::new(x, y).into(); + output + } + fn perp(_self: Val) { + let output: Val = bevy::math::IVec2::perp(_self.into_inner()) + .into(); + output + } + fn perp_dot(_self: Val, rhs: Val) { + let output: i32 = bevy::math::IVec2::perp_dot( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn rem(_self: Val, rhs: Ref) { + let output: Val = >::rem(_self.into_inner(), &rhs) + .into(); + output + } + fn rem(_self: Val, rhs: Val) { + let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn rem(_self: Val, rhs: i32) { + let output: Val = >::rem(_self.into_inner(), rhs) + .into(); + output + } + fn rem_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec2::rem_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn rotate(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec2::rotate( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec2::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_add_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::IVec2::saturating_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec2::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec2::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec2::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_sub_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::IVec2::saturating_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) { + let output: Val = bevy::math::IVec2::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + fn signum(_self: Val) { + let output: Val = bevy::math::IVec2::signum( + _self.into_inner(), + ) + .into(); + output + } + fn splat(v: i32) { + let output: Val = bevy::math::IVec2::splat(v).into(); + output + } + fn sub(_self: Val, rhs: Ref) { + let output: Val = >::sub(_self.into_inner(), &rhs) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub(_self: Val, rhs: i32) { + let output: Val = >::sub(_self.into_inner(), rhs) + .into(); + output + } + fn to_array(_self: Ref) { + let output: [i32; 2] = bevy::math::IVec2::to_array(&_self).into(); + output + } + fn with_x(_self: Val, x: i32) { + let output: Val = bevy::math::IVec2::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + fn with_y(_self: Val, y: i32) { + let output: Val = bevy::math::IVec2::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + fn wrapping_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec2::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_add_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::IVec2::wrapping_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec2::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec2::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec2::wrapping_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_sub_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::IVec2::wrapping_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "i_vec_3")] +impl bevy::math::IVec3 { + fn abs(_self: Val) { + let output: Val = bevy::math::IVec3::abs(_self.into_inner()) + .into(); + output + } + fn add(_self: Val, rhs: Ref) { + let output: Val = >::add(_self.into_inner(), &rhs) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add(_self: Val, rhs: i32) { + let output: Val = >::add(_self.into_inner(), rhs) + .into(); + output + } + fn as_dvec3(_self: Ref) { + let output: Val = bevy::math::IVec3::as_dvec3(&_self).into(); + output + } + fn as_i64vec3(_self: Ref) { + let output: Val = bevy::math::IVec3::as_i64vec3(&_self) + .into(); + output + } + fn as_u64vec3(_self: Ref) { + let output: Val = bevy::math::IVec3::as_u64vec3(&_self) + .into(); + output + } + fn as_uvec3(_self: Ref) { + let output: Val = bevy::math::IVec3::as_uvec3(&_self).into(); + output + } + fn as_vec3(_self: Ref) { + let output: Val = bevy::math::IVec3::as_vec3(&_self).into(); + output + } + fn as_vec3a(_self: Ref) { + let output: Val = bevy::math::IVec3::as_vec3a(&_self).into(); + output + } + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clamp( + _self: Val, + min: Val, + max: Val, + ) { + let output: Val = bevy::math::IVec3::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn cmpeq(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec3::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpge(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec3::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpgt(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec3::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmple(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec3::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmplt(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec3::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpne(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec3::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cross(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec3::cross( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn distance_squared(_self: Val, rhs: Val) { + let output: i32 = bevy::math::IVec3::distance_squared( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn div(_self: Val, rhs: Ref) { + let output: Val = >::div(_self.into_inner(), &rhs) + .into(); + output + } + fn div(_self: Val, rhs: Val) { + let output: Val = >::div(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn div(_self: Val, rhs: i32) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn div_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec3::div_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn dot(_self: Val, rhs: Val) { + let output: i32 = bevy::math::IVec3::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn dot_into_vec(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec3::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn element_product(_self: Val) { + let output: i32 = bevy::math::IVec3::element_product(_self.into_inner()).into(); + output + } + fn element_sum(_self: Val) { + let output: i32 = bevy::math::IVec3::element_sum(_self.into_inner()).into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn extend(_self: Val, w: i32) { + let output: Val = bevy::math::IVec3::extend( + _self.into_inner(), + w, + ) + .into(); + output + } + fn from_array(a: [i32; 3]) { + let output: Val = bevy::math::IVec3::from_array(a).into(); + output + } + fn is_negative_bitmask(_self: Val) { + let output: u32 = bevy::math::IVec3::is_negative_bitmask(_self.into_inner()) + .into(); + output + } + fn length_squared(_self: Val) { + let output: i32 = bevy::math::IVec3::length_squared(_self.into_inner()).into(); + output + } + fn max(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec3::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn max_element(_self: Val) { + let output: i32 = bevy::math::IVec3::max_element(_self.into_inner()).into(); + output + } + fn min(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec3::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min_element(_self: Val) { + let output: i32 = bevy::math::IVec3::min_element(_self.into_inner()).into(); + output + } + fn mul(_self: Val, rhs: Ref) { + let output: Val = >::mul(_self.into_inner(), &rhs) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: i32) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn new(x: i32, y: i32, z: i32) { + let output: Val = bevy::math::IVec3::new(x, y, z).into(); + output + } + fn rem(_self: Val, rhs: Ref) { + let output: Val = >::rem(_self.into_inner(), &rhs) + .into(); + output + } + fn rem(_self: Val, rhs: Val) { + let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn rem(_self: Val, rhs: i32) { + let output: Val = >::rem(_self.into_inner(), rhs) + .into(); + output + } + fn rem_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec3::rem_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec3::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_add_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::IVec3::saturating_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec3::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec3::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec3::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_sub_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::IVec3::saturating_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) { + let output: Val = bevy::math::IVec3::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + fn signum(_self: Val) { + let output: Val = bevy::math::IVec3::signum( + _self.into_inner(), + ) + .into(); + output + } + fn splat(v: i32) { + let output: Val = bevy::math::IVec3::splat(v).into(); + output + } + fn sub(_self: Val, rhs: Ref) { + let output: Val = >::sub(_self.into_inner(), &rhs) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub(_self: Val, rhs: i32) { + let output: Val = >::sub(_self.into_inner(), rhs) + .into(); + output + } + fn to_array(_self: Ref) { + let output: [i32; 3] = bevy::math::IVec3::to_array(&_self).into(); + output + } + fn truncate(_self: Val) { + let output: Val = bevy::math::IVec3::truncate( + _self.into_inner(), + ) + .into(); + output + } + fn with_x(_self: Val, x: i32) { + let output: Val = bevy::math::IVec3::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + fn with_y(_self: Val, y: i32) { + let output: Val = bevy::math::IVec3::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + fn with_z(_self: Val, z: i32) { + let output: Val = bevy::math::IVec3::with_z( + _self.into_inner(), + z, + ) + .into(); + output + } + fn wrapping_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec3::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_add_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::IVec3::wrapping_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec3::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec3::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec3::wrapping_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_sub_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::IVec3::wrapping_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "i_vec_4")] +impl bevy::math::IVec4 { + fn abs(_self: Val) { + let output: Val = bevy::math::IVec4::abs(_self.into_inner()) + .into(); + output + } + fn add(_self: Val, rhs: Ref) { + let output: Val = >::add(_self.into_inner(), &rhs) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add(_self: Val, rhs: i32) { + let output: Val = >::add(_self.into_inner(), rhs) + .into(); + output + } + fn as_dvec4(_self: Ref) { + let output: Val = bevy::math::IVec4::as_dvec4(&_self).into(); + output + } + fn as_i64vec4(_self: Ref) { + let output: Val = bevy::math::IVec4::as_i64vec4(&_self) + .into(); + output + } + fn as_u64vec4(_self: Ref) { + let output: Val = bevy::math::IVec4::as_u64vec4(&_self) + .into(); + output + } + fn as_uvec4(_self: Ref) { + let output: Val = bevy::math::IVec4::as_uvec4(&_self).into(); + output + } + fn as_vec4(_self: Ref) { + let output: Val = bevy::math::IVec4::as_vec4(&_self).into(); + output + } + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clamp( + _self: Val, + min: Val, + max: Val, + ) { + let output: Val = bevy::math::IVec4::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn cmpeq(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec4::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpge(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec4::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpgt(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec4::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmple(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec4::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmplt(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec4::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpne(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec4::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn distance_squared(_self: Val, rhs: Val) { + let output: i32 = bevy::math::IVec4::distance_squared( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn div(_self: Val, rhs: Ref) { + let output: Val = >::div(_self.into_inner(), &rhs) + .into(); + output + } + fn div(_self: Val, rhs: Val) { + let output: Val = >::div(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn div(_self: Val, rhs: i32) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn div_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec4::div_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn dot(_self: Val, rhs: Val) { + let output: i32 = bevy::math::IVec4::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn dot_into_vec(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec4::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn element_product(_self: Val) { + let output: i32 = bevy::math::IVec4::element_product(_self.into_inner()).into(); + output + } + fn element_sum(_self: Val) { + let output: i32 = bevy::math::IVec4::element_sum(_self.into_inner()).into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn from_array(a: [i32; 4]) { + let output: Val = bevy::math::IVec4::from_array(a).into(); + output + } + fn is_negative_bitmask(_self: Val) { + let output: u32 = bevy::math::IVec4::is_negative_bitmask(_self.into_inner()) + .into(); + output + } + fn length_squared(_self: Val) { + let output: i32 = bevy::math::IVec4::length_squared(_self.into_inner()).into(); + output + } + fn max(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec4::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn max_element(_self: Val) { + let output: i32 = bevy::math::IVec4::max_element(_self.into_inner()).into(); + output + } + fn min(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec4::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min_element(_self: Val) { + let output: i32 = bevy::math::IVec4::min_element(_self.into_inner()).into(); + output + } + fn mul(_self: Val, rhs: Ref) { + let output: Val = >::mul(_self.into_inner(), &rhs) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: i32) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn new(x: i32, y: i32, z: i32, w: i32) { + let output: Val = bevy::math::IVec4::new(x, y, z, w).into(); + output + } + fn rem(_self: Val, rhs: Ref) { + let output: Val = >::rem(_self.into_inner(), &rhs) + .into(); + output + } + fn rem(_self: Val, rhs: Val) { + let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn rem(_self: Val, rhs: i32) { + let output: Val = >::rem(_self.into_inner(), rhs) + .into(); + output + } + fn rem_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec4::rem_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec4::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_add_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::IVec4::saturating_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec4::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec4::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec4::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_sub_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::IVec4::saturating_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) { + let output: Val = bevy::math::IVec4::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + fn signum(_self: Val) { + let output: Val = bevy::math::IVec4::signum( + _self.into_inner(), + ) + .into(); + output + } + fn splat(v: i32) { + let output: Val = bevy::math::IVec4::splat(v).into(); + output + } + fn sub(_self: Val, rhs: Ref) { + let output: Val = >::sub(_self.into_inner(), &rhs) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub(_self: Val, rhs: i32) { + let output: Val = >::sub(_self.into_inner(), rhs) + .into(); + output + } + fn to_array(_self: Ref) { + let output: [i32; 4] = bevy::math::IVec4::to_array(&_self).into(); + output + } + fn truncate(_self: Val) { + let output: Val = bevy::math::IVec4::truncate( + _self.into_inner(), + ) + .into(); + output + } + fn with_w(_self: Val, w: i32) { + let output: Val = bevy::math::IVec4::with_w( + _self.into_inner(), + w, + ) + .into(); + output + } + fn with_x(_self: Val, x: i32) { + let output: Val = bevy::math::IVec4::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + fn with_y(_self: Val, y: i32) { + let output: Val = bevy::math::IVec4::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + fn with_z(_self: Val, z: i32) { + let output: Val = bevy::math::IVec4::with_z( + _self.into_inner(), + z, + ) + .into(); + output + } + fn wrapping_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec4::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_add_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::IVec4::wrapping_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec4::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec4::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::IVec4::wrapping_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_sub_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::IVec4::wrapping_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "i_64_vec_2")] +impl bevy::math::I64Vec2 { + fn abs(_self: Val) { + let output: Val = bevy::math::I64Vec2::abs( + _self.into_inner(), + ) + .into(); + output + } + fn add(_self: Val, rhs: Ref) { + let output: Val = >::add(_self.into_inner(), &rhs) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add(_self: Val, rhs: i64) { + let output: Val = >::add(_self.into_inner(), rhs) + .into(); + output + } + fn as_dvec2(_self: Ref) { + let output: Val = bevy::math::I64Vec2::as_dvec2(&_self) + .into(); + output + } + fn as_ivec2(_self: Ref) { + let output: Val = bevy::math::I64Vec2::as_ivec2(&_self) + .into(); + output + } + fn as_u64vec2(_self: Ref) { + let output: Val = bevy::math::I64Vec2::as_u64vec2(&_self) + .into(); + output + } + fn as_uvec2(_self: Ref) { + let output: Val = bevy::math::I64Vec2::as_uvec2(&_self) + .into(); + output + } + fn as_vec2(_self: Ref) { + let output: Val = bevy::math::I64Vec2::as_vec2(&_self).into(); + output + } + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clamp( + _self: Val, + min: Val, + max: Val, + ) { + let output: Val = bevy::math::I64Vec2::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn cmpeq(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec2::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpge(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec2::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpgt(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec2::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmple(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec2::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmplt(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec2::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpne(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec2::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn distance_squared(_self: Val, rhs: Val) { + let output: i64 = bevy::math::I64Vec2::distance_squared( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn div(_self: Val, rhs: Ref) { + let output: Val = >::div(_self.into_inner(), &rhs) + .into(); + output + } + fn div(_self: Val, rhs: Val) { + let output: Val = >::div(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn div(_self: Val, rhs: i64) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn div_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec2::div_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn dot(_self: Val, rhs: Val) { + let output: i64 = bevy::math::I64Vec2::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn dot_into_vec(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec2::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn element_product(_self: Val) { + let output: i64 = bevy::math::I64Vec2::element_product(_self.into_inner()) + .into(); + output + } + fn element_sum(_self: Val) { + let output: i64 = bevy::math::I64Vec2::element_sum(_self.into_inner()).into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn extend(_self: Val, z: i64) { + let output: Val = bevy::math::I64Vec2::extend( + _self.into_inner(), + z, + ) + .into(); + output + } + fn from_array(a: [i64; 2]) { + let output: Val = bevy::math::I64Vec2::from_array(a).into(); + output + } + fn is_negative_bitmask(_self: Val) { + let output: u32 = bevy::math::I64Vec2::is_negative_bitmask(_self.into_inner()) + .into(); + output + } + fn length_squared(_self: Val) { + let output: i64 = bevy::math::I64Vec2::length_squared(_self.into_inner()).into(); + output + } + fn max(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec2::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn max_element(_self: Val) { + let output: i64 = bevy::math::I64Vec2::max_element(_self.into_inner()).into(); + output + } + fn min(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec2::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min_element(_self: Val) { + let output: i64 = bevy::math::I64Vec2::min_element(_self.into_inner()).into(); + output + } + fn mul(_self: Val, rhs: Ref) { + let output: Val = >::mul(_self.into_inner(), &rhs) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: i64) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn new(x: i64, y: i64) { + let output: Val = bevy::math::I64Vec2::new(x, y).into(); + output + } + fn perp(_self: Val) { + let output: Val = bevy::math::I64Vec2::perp( + _self.into_inner(), + ) + .into(); + output + } + fn perp_dot(_self: Val, rhs: Val) { + let output: i64 = bevy::math::I64Vec2::perp_dot( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn rem(_self: Val, rhs: Ref) { + let output: Val = >::rem(_self.into_inner(), &rhs) + .into(); + output + } + fn rem(_self: Val, rhs: Val) { + let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn rem(_self: Val, rhs: i64) { + let output: Val = >::rem(_self.into_inner(), rhs) + .into(); + output + } + fn rem_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec2::rem_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn rotate(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec2::rotate( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec2::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_add_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::I64Vec2::saturating_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec2::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec2::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec2::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_sub_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::I64Vec2::saturating_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) { + let output: Val = bevy::math::I64Vec2::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + fn signum(_self: Val) { + let output: Val = bevy::math::I64Vec2::signum( + _self.into_inner(), + ) + .into(); + output + } + fn splat(v: i64) { + let output: Val = bevy::math::I64Vec2::splat(v).into(); + output + } + fn sub(_self: Val, rhs: Ref) { + let output: Val = >::sub(_self.into_inner(), &rhs) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub(_self: Val, rhs: i64) { + let output: Val = >::sub(_self.into_inner(), rhs) + .into(); + output + } + fn to_array(_self: Ref) { + let output: [i64; 2] = bevy::math::I64Vec2::to_array(&_self).into(); + output + } + fn with_x(_self: Val, x: i64) { + let output: Val = bevy::math::I64Vec2::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + fn with_y(_self: Val, y: i64) { + let output: Val = bevy::math::I64Vec2::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + fn wrapping_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec2::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_add_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::I64Vec2::wrapping_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec2::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec2::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec2::wrapping_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_sub_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::I64Vec2::wrapping_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "i_64_vec_3")] +impl bevy::math::I64Vec3 { + fn abs(_self: Val) { + let output: Val = bevy::math::I64Vec3::abs( + _self.into_inner(), + ) + .into(); + output + } + fn add(_self: Val, rhs: Ref) { + let output: Val = >::add(_self.into_inner(), &rhs) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add(_self: Val, rhs: i64) { + let output: Val = >::add(_self.into_inner(), rhs) + .into(); + output + } + fn as_dvec3(_self: Ref) { + let output: Val = bevy::math::I64Vec3::as_dvec3(&_self) + .into(); + output + } + fn as_ivec3(_self: Ref) { + let output: Val = bevy::math::I64Vec3::as_ivec3(&_self) + .into(); + output + } + fn as_u64vec3(_self: Ref) { + let output: Val = bevy::math::I64Vec3::as_u64vec3(&_self) + .into(); + output + } + fn as_uvec3(_self: Ref) { + let output: Val = bevy::math::I64Vec3::as_uvec3(&_self) + .into(); + output + } + fn as_vec3(_self: Ref) { + let output: Val = bevy::math::I64Vec3::as_vec3(&_self).into(); + output + } + fn as_vec3a(_self: Ref) { + let output: Val = bevy::math::I64Vec3::as_vec3a(&_self) + .into(); + output + } + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clamp( + _self: Val, + min: Val, + max: Val, + ) { + let output: Val = bevy::math::I64Vec3::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn cmpeq(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec3::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpge(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec3::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpgt(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec3::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmple(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec3::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmplt(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec3::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpne(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec3::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cross(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec3::cross( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn distance_squared(_self: Val, rhs: Val) { + let output: i64 = bevy::math::I64Vec3::distance_squared( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn div(_self: Val, rhs: Ref) { + let output: Val = >::div(_self.into_inner(), &rhs) + .into(); + output + } + fn div(_self: Val, rhs: Val) { + let output: Val = >::div(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn div(_self: Val, rhs: i64) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn div_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec3::div_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn dot(_self: Val, rhs: Val) { + let output: i64 = bevy::math::I64Vec3::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn dot_into_vec(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec3::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn element_product(_self: Val) { + let output: i64 = bevy::math::I64Vec3::element_product(_self.into_inner()) + .into(); + output + } + fn element_sum(_self: Val) { + let output: i64 = bevy::math::I64Vec3::element_sum(_self.into_inner()).into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn extend(_self: Val, w: i64) { + let output: Val = bevy::math::I64Vec3::extend( + _self.into_inner(), + w, + ) + .into(); + output + } + fn from_array(a: [i64; 3]) { + let output: Val = bevy::math::I64Vec3::from_array(a).into(); + output + } + fn is_negative_bitmask(_self: Val) { + let output: u32 = bevy::math::I64Vec3::is_negative_bitmask(_self.into_inner()) + .into(); + output + } + fn length_squared(_self: Val) { + let output: i64 = bevy::math::I64Vec3::length_squared(_self.into_inner()).into(); + output + } + fn max(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec3::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn max_element(_self: Val) { + let output: i64 = bevy::math::I64Vec3::max_element(_self.into_inner()).into(); + output + } + fn min(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec3::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min_element(_self: Val) { + let output: i64 = bevy::math::I64Vec3::min_element(_self.into_inner()).into(); + output + } + fn mul(_self: Val, rhs: Ref) { + let output: Val = >::mul(_self.into_inner(), &rhs) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: i64) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn new(x: i64, y: i64, z: i64) { + let output: Val = bevy::math::I64Vec3::new(x, y, z).into(); + output + } + fn rem(_self: Val, rhs: Ref) { + let output: Val = >::rem(_self.into_inner(), &rhs) + .into(); + output + } + fn rem(_self: Val, rhs: Val) { + let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn rem(_self: Val, rhs: i64) { + let output: Val = >::rem(_self.into_inner(), rhs) + .into(); + output + } + fn rem_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec3::rem_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec3::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_add_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::I64Vec3::saturating_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec3::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec3::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec3::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_sub_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::I64Vec3::saturating_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) { + let output: Val = bevy::math::I64Vec3::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + fn signum(_self: Val) { + let output: Val = bevy::math::I64Vec3::signum( + _self.into_inner(), + ) + .into(); + output + } + fn splat(v: i64) { + let output: Val = bevy::math::I64Vec3::splat(v).into(); + output + } + fn sub(_self: Val, rhs: Ref) { + let output: Val = >::sub(_self.into_inner(), &rhs) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub(_self: Val, rhs: i64) { + let output: Val = >::sub(_self.into_inner(), rhs) + .into(); + output + } + fn to_array(_self: Ref) { + let output: [i64; 3] = bevy::math::I64Vec3::to_array(&_self).into(); + output + } + fn truncate(_self: Val) { + let output: Val = bevy::math::I64Vec3::truncate( + _self.into_inner(), + ) + .into(); + output + } + fn with_x(_self: Val, x: i64) { + let output: Val = bevy::math::I64Vec3::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + fn with_y(_self: Val, y: i64) { + let output: Val = bevy::math::I64Vec3::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + fn with_z(_self: Val, z: i64) { + let output: Val = bevy::math::I64Vec3::with_z( + _self.into_inner(), + z, + ) + .into(); + output + } + fn wrapping_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec3::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_add_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::I64Vec3::wrapping_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec3::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec3::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec3::wrapping_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_sub_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::I64Vec3::wrapping_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "i_64_vec_4")] +impl bevy::math::I64Vec4 { + fn abs(_self: Val) { + let output: Val = bevy::math::I64Vec4::abs( + _self.into_inner(), + ) + .into(); + output + } + fn add(_self: Val, rhs: Ref) { + let output: Val = >::add(_self.into_inner(), &rhs) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add(_self: Val, rhs: i64) { + let output: Val = >::add(_self.into_inner(), rhs) + .into(); + output + } + fn as_dvec4(_self: Ref) { + let output: Val = bevy::math::I64Vec4::as_dvec4(&_self) + .into(); + output + } + fn as_ivec4(_self: Ref) { + let output: Val = bevy::math::I64Vec4::as_ivec4(&_self) + .into(); + output + } + fn as_u64vec4(_self: Ref) { + let output: Val = bevy::math::I64Vec4::as_u64vec4(&_self) + .into(); + output + } + fn as_uvec4(_self: Ref) { + let output: Val = bevy::math::I64Vec4::as_uvec4(&_self) + .into(); + output + } + fn as_vec4(_self: Ref) { + let output: Val = bevy::math::I64Vec4::as_vec4(&_self).into(); + output + } + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clamp( + _self: Val, + min: Val, + max: Val, + ) { + let output: Val = bevy::math::I64Vec4::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn cmpeq(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec4::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpge(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec4::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpgt(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec4::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmple(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec4::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmplt(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec4::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpne(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec4::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn distance_squared(_self: Val, rhs: Val) { + let output: i64 = bevy::math::I64Vec4::distance_squared( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn div(_self: Val, rhs: Ref) { + let output: Val = >::div(_self.into_inner(), &rhs) + .into(); + output + } + fn div(_self: Val, rhs: Val) { + let output: Val = >::div(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn div(_self: Val, rhs: i64) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn div_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec4::div_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn dot(_self: Val, rhs: Val) { + let output: i64 = bevy::math::I64Vec4::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn dot_into_vec(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec4::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn element_product(_self: Val) { + let output: i64 = bevy::math::I64Vec4::element_product(_self.into_inner()) + .into(); + output + } + fn element_sum(_self: Val) { + let output: i64 = bevy::math::I64Vec4::element_sum(_self.into_inner()).into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn from_array(a: [i64; 4]) { + let output: Val = bevy::math::I64Vec4::from_array(a).into(); + output + } + fn is_negative_bitmask(_self: Val) { + let output: u32 = bevy::math::I64Vec4::is_negative_bitmask(_self.into_inner()) + .into(); + output + } + fn length_squared(_self: Val) { + let output: i64 = bevy::math::I64Vec4::length_squared(_self.into_inner()).into(); + output + } + fn max(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec4::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn max_element(_self: Val) { + let output: i64 = bevy::math::I64Vec4::max_element(_self.into_inner()).into(); + output + } + fn min(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec4::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min_element(_self: Val) { + let output: i64 = bevy::math::I64Vec4::min_element(_self.into_inner()).into(); + output + } + fn mul(_self: Val, rhs: Ref) { + let output: Val = >::mul(_self.into_inner(), &rhs) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: i64) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn new(x: i64, y: i64, z: i64, w: i64) { + let output: Val = bevy::math::I64Vec4::new(x, y, z, w) + .into(); + output + } + fn rem(_self: Val, rhs: Ref) { + let output: Val = >::rem(_self.into_inner(), &rhs) + .into(); + output + } + fn rem(_self: Val, rhs: Val) { + let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn rem(_self: Val, rhs: i64) { + let output: Val = >::rem(_self.into_inner(), rhs) + .into(); + output + } + fn rem_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec4::rem_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec4::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_add_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::I64Vec4::saturating_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec4::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec4::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec4::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_sub_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::I64Vec4::saturating_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) { + let output: Val = bevy::math::I64Vec4::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + fn signum(_self: Val) { + let output: Val = bevy::math::I64Vec4::signum( + _self.into_inner(), + ) + .into(); + output + } + fn splat(v: i64) { + let output: Val = bevy::math::I64Vec4::splat(v).into(); + output + } + fn sub(_self: Val, rhs: Ref) { + let output: Val = >::sub(_self.into_inner(), &rhs) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub(_self: Val, rhs: i64) { + let output: Val = >::sub(_self.into_inner(), rhs) + .into(); + output + } + fn to_array(_self: Ref) { + let output: [i64; 4] = bevy::math::I64Vec4::to_array(&_self).into(); + output + } + fn truncate(_self: Val) { + let output: Val = bevy::math::I64Vec4::truncate( + _self.into_inner(), + ) + .into(); + output + } + fn with_w(_self: Val, w: i64) { + let output: Val = bevy::math::I64Vec4::with_w( + _self.into_inner(), + w, + ) + .into(); + output + } + fn with_x(_self: Val, x: i64) { + let output: Val = bevy::math::I64Vec4::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + fn with_y(_self: Val, y: i64) { + let output: Val = bevy::math::I64Vec4::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + fn with_z(_self: Val, z: i64) { + let output: Val = bevy::math::I64Vec4::with_z( + _self.into_inner(), + z, + ) + .into(); + output + } + fn wrapping_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec4::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_add_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::I64Vec4::wrapping_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec4::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec4::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::I64Vec4::wrapping_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_sub_unsigned( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::I64Vec4::wrapping_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "u_vec_2")] +impl bevy::math::UVec2 { + fn add(_self: Val, rhs: Ref) { + let output: Val = >::add(_self.into_inner(), &rhs) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add(_self: Val, rhs: u32) { + let output: Val = >::add(_self.into_inner(), rhs) + .into(); + output + } + fn as_dvec2(_self: Ref) { + let output: Val = bevy::math::UVec2::as_dvec2(&_self).into(); + output + } + fn as_i64vec2(_self: Ref) { + let output: Val = bevy::math::UVec2::as_i64vec2(&_self) + .into(); + output + } + fn as_ivec2(_self: Ref) { + let output: Val = bevy::math::UVec2::as_ivec2(&_self).into(); + output + } + fn as_u64vec2(_self: Ref) { + let output: Val = bevy::math::UVec2::as_u64vec2(&_self) + .into(); + output + } + fn as_vec2(_self: Ref) { + let output: Val = bevy::math::UVec2::as_vec2(&_self).into(); + output + } + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clamp( + _self: Val, + min: Val, + max: Val, + ) { + let output: Val = bevy::math::UVec2::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn cmpeq(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec2::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpge(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec2::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpgt(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec2::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmple(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec2::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmplt(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec2::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpne(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec2::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn div(_self: Val, rhs: Ref) { + let output: Val = >::div(_self.into_inner(), &rhs) + .into(); + output + } + fn div(_self: Val, rhs: Val) { + let output: Val = >::div(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn div(_self: Val, rhs: u32) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn dot(_self: Val, rhs: Val) { + let output: u32 = bevy::math::UVec2::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn dot_into_vec(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec2::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn element_product(_self: Val) { + let output: u32 = bevy::math::UVec2::element_product(_self.into_inner()).into(); + output + } + fn element_sum(_self: Val) { + let output: u32 = bevy::math::UVec2::element_sum(_self.into_inner()).into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn extend(_self: Val, z: u32) { + let output: Val = bevy::math::UVec2::extend( + _self.into_inner(), + z, + ) + .into(); + output + } + fn from_array(a: [u32; 2]) { + let output: Val = bevy::math::UVec2::from_array(a).into(); + output + } + fn length_squared(_self: Val) { + let output: u32 = bevy::math::UVec2::length_squared(_self.into_inner()).into(); + output + } + fn max(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec2::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn max_element(_self: Val) { + let output: u32 = bevy::math::UVec2::max_element(_self.into_inner()).into(); + output + } + fn min(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec2::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min_element(_self: Val) { + let output: u32 = bevy::math::UVec2::min_element(_self.into_inner()).into(); + output + } + fn mul(_self: Val, rhs: Ref) { + let output: Val = >::mul(_self.into_inner(), &rhs) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: u32) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn new(x: u32, y: u32) { + let output: Val = bevy::math::UVec2::new(x, y).into(); + output + } + fn rem(_self: Val, rhs: Ref) { + let output: Val = >::rem(_self.into_inner(), &rhs) + .into(); + output + } + fn rem(_self: Val, rhs: Val) { + let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn rem(_self: Val, rhs: u32) { + let output: Val = >::rem(_self.into_inner(), rhs) + .into(); + output + } + fn saturating_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec2::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_add_signed( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::UVec2::saturating_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec2::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec2::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec2::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) { + let output: Val = bevy::math::UVec2::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + fn splat(v: u32) { + let output: Val = bevy::math::UVec2::splat(v).into(); + output + } + fn sub(_self: Val, rhs: Ref) { + let output: Val = >::sub(_self.into_inner(), &rhs) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub(_self: Val, rhs: u32) { + let output: Val = >::sub(_self.into_inner(), rhs) + .into(); + output + } + fn to_array(_self: Ref) { + let output: [u32; 2] = bevy::math::UVec2::to_array(&_self).into(); + output + } + fn with_x(_self: Val, x: u32) { + let output: Val = bevy::math::UVec2::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + fn with_y(_self: Val, y: u32) { + let output: Val = bevy::math::UVec2::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + fn wrapping_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec2::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_add_signed(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec2::wrapping_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec2::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec2::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec2::wrapping_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "u_vec_3")] +impl bevy::math::UVec3 { + fn add(_self: Val, rhs: Ref) { + let output: Val = >::add(_self.into_inner(), &rhs) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add(_self: Val, rhs: u32) { + let output: Val = >::add(_self.into_inner(), rhs) + .into(); + output + } + fn as_dvec3(_self: Ref) { + let output: Val = bevy::math::UVec3::as_dvec3(&_self).into(); + output + } + fn as_i64vec3(_self: Ref) { + let output: Val = bevy::math::UVec3::as_i64vec3(&_self) + .into(); + output + } + fn as_ivec3(_self: Ref) { + let output: Val = bevy::math::UVec3::as_ivec3(&_self).into(); + output + } + fn as_u64vec3(_self: Ref) { + let output: Val = bevy::math::UVec3::as_u64vec3(&_self) + .into(); + output + } + fn as_vec3(_self: Ref) { + let output: Val = bevy::math::UVec3::as_vec3(&_self).into(); + output + } + fn as_vec3a(_self: Ref) { + let output: Val = bevy::math::UVec3::as_vec3a(&_self).into(); + output + } + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clamp( + _self: Val, + min: Val, + max: Val, + ) { + let output: Val = bevy::math::UVec3::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn cmpeq(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec3::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpge(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec3::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpgt(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec3::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmple(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec3::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmplt(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec3::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpne(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec3::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cross(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec3::cross( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn div(_self: Val, rhs: Ref) { + let output: Val = >::div(_self.into_inner(), &rhs) + .into(); + output + } + fn div(_self: Val, rhs: Val) { + let output: Val = >::div(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn div(_self: Val, rhs: u32) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn dot(_self: Val, rhs: Val) { + let output: u32 = bevy::math::UVec3::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn dot_into_vec(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec3::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn element_product(_self: Val) { + let output: u32 = bevy::math::UVec3::element_product(_self.into_inner()).into(); + output + } + fn element_sum(_self: Val) { + let output: u32 = bevy::math::UVec3::element_sum(_self.into_inner()).into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn extend(_self: Val, w: u32) { + let output: Val = bevy::math::UVec3::extend( + _self.into_inner(), + w, + ) + .into(); + output + } + fn from_array(a: [u32; 3]) { + let output: Val = bevy::math::UVec3::from_array(a).into(); + output + } + fn length_squared(_self: Val) { + let output: u32 = bevy::math::UVec3::length_squared(_self.into_inner()).into(); + output + } + fn max(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec3::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn max_element(_self: Val) { + let output: u32 = bevy::math::UVec3::max_element(_self.into_inner()).into(); + output + } + fn min(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec3::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min_element(_self: Val) { + let output: u32 = bevy::math::UVec3::min_element(_self.into_inner()).into(); + output + } + fn mul(_self: Val, rhs: Ref) { + let output: Val = >::mul(_self.into_inner(), &rhs) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: u32) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn new(x: u32, y: u32, z: u32) { + let output: Val = bevy::math::UVec3::new(x, y, z).into(); + output + } + fn rem(_self: Val, rhs: Ref) { + let output: Val = >::rem(_self.into_inner(), &rhs) + .into(); + output + } + fn rem(_self: Val, rhs: Val) { + let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn rem(_self: Val, rhs: u32) { + let output: Val = >::rem(_self.into_inner(), rhs) + .into(); + output + } + fn saturating_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec3::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_add_signed( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::UVec3::saturating_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec3::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec3::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec3::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) { + let output: Val = bevy::math::UVec3::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + fn splat(v: u32) { + let output: Val = bevy::math::UVec3::splat(v).into(); + output + } + fn sub(_self: Val, rhs: Ref) { + let output: Val = >::sub(_self.into_inner(), &rhs) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub(_self: Val, rhs: u32) { + let output: Val = >::sub(_self.into_inner(), rhs) + .into(); + output + } + fn to_array(_self: Ref) { + let output: [u32; 3] = bevy::math::UVec3::to_array(&_self).into(); + output + } + fn truncate(_self: Val) { + let output: Val = bevy::math::UVec3::truncate( + _self.into_inner(), + ) + .into(); + output + } + fn with_x(_self: Val, x: u32) { + let output: Val = bevy::math::UVec3::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + fn with_y(_self: Val, y: u32) { + let output: Val = bevy::math::UVec3::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + fn with_z(_self: Val, z: u32) { + let output: Val = bevy::math::UVec3::with_z( + _self.into_inner(), + z, + ) + .into(); + output + } + fn wrapping_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec3::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_add_signed(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec3::wrapping_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec3::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec3::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec3::wrapping_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "u_vec_4")] +impl bevy::math::UVec4 { + fn add(_self: Val, rhs: Ref) { + let output: Val = >::add(_self.into_inner(), &rhs) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add(_self: Val, rhs: u32) { + let output: Val = >::add(_self.into_inner(), rhs) + .into(); + output + } + fn as_dvec4(_self: Ref) { + let output: Val = bevy::math::UVec4::as_dvec4(&_self).into(); + output + } + fn as_i64vec4(_self: Ref) { + let output: Val = bevy::math::UVec4::as_i64vec4(&_self) + .into(); + output + } + fn as_ivec4(_self: Ref) { + let output: Val = bevy::math::UVec4::as_ivec4(&_self).into(); + output + } + fn as_u64vec4(_self: Ref) { + let output: Val = bevy::math::UVec4::as_u64vec4(&_self) + .into(); + output + } + fn as_vec4(_self: Ref) { + let output: Val = bevy::math::UVec4::as_vec4(&_self).into(); + output + } + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clamp( + _self: Val, + min: Val, + max: Val, + ) { + let output: Val = bevy::math::UVec4::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn cmpeq(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec4::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpge(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec4::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpgt(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec4::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmple(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec4::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmplt(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec4::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpne(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec4::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn div(_self: Val, rhs: Ref) { + let output: Val = >::div(_self.into_inner(), &rhs) + .into(); + output + } + fn div(_self: Val, rhs: Val) { + let output: Val = >::div(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn div(_self: Val, rhs: u32) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn dot(_self: Val, rhs: Val) { + let output: u32 = bevy::math::UVec4::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn dot_into_vec(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec4::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn element_product(_self: Val) { + let output: u32 = bevy::math::UVec4::element_product(_self.into_inner()).into(); + output + } + fn element_sum(_self: Val) { + let output: u32 = bevy::math::UVec4::element_sum(_self.into_inner()).into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn from_array(a: [u32; 4]) { + let output: Val = bevy::math::UVec4::from_array(a).into(); + output + } + fn length_squared(_self: Val) { + let output: u32 = bevy::math::UVec4::length_squared(_self.into_inner()).into(); + output + } + fn max(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec4::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn max_element(_self: Val) { + let output: u32 = bevy::math::UVec4::max_element(_self.into_inner()).into(); + output + } + fn min(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec4::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min_element(_self: Val) { + let output: u32 = bevy::math::UVec4::min_element(_self.into_inner()).into(); + output + } + fn mul(_self: Val, rhs: Ref) { + let output: Val = >::mul(_self.into_inner(), &rhs) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: u32) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn new(x: u32, y: u32, z: u32, w: u32) { + let output: Val = bevy::math::UVec4::new(x, y, z, w).into(); + output + } + fn rem(_self: Val, rhs: Ref) { + let output: Val = >::rem(_self.into_inner(), &rhs) + .into(); + output + } + fn rem(_self: Val, rhs: Val) { + let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn rem(_self: Val, rhs: u32) { + let output: Val = >::rem(_self.into_inner(), rhs) + .into(); + output + } + fn saturating_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec4::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_add_signed( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::UVec4::saturating_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec4::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec4::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec4::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) { + let output: Val = bevy::math::UVec4::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + fn splat(v: u32) { + let output: Val = bevy::math::UVec4::splat(v).into(); + output + } + fn sub(_self: Val, rhs: Ref) { + let output: Val = >::sub(_self.into_inner(), &rhs) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub(_self: Val, rhs: u32) { + let output: Val = >::sub(_self.into_inner(), rhs) + .into(); + output + } + fn to_array(_self: Ref) { + let output: [u32; 4] = bevy::math::UVec4::to_array(&_self).into(); + output + } + fn truncate(_self: Val) { + let output: Val = bevy::math::UVec4::truncate( + _self.into_inner(), + ) + .into(); + output + } + fn with_w(_self: Val, w: u32) { + let output: Val = bevy::math::UVec4::with_w( + _self.into_inner(), + w, + ) + .into(); + output + } + fn with_x(_self: Val, x: u32) { + let output: Val = bevy::math::UVec4::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + fn with_y(_self: Val, y: u32) { + let output: Val = bevy::math::UVec4::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + fn with_z(_self: Val, z: u32) { + let output: Val = bevy::math::UVec4::with_z( + _self.into_inner(), + z, + ) + .into(); + output + } + fn wrapping_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec4::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_add_signed(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec4::wrapping_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec4::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec4::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::UVec4::wrapping_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "u_64_vec_2")] +impl bevy::math::U64Vec2 { + fn add(_self: Val, rhs: Ref) { + let output: Val = >::add(_self.into_inner(), &rhs) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add(_self: Val, rhs: u64) { + let output: Val = >::add(_self.into_inner(), rhs) + .into(); + output + } + fn as_dvec2(_self: Ref) { + let output: Val = bevy::math::U64Vec2::as_dvec2(&_self) + .into(); + output + } + fn as_i64vec2(_self: Ref) { + let output: Val = bevy::math::U64Vec2::as_i64vec2(&_self) + .into(); + output + } + fn as_ivec2(_self: Ref) { + let output: Val = bevy::math::U64Vec2::as_ivec2(&_self) + .into(); + output + } + fn as_uvec2(_self: Ref) { + let output: Val = bevy::math::U64Vec2::as_uvec2(&_self) + .into(); + output + } + fn as_vec2(_self: Ref) { + let output: Val = bevy::math::U64Vec2::as_vec2(&_self).into(); + output + } + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clamp( + _self: Val, + min: Val, + max: Val, + ) { + let output: Val = bevy::math::U64Vec2::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn cmpeq(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec2::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpge(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec2::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpgt(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec2::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmple(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec2::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmplt(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec2::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpne(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec2::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn div(_self: Val, rhs: Ref) { + let output: Val = >::div(_self.into_inner(), &rhs) + .into(); + output + } + fn div(_self: Val, rhs: Val) { + let output: Val = >::div(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn div(_self: Val, rhs: u64) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn dot(_self: Val, rhs: Val) { + let output: u64 = bevy::math::U64Vec2::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn dot_into_vec(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec2::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn element_product(_self: Val) { + let output: u64 = bevy::math::U64Vec2::element_product(_self.into_inner()) + .into(); + output + } + fn element_sum(_self: Val) { + let output: u64 = bevy::math::U64Vec2::element_sum(_self.into_inner()).into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn extend(_self: Val, z: u64) { + let output: Val = bevy::math::U64Vec2::extend( + _self.into_inner(), + z, + ) + .into(); + output + } + fn from_array(a: [u64; 2]) { + let output: Val = bevy::math::U64Vec2::from_array(a).into(); + output + } + fn length_squared(_self: Val) { + let output: u64 = bevy::math::U64Vec2::length_squared(_self.into_inner()).into(); + output + } + fn max(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec2::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn max_element(_self: Val) { + let output: u64 = bevy::math::U64Vec2::max_element(_self.into_inner()).into(); + output + } + fn min(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec2::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min_element(_self: Val) { + let output: u64 = bevy::math::U64Vec2::min_element(_self.into_inner()).into(); + output + } + fn mul(_self: Val, rhs: Ref) { + let output: Val = >::mul(_self.into_inner(), &rhs) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: u64) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn new(x: u64, y: u64) { + let output: Val = bevy::math::U64Vec2::new(x, y).into(); + output + } + fn rem(_self: Val, rhs: Ref) { + let output: Val = >::rem(_self.into_inner(), &rhs) + .into(); + output + } + fn rem(_self: Val, rhs: Val) { + let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn rem(_self: Val, rhs: u64) { + let output: Val = >::rem(_self.into_inner(), rhs) + .into(); + output + } + fn saturating_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec2::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_add_signed( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::U64Vec2::saturating_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec2::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec2::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec2::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) { + let output: Val = bevy::math::U64Vec2::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + fn splat(v: u64) { + let output: Val = bevy::math::U64Vec2::splat(v).into(); + output + } + fn sub(_self: Val, rhs: Ref) { + let output: Val = >::sub(_self.into_inner(), &rhs) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub(_self: Val, rhs: u64) { + let output: Val = >::sub(_self.into_inner(), rhs) + .into(); + output + } + fn to_array(_self: Ref) { + let output: [u64; 2] = bevy::math::U64Vec2::to_array(&_self).into(); + output + } + fn with_x(_self: Val, x: u64) { + let output: Val = bevy::math::U64Vec2::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + fn with_y(_self: Val, y: u64) { + let output: Val = bevy::math::U64Vec2::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + fn wrapping_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec2::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_add_signed( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::U64Vec2::wrapping_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec2::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec2::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec2::wrapping_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "u_64_vec_3")] +impl bevy::math::U64Vec3 { + fn add(_self: Val, rhs: Ref) { + let output: Val = >::add(_self.into_inner(), &rhs) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add(_self: Val, rhs: u64) { + let output: Val = >::add(_self.into_inner(), rhs) + .into(); + output + } + fn as_dvec3(_self: Ref) { + let output: Val = bevy::math::U64Vec3::as_dvec3(&_self) + .into(); + output + } + fn as_i64vec3(_self: Ref) { + let output: Val = bevy::math::U64Vec3::as_i64vec3(&_self) + .into(); + output + } + fn as_ivec3(_self: Ref) { + let output: Val = bevy::math::U64Vec3::as_ivec3(&_self) + .into(); + output + } + fn as_uvec3(_self: Ref) { + let output: Val = bevy::math::U64Vec3::as_uvec3(&_self) + .into(); + output + } + fn as_vec3(_self: Ref) { + let output: Val = bevy::math::U64Vec3::as_vec3(&_self).into(); + output + } + fn as_vec3a(_self: Ref) { + let output: Val = bevy::math::U64Vec3::as_vec3a(&_self) + .into(); + output + } + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clamp( + _self: Val, + min: Val, + max: Val, + ) { + let output: Val = bevy::math::U64Vec3::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn cmpeq(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec3::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpge(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec3::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpgt(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec3::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmple(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec3::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmplt(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec3::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpne(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec3::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cross(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec3::cross( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn div(_self: Val, rhs: Ref) { + let output: Val = >::div(_self.into_inner(), &rhs) + .into(); + output + } + fn div(_self: Val, rhs: Val) { + let output: Val = >::div(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn div(_self: Val, rhs: u64) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn dot(_self: Val, rhs: Val) { + let output: u64 = bevy::math::U64Vec3::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn dot_into_vec(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec3::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn element_product(_self: Val) { + let output: u64 = bevy::math::U64Vec3::element_product(_self.into_inner()) + .into(); + output + } + fn element_sum(_self: Val) { + let output: u64 = bevy::math::U64Vec3::element_sum(_self.into_inner()).into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn extend(_self: Val, w: u64) { + let output: Val = bevy::math::U64Vec3::extend( + _self.into_inner(), + w, + ) + .into(); + output + } + fn from_array(a: [u64; 3]) { + let output: Val = bevy::math::U64Vec3::from_array(a).into(); + output + } + fn length_squared(_self: Val) { + let output: u64 = bevy::math::U64Vec3::length_squared(_self.into_inner()).into(); + output + } + fn max(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec3::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn max_element(_self: Val) { + let output: u64 = bevy::math::U64Vec3::max_element(_self.into_inner()).into(); + output + } + fn min(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec3::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min_element(_self: Val) { + let output: u64 = bevy::math::U64Vec3::min_element(_self.into_inner()).into(); + output + } + fn mul(_self: Val, rhs: Ref) { + let output: Val = >::mul(_self.into_inner(), &rhs) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: u64) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn new(x: u64, y: u64, z: u64) { + let output: Val = bevy::math::U64Vec3::new(x, y, z).into(); + output + } + fn rem(_self: Val, rhs: Ref) { + let output: Val = >::rem(_self.into_inner(), &rhs) + .into(); + output + } + fn rem(_self: Val, rhs: Val) { + let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn rem(_self: Val, rhs: u64) { + let output: Val = >::rem(_self.into_inner(), rhs) + .into(); + output + } + fn saturating_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec3::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_add_signed( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::U64Vec3::saturating_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec3::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec3::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec3::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) { + let output: Val = bevy::math::U64Vec3::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + fn splat(v: u64) { + let output: Val = bevy::math::U64Vec3::splat(v).into(); + output + } + fn sub(_self: Val, rhs: Ref) { + let output: Val = >::sub(_self.into_inner(), &rhs) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub(_self: Val, rhs: u64) { + let output: Val = >::sub(_self.into_inner(), rhs) + .into(); + output + } + fn to_array(_self: Ref) { + let output: [u64; 3] = bevy::math::U64Vec3::to_array(&_self).into(); + output + } + fn truncate(_self: Val) { + let output: Val = bevy::math::U64Vec3::truncate( + _self.into_inner(), + ) + .into(); + output + } + fn with_x(_self: Val, x: u64) { + let output: Val = bevy::math::U64Vec3::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + fn with_y(_self: Val, y: u64) { + let output: Val = bevy::math::U64Vec3::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + fn with_z(_self: Val, z: u64) { + let output: Val = bevy::math::U64Vec3::with_z( + _self.into_inner(), + z, + ) + .into(); + output + } + fn wrapping_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec3::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_add_signed( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::U64Vec3::wrapping_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec3::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec3::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec3::wrapping_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "u_64_vec_4")] +impl bevy::math::U64Vec4 { + fn add(_self: Val, rhs: Ref) { + let output: Val = >::add(_self.into_inner(), &rhs) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add(_self: Val, rhs: u64) { + let output: Val = >::add(_self.into_inner(), rhs) + .into(); + output + } + fn as_dvec4(_self: Ref) { + let output: Val = bevy::math::U64Vec4::as_dvec4(&_self) + .into(); + output + } + fn as_i64vec4(_self: Ref) { + let output: Val = bevy::math::U64Vec4::as_i64vec4(&_self) + .into(); + output + } + fn as_ivec4(_self: Ref) { + let output: Val = bevy::math::U64Vec4::as_ivec4(&_self) + .into(); + output + } + fn as_uvec4(_self: Ref) { + let output: Val = bevy::math::U64Vec4::as_uvec4(&_self) + .into(); + output + } + fn as_vec4(_self: Ref) { + let output: Val = bevy::math::U64Vec4::as_vec4(&_self).into(); + output + } + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clamp( + _self: Val, + min: Val, + max: Val, + ) { + let output: Val = bevy::math::U64Vec4::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn cmpeq(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec4::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpge(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec4::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpgt(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec4::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmple(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec4::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmplt(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec4::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpne(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec4::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn div(_self: Val, rhs: Ref) { + let output: Val = >::div(_self.into_inner(), &rhs) + .into(); + output + } + fn div(_self: Val, rhs: Val) { + let output: Val = >::div(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn div(_self: Val, rhs: u64) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn dot(_self: Val, rhs: Val) { + let output: u64 = bevy::math::U64Vec4::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn dot_into_vec(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec4::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn element_product(_self: Val) { + let output: u64 = bevy::math::U64Vec4::element_product(_self.into_inner()) + .into(); + output + } + fn element_sum(_self: Val) { + let output: u64 = bevy::math::U64Vec4::element_sum(_self.into_inner()).into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn from_array(a: [u64; 4]) { + let output: Val = bevy::math::U64Vec4::from_array(a).into(); + output + } + fn length_squared(_self: Val) { + let output: u64 = bevy::math::U64Vec4::length_squared(_self.into_inner()).into(); + output + } + fn max(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec4::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn max_element(_self: Val) { + let output: u64 = bevy::math::U64Vec4::max_element(_self.into_inner()).into(); + output + } + fn min(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec4::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min_element(_self: Val) { + let output: u64 = bevy::math::U64Vec4::min_element(_self.into_inner()).into(); + output + } + fn mul(_self: Val, rhs: Ref) { + let output: Val = >::mul(_self.into_inner(), &rhs) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: u64) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn new(x: u64, y: u64, z: u64, w: u64) { + let output: Val = bevy::math::U64Vec4::new(x, y, z, w) + .into(); + output + } + fn rem(_self: Val, rhs: Ref) { + let output: Val = >::rem(_self.into_inner(), &rhs) + .into(); + output + } + fn rem(_self: Val, rhs: Val) { + let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn rem(_self: Val, rhs: u64) { + let output: Val = >::rem(_self.into_inner(), rhs) + .into(); + output + } + fn saturating_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec4::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_add_signed( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::U64Vec4::saturating_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec4::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec4::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn saturating_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec4::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) { + let output: Val = bevy::math::U64Vec4::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + fn splat(v: u64) { + let output: Val = bevy::math::U64Vec4::splat(v).into(); + output + } + fn sub(_self: Val, rhs: Ref) { + let output: Val = >::sub(_self.into_inner(), &rhs) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub(_self: Val, rhs: u64) { + let output: Val = >::sub(_self.into_inner(), rhs) + .into(); + output + } + fn to_array(_self: Ref) { + let output: [u64; 4] = bevy::math::U64Vec4::to_array(&_self).into(); + output + } + fn truncate(_self: Val) { + let output: Val = bevy::math::U64Vec4::truncate( + _self.into_inner(), + ) + .into(); + output + } + fn with_w(_self: Val, w: u64) { + let output: Val = bevy::math::U64Vec4::with_w( + _self.into_inner(), + w, + ) + .into(); + output + } + fn with_x(_self: Val, x: u64) { + let output: Val = bevy::math::U64Vec4::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + fn with_y(_self: Val, y: u64) { + let output: Val = bevy::math::U64Vec4::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + fn with_z(_self: Val, z: u64) { + let output: Val = bevy::math::U64Vec4::with_z( + _self.into_inner(), + z, + ) + .into(); + output + } + fn wrapping_add(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec4::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_add_signed( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::U64Vec4::wrapping_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_div(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec4::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_mul(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec4::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn wrapping_sub(_self: Val, rhs: Val) { + let output: Val = bevy::math::U64Vec4::wrapping_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "vec_2")] +impl bevy::math::Vec2 { + fn abs(_self: Val) { + let output: Val = bevy::math::Vec2::abs(_self.into_inner()) + .into(); + output + } + fn abs_diff_eq( + _self: Val, + rhs: Val, + max_abs_diff: f32, + ) { + let output: bool = bevy::math::Vec2::abs_diff_eq( + _self.into_inner(), + rhs.into_inner(), + max_abs_diff, + ) + .into(); + output + } + fn add(_self: Val, rhs: Ref) { + let output: Val = >::add(_self.into_inner(), &rhs) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add(_self: Val, rhs: f32) { + let output: Val = >::add(_self.into_inner(), rhs) + .into(); + output + } + fn angle_between(_self: Val, rhs: Val) { + let output: f32 = bevy::math::Vec2::angle_between( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn angle_to(_self: Val, rhs: Val) { + let output: f32 = bevy::math::Vec2::angle_to( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn as_dvec2(_self: Ref) { + let output: Val = bevy::math::Vec2::as_dvec2(&_self).into(); + output + } + fn as_i64vec2(_self: Ref) { + let output: Val = bevy::math::Vec2::as_i64vec2(&_self) + .into(); + output + } + fn as_ivec2(_self: Ref) { + let output: Val = bevy::math::Vec2::as_ivec2(&_self).into(); + output + } + fn as_u64vec2(_self: Ref) { + let output: Val = bevy::math::Vec2::as_u64vec2(&_self) + .into(); + output + } + fn as_uvec2(_self: Ref) { + let output: Val = bevy::math::Vec2::as_uvec2(&_self).into(); + output + } + fn ceil(_self: Val) { + let output: Val = bevy::math::Vec2::ceil(_self.into_inner()) + .into(); + output + } + fn clamp( + _self: Val, + min: Val, + max: Val, + ) { + let output: Val = bevy::math::Vec2::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + fn clamp_length(_self: Val, min: f32, max: f32) { + let output: Val = bevy::math::Vec2::clamp_length( + _self.into_inner(), + min, + max, + ) + .into(); + output + } + fn clamp_length_max(_self: Val, max: f32) { + let output: Val = bevy::math::Vec2::clamp_length_max( + _self.into_inner(), + max, + ) + .into(); + output + } + fn clamp_length_min(_self: Val, min: f32) { + let output: Val = bevy::math::Vec2::clamp_length_min( + _self.into_inner(), + min, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn cmpeq(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec2::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpge(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec2::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpgt(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec2::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmple(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec2::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmplt(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec2::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpne(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec2::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn copysign(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec2::copysign( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn distance(_self: Val, rhs: Val) { + let output: f32 = bevy::math::Vec2::distance( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn distance_squared(_self: Val, rhs: Val) { + let output: f32 = bevy::math::Vec2::distance_squared( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn div(_self: Val, rhs: Ref) { + let output: Val = >::div(_self.into_inner(), &rhs) + .into(); + output + } + fn div(_self: Val, rhs: Val) { + let output: Val = >::div(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn div(_self: Val, rhs: f32) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn div_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec2::div_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn dot(_self: Val, rhs: Val) { + let output: f32 = bevy::math::Vec2::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn dot_into_vec(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec2::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn element_product(_self: Val) { + let output: f32 = bevy::math::Vec2::element_product(_self.into_inner()).into(); + output + } + fn element_sum(_self: Val) { + let output: f32 = bevy::math::Vec2::element_sum(_self.into_inner()).into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn exp(_self: Val) { + let output: Val = bevy::math::Vec2::exp(_self.into_inner()) + .into(); + output + } + fn extend(_self: Val, z: f32) { + let output: Val = bevy::math::Vec2::extend( + _self.into_inner(), + z, + ) + .into(); + output + } + fn floor(_self: Val) { + let output: Val = bevy::math::Vec2::floor(_self.into_inner()) + .into(); + output + } + fn fract(_self: Val) { + let output: Val = bevy::math::Vec2::fract(_self.into_inner()) + .into(); + output + } + fn fract_gl(_self: Val) { + let output: Val = bevy::math::Vec2::fract_gl( + _self.into_inner(), + ) + .into(); + output + } + fn from_angle(angle: f32) { + let output: Val = bevy::math::Vec2::from_angle(angle).into(); + output + } + fn from_array(a: [f32; 2]) { + let output: Val = bevy::math::Vec2::from_array(a).into(); + output + } + fn is_finite(_self: Val) { + let output: bool = bevy::math::Vec2::is_finite(_self.into_inner()).into(); + output + } + fn is_finite_mask(_self: Val) { + let output: Val = bevy::math::Vec2::is_finite_mask( + _self.into_inner(), + ) + .into(); + output + } + fn is_nan(_self: Val) { + let output: bool = bevy::math::Vec2::is_nan(_self.into_inner()).into(); + output + } + fn is_nan_mask(_self: Val) { + let output: Val = bevy::math::Vec2::is_nan_mask( + _self.into_inner(), + ) + .into(); + output + } + fn is_negative_bitmask(_self: Val) { + let output: u32 = bevy::math::Vec2::is_negative_bitmask(_self.into_inner()) + .into(); + output + } + fn is_normalized(_self: Val) { + let output: bool = bevy::math::Vec2::is_normalized(_self.into_inner()).into(); + output + } + fn length(_self: Val) { + let output: f32 = bevy::math::Vec2::length(_self.into_inner()).into(); + output + } + fn length_recip(_self: Val) { + let output: f32 = bevy::math::Vec2::length_recip(_self.into_inner()).into(); + output + } + fn length_squared(_self: Val) { + let output: f32 = bevy::math::Vec2::length_squared(_self.into_inner()).into(); + output + } + fn lerp(_self: Val, rhs: Val, s: f32) { + let output: Val = bevy::math::Vec2::lerp( + _self.into_inner(), + rhs.into_inner(), + s, + ) + .into(); + output + } + fn max(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec2::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn max_element(_self: Val) { + let output: f32 = bevy::math::Vec2::max_element(_self.into_inner()).into(); + output + } + fn midpoint(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec2::midpoint( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec2::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min_element(_self: Val) { + let output: f32 = bevy::math::Vec2::min_element(_self.into_inner()).into(); + output + } + fn move_towards(_self: Ref, rhs: Val, d: f32) { + let output: Val = bevy::math::Vec2::move_towards( + &_self, + rhs.into_inner(), + d, + ) + .into(); + output + } + fn mul(_self: Val, rhs: Ref) { + let output: Val = >::mul(_self.into_inner(), &rhs) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: f32) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn mul_add( + _self: Val, + a: Val, + b: Val, + ) { + let output: Val = bevy::math::Vec2::mul_add( + _self.into_inner(), + a.into_inner(), + b.into_inner(), + ) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn new(x: f32, y: f32) { + let output: Val = bevy::math::Vec2::new(x, y).into(); + output + } + fn normalize(_self: Val) { + let output: Val = bevy::math::Vec2::normalize( + _self.into_inner(), + ) + .into(); + output + } + fn normalize_or(_self: Val, fallback: Val) { + let output: Val = bevy::math::Vec2::normalize_or( + _self.into_inner(), + fallback.into_inner(), + ) + .into(); + output + } + fn normalize_or_zero(_self: Val) { + let output: Val = bevy::math::Vec2::normalize_or_zero( + _self.into_inner(), + ) + .into(); + output + } + fn perp(_self: Val) { + let output: Val = bevy::math::Vec2::perp(_self.into_inner()) + .into(); + output + } + fn perp_dot(_self: Val, rhs: Val) { + let output: f32 = bevy::math::Vec2::perp_dot( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn powf(_self: Val, n: f32) { + let output: Val = bevy::math::Vec2::powf(_self.into_inner(), n) + .into(); + output + } + fn project_onto(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec2::project_onto( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn project_onto_normalized( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::Vec2::project_onto_normalized( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn recip(_self: Val) { + let output: Val = bevy::math::Vec2::recip(_self.into_inner()) + .into(); + output + } + fn reflect(_self: Val, normal: Val) { + let output: Val = bevy::math::Vec2::reflect( + _self.into_inner(), + normal.into_inner(), + ) + .into(); + output + } + fn refract(_self: Val, normal: Val, eta: f32) { + let output: Val = bevy::math::Vec2::refract( + _self.into_inner(), + normal.into_inner(), + eta, + ) + .into(); + output + } + fn reject_from(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec2::reject_from( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn reject_from_normalized(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec2::reject_from_normalized( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn rem(_self: Val, rhs: Ref) { + let output: Val = >::rem(_self.into_inner(), &rhs) + .into(); + output + } + fn rem(_self: Val, rhs: Val) { + let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn rem(_self: Val, rhs: f32) { + let output: Val = >::rem(_self.into_inner(), rhs) + .into(); + output + } + fn rem_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec2::rem_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn rotate(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec2::rotate( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn rotate_towards( + _self: Ref, + rhs: Val, + max_angle: f32, + ) { + let output: Val = bevy::math::Vec2::rotate_towards( + &_self, + rhs.into_inner(), + max_angle, + ) + .into(); + output + } + fn round(_self: Val) { + let output: Val = bevy::math::Vec2::round(_self.into_inner()) + .into(); + output + } + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) { + let output: Val = bevy::math::Vec2::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + fn signum(_self: Val) { + let output: Val = bevy::math::Vec2::signum(_self.into_inner()) + .into(); + output + } + fn splat(v: f32) { + let output: Val = bevy::math::Vec2::splat(v).into(); + output + } + fn sub(_self: Val, rhs: Ref) { + let output: Val = >::sub(_self.into_inner(), &rhs) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub(_self: Val, rhs: f32) { + let output: Val = >::sub(_self.into_inner(), rhs) + .into(); + output + } + fn to_angle(_self: Val) { + let output: f32 = bevy::math::Vec2::to_angle(_self.into_inner()).into(); + output + } + fn to_array(_self: Ref) { + let output: [f32; 2] = bevy::math::Vec2::to_array(&_self).into(); + output + } + fn trunc(_self: Val) { + let output: Val = bevy::math::Vec2::trunc(_self.into_inner()) + .into(); + output + } + fn with_x(_self: Val, x: f32) { + let output: Val = bevy::math::Vec2::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + fn with_y(_self: Val, y: f32) { + let output: Val = bevy::math::Vec2::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "vec_3_a")] +impl bevy::math::Vec3A { + fn abs(_self: Val) { + let output: Val = bevy::math::Vec3A::abs(_self.into_inner()) + .into(); + output + } + fn abs_diff_eq( + _self: Val, + rhs: Val, + max_abs_diff: f32, + ) { + let output: bool = bevy::math::Vec3A::abs_diff_eq( + _self.into_inner(), + rhs.into_inner(), + max_abs_diff, + ) + .into(); + output + } + fn add(_self: Val, rhs: Ref) { + let output: Val = >::add(_self.into_inner(), &rhs) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add(_self: Val, rhs: f32) { + let output: Val = >::add(_self.into_inner(), rhs) + .into(); + output + } + fn angle_between(_self: Val, rhs: Val) { + let output: f32 = bevy::math::Vec3A::angle_between( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn any_orthogonal_vector(_self: Ref) { + let output: Val = bevy::math::Vec3A::any_orthogonal_vector( + &_self, + ) + .into(); + output + } + fn any_orthonormal_vector(_self: Ref) { + let output: Val = bevy::math::Vec3A::any_orthonormal_vector( + &_self, + ) + .into(); + output + } + fn as_dvec3(_self: Ref) { + let output: Val = bevy::math::Vec3A::as_dvec3(&_self).into(); + output + } + fn as_i64vec3(_self: Ref) { + let output: Val = bevy::math::Vec3A::as_i64vec3(&_self) + .into(); + output + } + fn as_ivec3(_self: Ref) { + let output: Val = bevy::math::Vec3A::as_ivec3(&_self).into(); + output + } + fn as_u64vec3(_self: Ref) { + let output: Val = bevy::math::Vec3A::as_u64vec3(&_self) + .into(); + output + } + fn as_uvec3(_self: Ref) { + let output: Val = bevy::math::Vec3A::as_uvec3(&_self).into(); + output + } + fn ceil(_self: Val) { + let output: Val = bevy::math::Vec3A::ceil(_self.into_inner()) + .into(); + output + } + fn clamp( + _self: Val, + min: Val, + max: Val, + ) { + let output: Val = bevy::math::Vec3A::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + fn clamp_length(_self: Val, min: f32, max: f32) { + let output: Val = bevy::math::Vec3A::clamp_length( + _self.into_inner(), + min, + max, + ) + .into(); + output + } + fn clamp_length_max(_self: Val, max: f32) { + let output: Val = bevy::math::Vec3A::clamp_length_max( + _self.into_inner(), + max, + ) + .into(); + output + } + fn clamp_length_min(_self: Val, min: f32) { + let output: Val = bevy::math::Vec3A::clamp_length_min( + _self.into_inner(), + min, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn cmpeq(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3A::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpge(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3A::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpgt(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3A::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmple(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3A::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmplt(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3A::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpne(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3A::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn copysign(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3A::copysign( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cross(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3A::cross( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn distance(_self: Val, rhs: Val) { + let output: f32 = bevy::math::Vec3A::distance( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn distance_squared(_self: Val, rhs: Val) { + let output: f32 = bevy::math::Vec3A::distance_squared( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn div(_self: Val, rhs: Ref) { + let output: Val = >::div(_self.into_inner(), &rhs) + .into(); + output + } + fn div(_self: Val, rhs: Val) { + let output: Val = >::div(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn div(_self: Val, rhs: f32) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn div_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3A::div_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn dot(_self: Val, rhs: Val) { + let output: f32 = bevy::math::Vec3A::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn dot_into_vec(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3A::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn element_product(_self: Val) { + let output: f32 = bevy::math::Vec3A::element_product(_self.into_inner()).into(); + output + } + fn element_sum(_self: Val) { + let output: f32 = bevy::math::Vec3A::element_sum(_self.into_inner()).into(); + output + } + fn eq(_self: Ref, rhs: Ref) { + let output: bool = >::eq(&_self, &rhs) + .into(); + output + } + fn exp(_self: Val) { + let output: Val = bevy::math::Vec3A::exp(_self.into_inner()) + .into(); + output + } + fn extend(_self: Val, w: f32) { + let output: Val = bevy::math::Vec3A::extend( + _self.into_inner(), + w, + ) + .into(); + output + } + fn floor(_self: Val) { + let output: Val = bevy::math::Vec3A::floor(_self.into_inner()) + .into(); + output + } + fn fract(_self: Val) { + let output: Val = bevy::math::Vec3A::fract(_self.into_inner()) + .into(); + output + } + fn fract_gl(_self: Val) { + let output: Val = bevy::math::Vec3A::fract_gl( + _self.into_inner(), + ) + .into(); + output + } + fn from_array(a: [f32; 3]) { + let output: Val = bevy::math::Vec3A::from_array(a).into(); + output + } + fn from_vec4(v: Val) { + let output: Val = bevy::math::Vec3A::from_vec4(v.into_inner()) + .into(); + output + } + fn is_finite(_self: Val) { + let output: bool = bevy::math::Vec3A::is_finite(_self.into_inner()).into(); + output + } + fn is_finite_mask(_self: Val) { + let output: Val = bevy::math::Vec3A::is_finite_mask( + _self.into_inner(), + ) + .into(); + output + } + fn is_nan(_self: Val) { + let output: bool = bevy::math::Vec3A::is_nan(_self.into_inner()).into(); + output + } + fn is_nan_mask(_self: Val) { + let output: Val = bevy::math::Vec3A::is_nan_mask( + _self.into_inner(), + ) + .into(); + output + } + fn is_negative_bitmask(_self: Val) { + let output: u32 = bevy::math::Vec3A::is_negative_bitmask(_self.into_inner()) + .into(); + output + } + fn is_normalized(_self: Val) { + let output: bool = bevy::math::Vec3A::is_normalized(_self.into_inner()).into(); + output + } + fn length(_self: Val) { + let output: f32 = bevy::math::Vec3A::length(_self.into_inner()).into(); + output + } + fn length_recip(_self: Val) { + let output: f32 = bevy::math::Vec3A::length_recip(_self.into_inner()).into(); + output + } + fn length_squared(_self: Val) { + let output: f32 = bevy::math::Vec3A::length_squared(_self.into_inner()).into(); + output + } + fn lerp(_self: Val, rhs: Val, s: f32) { + let output: Val = bevy::math::Vec3A::lerp( + _self.into_inner(), + rhs.into_inner(), + s, + ) + .into(); + output + } + fn max(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3A::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn max_element(_self: Val) { + let output: f32 = bevy::math::Vec3A::max_element(_self.into_inner()).into(); + output + } + fn midpoint(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3A::midpoint( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3A::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min_element(_self: Val) { + let output: f32 = bevy::math::Vec3A::min_element(_self.into_inner()).into(); + output + } + fn move_towards(_self: Ref, rhs: Val, d: f32) { + let output: Val = bevy::math::Vec3A::move_towards( + &_self, + rhs.into_inner(), + d, + ) + .into(); + output + } + fn mul(_self: Val, rhs: Ref) { + let output: Val = >::mul(_self.into_inner(), &rhs) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: f32) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn mul_add( + _self: Val, + a: Val, + b: Val, + ) { + let output: Val = bevy::math::Vec3A::mul_add( + _self.into_inner(), + a.into_inner(), + b.into_inner(), + ) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn new(x: f32, y: f32, z: f32) { + let output: Val = bevy::math::Vec3A::new(x, y, z).into(); + output + } + fn normalize(_self: Val) { + let output: Val = bevy::math::Vec3A::normalize( + _self.into_inner(), + ) + .into(); + output + } + fn normalize_or(_self: Val, fallback: Val) { + let output: Val = bevy::math::Vec3A::normalize_or( + _self.into_inner(), + fallback.into_inner(), + ) + .into(); + output + } + fn normalize_or_zero(_self: Val) { + let output: Val = bevy::math::Vec3A::normalize_or_zero( + _self.into_inner(), + ) + .into(); + output + } + fn powf(_self: Val, n: f32) { + let output: Val = bevy::math::Vec3A::powf( + _self.into_inner(), + n, + ) + .into(); + output + } + fn project_onto(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3A::project_onto( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn project_onto_normalized( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::Vec3A::project_onto_normalized( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn recip(_self: Val) { + let output: Val = bevy::math::Vec3A::recip(_self.into_inner()) + .into(); + output + } + fn reflect(_self: Val, normal: Val) { + let output: Val = bevy::math::Vec3A::reflect( + _self.into_inner(), + normal.into_inner(), + ) + .into(); + output + } + fn refract(_self: Val, normal: Val, eta: f32) { + let output: Val = bevy::math::Vec3A::refract( + _self.into_inner(), + normal.into_inner(), + eta, + ) + .into(); + output + } + fn reject_from(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3A::reject_from( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn reject_from_normalized( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::Vec3A::reject_from_normalized( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn rem(_self: Val, rhs: Ref) { + let output: Val = >::rem(_self.into_inner(), &rhs) + .into(); + output + } + fn rem(_self: Val, rhs: Val) { + let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn rem(_self: Val, rhs: f32) { + let output: Val = >::rem(_self.into_inner(), rhs) + .into(); + output + } + fn rem_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec3A::rem_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn round(_self: Val) { + let output: Val = bevy::math::Vec3A::round(_self.into_inner()) + .into(); + output + } + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) { + let output: Val = bevy::math::Vec3A::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + fn signum(_self: Val) { + let output: Val = bevy::math::Vec3A::signum( + _self.into_inner(), + ) + .into(); + output + } + fn splat(v: f32) { + let output: Val = bevy::math::Vec3A::splat(v).into(); + output + } + fn sub(_self: Val, rhs: Ref) { + let output: Val = >::sub(_self.into_inner(), &rhs) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub(_self: Val, rhs: f32) { + let output: Val = >::sub(_self.into_inner(), rhs) + .into(); + output + } + fn to_array(_self: Ref) { + let output: [f32; 3] = bevy::math::Vec3A::to_array(&_self).into(); + output + } + fn trunc(_self: Val) { + let output: Val = bevy::math::Vec3A::trunc(_self.into_inner()) + .into(); + output + } + fn truncate(_self: Val) { + let output: Val = bevy::math::Vec3A::truncate( + _self.into_inner(), + ) + .into(); + output + } + fn with_x(_self: Val, x: f32) { + let output: Val = bevy::math::Vec3A::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + fn with_y(_self: Val, y: f32) { + let output: Val = bevy::math::Vec3A::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + fn with_z(_self: Val, z: f32) { + let output: Val = bevy::math::Vec3A::with_z( + _self.into_inner(), + z, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "vec_4")] +impl bevy::math::Vec4 { + fn abs(_self: Val) { + let output: Val = bevy::math::Vec4::abs(_self.into_inner()) + .into(); + output + } + fn abs_diff_eq( + _self: Val, + rhs: Val, + max_abs_diff: f32, + ) { + let output: bool = bevy::math::Vec4::abs_diff_eq( + _self.into_inner(), + rhs.into_inner(), + max_abs_diff, + ) + .into(); + output + } + fn add(_self: Val, rhs: Ref) { + let output: Val = >::add(_self.into_inner(), &rhs) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add(_self: Val, rhs: f32) { + let output: Val = >::add(_self.into_inner(), rhs) + .into(); + output + } + fn as_dvec4(_self: Ref) { + let output: Val = bevy::math::Vec4::as_dvec4(&_self).into(); + output + } + fn as_i64vec4(_self: Ref) { + let output: Val = bevy::math::Vec4::as_i64vec4(&_self) + .into(); + output + } + fn as_ivec4(_self: Ref) { + let output: Val = bevy::math::Vec4::as_ivec4(&_self).into(); + output + } + fn as_u64vec4(_self: Ref) { + let output: Val = bevy::math::Vec4::as_u64vec4(&_self) + .into(); + output + } + fn as_uvec4(_self: Ref) { + let output: Val = bevy::math::Vec4::as_uvec4(&_self).into(); + output + } + fn ceil(_self: Val) { + let output: Val = bevy::math::Vec4::ceil(_self.into_inner()) + .into(); + output + } + fn clamp( + _self: Val, + min: Val, + max: Val, + ) { + let output: Val = bevy::math::Vec4::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + fn clamp_length(_self: Val, min: f32, max: f32) { + let output: Val = bevy::math::Vec4::clamp_length( + _self.into_inner(), + min, + max, + ) + .into(); + output + } + fn clamp_length_max(_self: Val, max: f32) { + let output: Val = bevy::math::Vec4::clamp_length_max( + _self.into_inner(), + max, + ) + .into(); + output + } + fn clamp_length_min(_self: Val, min: f32) { + let output: Val = bevy::math::Vec4::clamp_length_min( + _self.into_inner(), + min, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn cmpeq(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec4::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpge(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec4::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpgt(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec4::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmple(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec4::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmplt(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec4::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpne(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec4::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn copysign(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec4::copysign( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn distance(_self: Val, rhs: Val) { + let output: f32 = bevy::math::Vec4::distance( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn distance_squared(_self: Val, rhs: Val) { + let output: f32 = bevy::math::Vec4::distance_squared( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn div(_self: Val, rhs: Ref) { + let output: Val = >::div(_self.into_inner(), &rhs) + .into(); + output + } + fn div(_self: Val, rhs: Val) { + let output: Val = >::div(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn div(_self: Val, rhs: f32) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn div_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec4::div_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn dot(_self: Val, rhs: Val) { + let output: f32 = bevy::math::Vec4::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn dot_into_vec(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec4::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn element_product(_self: Val) { + let output: f32 = bevy::math::Vec4::element_product(_self.into_inner()).into(); + output + } + fn element_sum(_self: Val) { + let output: f32 = bevy::math::Vec4::element_sum(_self.into_inner()).into(); + output + } + fn eq(_self: Ref, rhs: Ref) { + let output: bool = >::eq(&_self, &rhs) + .into(); + output + } + fn exp(_self: Val) { + let output: Val = bevy::math::Vec4::exp(_self.into_inner()) + .into(); + output + } + fn floor(_self: Val) { + let output: Val = bevy::math::Vec4::floor(_self.into_inner()) + .into(); + output + } + fn fract(_self: Val) { + let output: Val = bevy::math::Vec4::fract(_self.into_inner()) + .into(); + output + } + fn fract_gl(_self: Val) { + let output: Val = bevy::math::Vec4::fract_gl( + _self.into_inner(), + ) + .into(); + output + } + fn from_array(a: [f32; 4]) { + let output: Val = bevy::math::Vec4::from_array(a).into(); + output + } + fn is_finite(_self: Val) { + let output: bool = bevy::math::Vec4::is_finite(_self.into_inner()).into(); + output + } + fn is_finite_mask(_self: Val) { + let output: Val = bevy::math::Vec4::is_finite_mask( + _self.into_inner(), + ) + .into(); + output + } + fn is_nan(_self: Val) { + let output: bool = bevy::math::Vec4::is_nan(_self.into_inner()).into(); + output + } + fn is_nan_mask(_self: Val) { + let output: Val = bevy::math::Vec4::is_nan_mask( + _self.into_inner(), + ) + .into(); + output + } + fn is_negative_bitmask(_self: Val) { + let output: u32 = bevy::math::Vec4::is_negative_bitmask(_self.into_inner()) + .into(); + output + } + fn is_normalized(_self: Val) { + let output: bool = bevy::math::Vec4::is_normalized(_self.into_inner()).into(); + output + } + fn length(_self: Val) { + let output: f32 = bevy::math::Vec4::length(_self.into_inner()).into(); + output + } + fn length_recip(_self: Val) { + let output: f32 = bevy::math::Vec4::length_recip(_self.into_inner()).into(); + output + } + fn length_squared(_self: Val) { + let output: f32 = bevy::math::Vec4::length_squared(_self.into_inner()).into(); + output + } + fn lerp(_self: Val, rhs: Val, s: f32) { + let output: Val = bevy::math::Vec4::lerp( + _self.into_inner(), + rhs.into_inner(), + s, + ) + .into(); + output + } + fn max(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec4::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn max_element(_self: Val) { + let output: f32 = bevy::math::Vec4::max_element(_self.into_inner()).into(); + output + } + fn midpoint(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec4::midpoint( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec4::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min_element(_self: Val) { + let output: f32 = bevy::math::Vec4::min_element(_self.into_inner()).into(); + output + } + fn move_towards(_self: Ref, rhs: Val, d: f32) { + let output: Val = bevy::math::Vec4::move_towards( + &_self, + rhs.into_inner(), + d, + ) + .into(); + output + } + fn mul(_self: Val, rhs: Ref) { + let output: Val = >::mul(_self.into_inner(), &rhs) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: f32) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn mul_add( + _self: Val, + a: Val, + b: Val, + ) { + let output: Val = bevy::math::Vec4::mul_add( + _self.into_inner(), + a.into_inner(), + b.into_inner(), + ) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn new(x: f32, y: f32, z: f32, w: f32) { + let output: Val = bevy::math::Vec4::new(x, y, z, w).into(); + output + } + fn normalize(_self: Val) { + let output: Val = bevy::math::Vec4::normalize( + _self.into_inner(), + ) + .into(); + output + } + fn normalize_or(_self: Val, fallback: Val) { + let output: Val = bevy::math::Vec4::normalize_or( + _self.into_inner(), + fallback.into_inner(), + ) + .into(); + output + } + fn normalize_or_zero(_self: Val) { + let output: Val = bevy::math::Vec4::normalize_or_zero( + _self.into_inner(), + ) + .into(); + output + } + fn powf(_self: Val, n: f32) { + let output: Val = bevy::math::Vec4::powf(_self.into_inner(), n) + .into(); + output + } + fn project_onto(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec4::project_onto( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn project_onto_normalized( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::Vec4::project_onto_normalized( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn recip(_self: Val) { + let output: Val = bevy::math::Vec4::recip(_self.into_inner()) + .into(); + output + } + fn reflect(_self: Val, normal: Val) { + let output: Val = bevy::math::Vec4::reflect( + _self.into_inner(), + normal.into_inner(), + ) + .into(); + output + } + fn refract(_self: Val, normal: Val, eta: f32) { + let output: Val = bevy::math::Vec4::refract( + _self.into_inner(), + normal.into_inner(), + eta, + ) + .into(); + output + } + fn reject_from(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec4::reject_from( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn reject_from_normalized(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec4::reject_from_normalized( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn rem(_self: Val, rhs: Ref) { + let output: Val = >::rem(_self.into_inner(), &rhs) + .into(); + output + } + fn rem(_self: Val, rhs: Val) { + let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn rem(_self: Val, rhs: f32) { + let output: Val = >::rem(_self.into_inner(), rhs) + .into(); + output + } + fn rem_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::Vec4::rem_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn round(_self: Val) { + let output: Val = bevy::math::Vec4::round(_self.into_inner()) + .into(); + output + } + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) { + let output: Val = bevy::math::Vec4::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + fn signum(_self: Val) { + let output: Val = bevy::math::Vec4::signum(_self.into_inner()) + .into(); + output + } + fn splat(v: f32) { + let output: Val = bevy::math::Vec4::splat(v).into(); + output + } + fn sub(_self: Val, rhs: Ref) { + let output: Val = >::sub(_self.into_inner(), &rhs) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub(_self: Val, rhs: f32) { + let output: Val = >::sub(_self.into_inner(), rhs) + .into(); + output + } + fn to_array(_self: Ref) { + let output: [f32; 4] = bevy::math::Vec4::to_array(&_self).into(); + output + } + fn trunc(_self: Val) { + let output: Val = bevy::math::Vec4::trunc(_self.into_inner()) + .into(); + output + } + fn truncate(_self: Val) { + let output: Val = bevy::math::Vec4::truncate( + _self.into_inner(), + ) + .into(); + output + } + fn with_w(_self: Val, w: f32) { + let output: Val = bevy::math::Vec4::with_w( + _self.into_inner(), + w, + ) + .into(); + output + } + fn with_x(_self: Val, x: f32) { + let output: Val = bevy::math::Vec4::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + fn with_y(_self: Val, y: f32) { + let output: Val = bevy::math::Vec4::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + fn with_z(_self: Val, z: f32) { + let output: Val = bevy::math::Vec4::with_z( + _self.into_inner(), + z, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "b_vec_2")] +impl bevy::math::BVec2 { + fn all(_self: Val) { + let output: bool = bevy::math::BVec2::all(_self.into_inner()).into(); + output + } + fn any(_self: Val) { + let output: bool = bevy::math::BVec2::any(_self.into_inner()).into(); + output + } + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn bitmask(_self: Val) { + let output: u32 = bevy::math::BVec2::bitmask(_self.into_inner()).into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn from_array(a: [bool; 2]) { + let output: Val = bevy::math::BVec2::from_array(a).into(); + output + } + fn new(x: bool, y: bool) { + let output: Val = bevy::math::BVec2::new(x, y).into(); + output + } + fn set(mut _self: Mut, index: usize, value: bool) { + let output: () = bevy::math::BVec2::set(&mut _self, index, value).into(); + output + } + fn splat(v: bool) { + let output: Val = bevy::math::BVec2::splat(v).into(); + output + } + fn test(_self: Ref, index: usize) { + let output: bool = bevy::math::BVec2::test(&_self, index).into(); + output + } +} +#[script_bindings(remote, name = "b_vec_3")] +impl bevy::math::BVec3 { + fn all(_self: Val) { + let output: bool = bevy::math::BVec3::all(_self.into_inner()).into(); + output + } + fn any(_self: Val) { + let output: bool = bevy::math::BVec3::any(_self.into_inner()).into(); + output + } + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn bitmask(_self: Val) { + let output: u32 = bevy::math::BVec3::bitmask(_self.into_inner()).into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn from_array(a: [bool; 3]) { + let output: Val = bevy::math::BVec3::from_array(a).into(); + output + } + fn new(x: bool, y: bool, z: bool) { + let output: Val = bevy::math::BVec3::new(x, y, z).into(); + output + } + fn set(mut _self: Mut, index: usize, value: bool) { + let output: () = bevy::math::BVec3::set(&mut _self, index, value).into(); + output + } + fn splat(v: bool) { + let output: Val = bevy::math::BVec3::splat(v).into(); + output + } + fn test(_self: Ref, index: usize) { + let output: bool = bevy::math::BVec3::test(&_self, index).into(); + output + } +} +#[script_bindings(remote, name = "b_vec_4")] +impl bevy::math::BVec4 { + fn all(_self: Val) { + let output: bool = bevy::math::BVec4::all(_self.into_inner()).into(); + output + } + fn any(_self: Val) { + let output: bool = bevy::math::BVec4::any(_self.into_inner()).into(); + output + } + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn bitmask(_self: Val) { + let output: u32 = bevy::math::BVec4::bitmask(_self.into_inner()).into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn from_array(a: [bool; 4]) { + let output: Val = bevy::math::BVec4::from_array(a).into(); + output + } + fn new(x: bool, y: bool, z: bool, w: bool) { + let output: Val = bevy::math::BVec4::new(x, y, z, w).into(); + output + } + fn set(mut _self: Mut, index: usize, value: bool) { + let output: () = bevy::math::BVec4::set(&mut _self, index, value).into(); + output + } + fn splat(v: bool) { + let output: Val = bevy::math::BVec4::splat(v).into(); + output + } + fn test(_self: Ref, index: usize) { + let output: bool = bevy::math::BVec4::test(&_self, index).into(); + output + } +} +#[script_bindings(remote, name = "d_vec_2")] +impl bevy::math::DVec2 { + fn abs(_self: Val) { + let output: Val = bevy::math::DVec2::abs(_self.into_inner()) + .into(); + output + } + fn abs_diff_eq( + _self: Val, + rhs: Val, + max_abs_diff: f64, + ) { + let output: bool = bevy::math::DVec2::abs_diff_eq( + _self.into_inner(), + rhs.into_inner(), + max_abs_diff, + ) + .into(); + output + } + fn add(_self: Val, rhs: Ref) { + let output: Val = >::add(_self.into_inner(), &rhs) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add(_self: Val, rhs: f64) { + let output: Val = >::add(_self.into_inner(), rhs) + .into(); + output + } + fn angle_between(_self: Val, rhs: Val) { + let output: f64 = bevy::math::DVec2::angle_between( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn angle_to(_self: Val, rhs: Val) { + let output: f64 = bevy::math::DVec2::angle_to( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn as_i64vec2(_self: Ref) { + let output: Val = bevy::math::DVec2::as_i64vec2(&_self) + .into(); + output + } + fn as_ivec2(_self: Ref) { + let output: Val = bevy::math::DVec2::as_ivec2(&_self).into(); + output + } + fn as_u64vec2(_self: Ref) { + let output: Val = bevy::math::DVec2::as_u64vec2(&_self) + .into(); + output + } + fn as_uvec2(_self: Ref) { + let output: Val = bevy::math::DVec2::as_uvec2(&_self).into(); + output + } + fn as_vec2(_self: Ref) { + let output: Val = bevy::math::DVec2::as_vec2(&_self).into(); + output + } + fn ceil(_self: Val) { + let output: Val = bevy::math::DVec2::ceil(_self.into_inner()) + .into(); + output + } + fn clamp( + _self: Val, + min: Val, + max: Val, + ) { + let output: Val = bevy::math::DVec2::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + fn clamp_length(_self: Val, min: f64, max: f64) { + let output: Val = bevy::math::DVec2::clamp_length( + _self.into_inner(), + min, + max, + ) + .into(); + output + } + fn clamp_length_max(_self: Val, max: f64) { + let output: Val = bevy::math::DVec2::clamp_length_max( + _self.into_inner(), + max, + ) + .into(); + output + } + fn clamp_length_min(_self: Val, min: f64) { + let output: Val = bevy::math::DVec2::clamp_length_min( + _self.into_inner(), + min, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn cmpeq(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec2::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpge(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec2::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpgt(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec2::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmple(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec2::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmplt(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec2::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpne(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec2::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn copysign(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec2::copysign( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn distance(_self: Val, rhs: Val) { + let output: f64 = bevy::math::DVec2::distance( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn distance_squared(_self: Val, rhs: Val) { + let output: f64 = bevy::math::DVec2::distance_squared( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn div(_self: Val, rhs: Ref) { + let output: Val = >::div(_self.into_inner(), &rhs) + .into(); + output + } + fn div(_self: Val, rhs: Val) { + let output: Val = >::div(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn div(_self: Val, rhs: f64) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn div_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec2::div_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn dot(_self: Val, rhs: Val) { + let output: f64 = bevy::math::DVec2::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn dot_into_vec(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec2::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn element_product(_self: Val) { + let output: f64 = bevy::math::DVec2::element_product(_self.into_inner()).into(); + output + } + fn element_sum(_self: Val) { + let output: f64 = bevy::math::DVec2::element_sum(_self.into_inner()).into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn exp(_self: Val) { + let output: Val = bevy::math::DVec2::exp(_self.into_inner()) + .into(); + output + } + fn extend(_self: Val, z: f64) { + let output: Val = bevy::math::DVec2::extend( + _self.into_inner(), + z, + ) + .into(); + output + } + fn floor(_self: Val) { + let output: Val = bevy::math::DVec2::floor(_self.into_inner()) + .into(); + output + } + fn fract(_self: Val) { + let output: Val = bevy::math::DVec2::fract(_self.into_inner()) + .into(); + output + } + fn fract_gl(_self: Val) { + let output: Val = bevy::math::DVec2::fract_gl( + _self.into_inner(), + ) + .into(); + output + } + fn from_angle(angle: f64) { + let output: Val = bevy::math::DVec2::from_angle(angle).into(); + output + } + fn from_array(a: [f64; 2]) { + let output: Val = bevy::math::DVec2::from_array(a).into(); + output + } + fn is_finite(_self: Val) { + let output: bool = bevy::math::DVec2::is_finite(_self.into_inner()).into(); + output + } + fn is_finite_mask(_self: Val) { + let output: Val = bevy::math::DVec2::is_finite_mask( + _self.into_inner(), + ) + .into(); + output + } + fn is_nan(_self: Val) { + let output: bool = bevy::math::DVec2::is_nan(_self.into_inner()).into(); + output + } + fn is_nan_mask(_self: Val) { + let output: Val = bevy::math::DVec2::is_nan_mask( + _self.into_inner(), + ) + .into(); + output + } + fn is_negative_bitmask(_self: Val) { + let output: u32 = bevy::math::DVec2::is_negative_bitmask(_self.into_inner()) + .into(); + output + } + fn is_normalized(_self: Val) { + let output: bool = bevy::math::DVec2::is_normalized(_self.into_inner()).into(); + output + } + fn length(_self: Val) { + let output: f64 = bevy::math::DVec2::length(_self.into_inner()).into(); + output + } + fn length_recip(_self: Val) { + let output: f64 = bevy::math::DVec2::length_recip(_self.into_inner()).into(); + output + } + fn length_squared(_self: Val) { + let output: f64 = bevy::math::DVec2::length_squared(_self.into_inner()).into(); + output + } + fn lerp(_self: Val, rhs: Val, s: f64) { + let output: Val = bevy::math::DVec2::lerp( + _self.into_inner(), + rhs.into_inner(), + s, + ) + .into(); + output + } + fn max(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec2::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn max_element(_self: Val) { + let output: f64 = bevy::math::DVec2::max_element(_self.into_inner()).into(); + output + } + fn midpoint(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec2::midpoint( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec2::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min_element(_self: Val) { + let output: f64 = bevy::math::DVec2::min_element(_self.into_inner()).into(); + output + } + fn move_towards(_self: Ref, rhs: Val, d: f64) { + let output: Val = bevy::math::DVec2::move_towards( + &_self, + rhs.into_inner(), + d, + ) + .into(); + output + } + fn mul(_self: Val, rhs: Ref) { + let output: Val = >::mul(_self.into_inner(), &rhs) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: f64) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn mul_add( + _self: Val, + a: Val, + b: Val, + ) { + let output: Val = bevy::math::DVec2::mul_add( + _self.into_inner(), + a.into_inner(), + b.into_inner(), + ) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn new(x: f64, y: f64) { + let output: Val = bevy::math::DVec2::new(x, y).into(); + output + } + fn normalize(_self: Val) { + let output: Val = bevy::math::DVec2::normalize( + _self.into_inner(), + ) + .into(); + output + } + fn normalize_or(_self: Val, fallback: Val) { + let output: Val = bevy::math::DVec2::normalize_or( + _self.into_inner(), + fallback.into_inner(), + ) + .into(); + output + } + fn normalize_or_zero(_self: Val) { + let output: Val = bevy::math::DVec2::normalize_or_zero( + _self.into_inner(), + ) + .into(); + output + } + fn perp(_self: Val) { + let output: Val = bevy::math::DVec2::perp(_self.into_inner()) + .into(); + output + } + fn perp_dot(_self: Val, rhs: Val) { + let output: f64 = bevy::math::DVec2::perp_dot( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn powf(_self: Val, n: f64) { + let output: Val = bevy::math::DVec2::powf( + _self.into_inner(), + n, + ) + .into(); + output + } + fn project_onto(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec2::project_onto( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn project_onto_normalized( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::DVec2::project_onto_normalized( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn recip(_self: Val) { + let output: Val = bevy::math::DVec2::recip(_self.into_inner()) + .into(); + output + } + fn reflect(_self: Val, normal: Val) { + let output: Val = bevy::math::DVec2::reflect( + _self.into_inner(), + normal.into_inner(), + ) + .into(); + output + } + fn refract(_self: Val, normal: Val, eta: f64) { + let output: Val = bevy::math::DVec2::refract( + _self.into_inner(), + normal.into_inner(), + eta, + ) + .into(); + output + } + fn reject_from(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec2::reject_from( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn reject_from_normalized( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::DVec2::reject_from_normalized( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn rem(_self: Val, rhs: Ref) { + let output: Val = >::rem(_self.into_inner(), &rhs) + .into(); + output + } + fn rem(_self: Val, rhs: Val) { + let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn rem(_self: Val, rhs: f64) { + let output: Val = >::rem(_self.into_inner(), rhs) + .into(); + output + } + fn rem_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec2::rem_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn rotate(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec2::rotate( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn rotate_towards( + _self: Ref, + rhs: Val, + max_angle: f64, + ) { + let output: Val = bevy::math::DVec2::rotate_towards( + &_self, + rhs.into_inner(), + max_angle, + ) + .into(); + output + } + fn round(_self: Val) { + let output: Val = bevy::math::DVec2::round(_self.into_inner()) + .into(); + output + } + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) { + let output: Val = bevy::math::DVec2::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + fn signum(_self: Val) { + let output: Val = bevy::math::DVec2::signum( + _self.into_inner(), + ) + .into(); + output + } + fn splat(v: f64) { + let output: Val = bevy::math::DVec2::splat(v).into(); + output + } + fn sub(_self: Val, rhs: Ref) { + let output: Val = >::sub(_self.into_inner(), &rhs) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub(_self: Val, rhs: f64) { + let output: Val = >::sub(_self.into_inner(), rhs) + .into(); + output + } + fn to_angle(_self: Val) { + let output: f64 = bevy::math::DVec2::to_angle(_self.into_inner()).into(); + output + } + fn to_array(_self: Ref) { + let output: [f64; 2] = bevy::math::DVec2::to_array(&_self).into(); + output + } + fn trunc(_self: Val) { + let output: Val = bevy::math::DVec2::trunc(_self.into_inner()) + .into(); + output + } + fn with_x(_self: Val, x: f64) { + let output: Val = bevy::math::DVec2::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + fn with_y(_self: Val, y: f64) { + let output: Val = bevy::math::DVec2::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "d_vec_3")] +impl bevy::math::DVec3 { + fn abs(_self: Val) { + let output: Val = bevy::math::DVec3::abs(_self.into_inner()) + .into(); + output + } + fn abs_diff_eq( + _self: Val, + rhs: Val, + max_abs_diff: f64, + ) { + let output: bool = bevy::math::DVec3::abs_diff_eq( + _self.into_inner(), + rhs.into_inner(), + max_abs_diff, + ) + .into(); + output + } + fn add(_self: Val, rhs: Ref) { + let output: Val = >::add(_self.into_inner(), &rhs) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add(_self: Val, rhs: f64) { + let output: Val = >::add(_self.into_inner(), rhs) + .into(); + output + } + fn angle_between(_self: Val, rhs: Val) { + let output: f64 = bevy::math::DVec3::angle_between( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn any_orthogonal_vector(_self: Ref) { + let output: Val = bevy::math::DVec3::any_orthogonal_vector( + &_self, + ) + .into(); + output + } + fn any_orthonormal_vector(_self: Ref) { + let output: Val = bevy::math::DVec3::any_orthonormal_vector( + &_self, + ) + .into(); + output + } + fn as_i64vec3(_self: Ref) { + let output: Val = bevy::math::DVec3::as_i64vec3(&_self) + .into(); + output + } + fn as_ivec3(_self: Ref) { + let output: Val = bevy::math::DVec3::as_ivec3(&_self).into(); + output + } + fn as_u64vec3(_self: Ref) { + let output: Val = bevy::math::DVec3::as_u64vec3(&_self) + .into(); + output + } + fn as_uvec3(_self: Ref) { + let output: Val = bevy::math::DVec3::as_uvec3(&_self).into(); + output + } + fn as_vec3(_self: Ref) { + let output: Val = bevy::math::DVec3::as_vec3(&_self).into(); + output + } + fn as_vec3a(_self: Ref) { + let output: Val = bevy::math::DVec3::as_vec3a(&_self).into(); + output + } + fn ceil(_self: Val) { + let output: Val = bevy::math::DVec3::ceil(_self.into_inner()) + .into(); + output + } + fn clamp( + _self: Val, + min: Val, + max: Val, + ) { + let output: Val = bevy::math::DVec3::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + fn clamp_length(_self: Val, min: f64, max: f64) { + let output: Val = bevy::math::DVec3::clamp_length( + _self.into_inner(), + min, + max, + ) + .into(); + output + } + fn clamp_length_max(_self: Val, max: f64) { + let output: Val = bevy::math::DVec3::clamp_length_max( + _self.into_inner(), + max, + ) + .into(); + output + } + fn clamp_length_min(_self: Val, min: f64) { + let output: Val = bevy::math::DVec3::clamp_length_min( + _self.into_inner(), + min, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn cmpeq(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec3::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpge(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec3::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpgt(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec3::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmple(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec3::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmplt(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec3::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpne(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec3::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn copysign(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec3::copysign( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cross(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec3::cross( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn distance(_self: Val, rhs: Val) { + let output: f64 = bevy::math::DVec3::distance( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn distance_squared(_self: Val, rhs: Val) { + let output: f64 = bevy::math::DVec3::distance_squared( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn div(_self: Val, rhs: Ref) { + let output: Val = >::div(_self.into_inner(), &rhs) + .into(); + output + } + fn div(_self: Val, rhs: Val) { + let output: Val = >::div(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn div(_self: Val, rhs: f64) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn div_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec3::div_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn dot(_self: Val, rhs: Val) { + let output: f64 = bevy::math::DVec3::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn dot_into_vec(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec3::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn element_product(_self: Val) { + let output: f64 = bevy::math::DVec3::element_product(_self.into_inner()).into(); + output + } + fn element_sum(_self: Val) { + let output: f64 = bevy::math::DVec3::element_sum(_self.into_inner()).into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn exp(_self: Val) { + let output: Val = bevy::math::DVec3::exp(_self.into_inner()) + .into(); + output + } + fn extend(_self: Val, w: f64) { + let output: Val = bevy::math::DVec3::extend( + _self.into_inner(), + w, + ) + .into(); + output + } + fn floor(_self: Val) { + let output: Val = bevy::math::DVec3::floor(_self.into_inner()) + .into(); + output + } + fn fract(_self: Val) { + let output: Val = bevy::math::DVec3::fract(_self.into_inner()) + .into(); + output + } + fn fract_gl(_self: Val) { + let output: Val = bevy::math::DVec3::fract_gl( + _self.into_inner(), + ) + .into(); + output + } + fn from_array(a: [f64; 3]) { + let output: Val = bevy::math::DVec3::from_array(a).into(); + output + } + fn is_finite(_self: Val) { + let output: bool = bevy::math::DVec3::is_finite(_self.into_inner()).into(); + output + } + fn is_finite_mask(_self: Val) { + let output: Val = bevy::math::DVec3::is_finite_mask( + _self.into_inner(), + ) + .into(); + output + } + fn is_nan(_self: Val) { + let output: bool = bevy::math::DVec3::is_nan(_self.into_inner()).into(); + output + } + fn is_nan_mask(_self: Val) { + let output: Val = bevy::math::DVec3::is_nan_mask( + _self.into_inner(), + ) + .into(); + output + } + fn is_negative_bitmask(_self: Val) { + let output: u32 = bevy::math::DVec3::is_negative_bitmask(_self.into_inner()) + .into(); + output + } + fn is_normalized(_self: Val) { + let output: bool = bevy::math::DVec3::is_normalized(_self.into_inner()).into(); + output + } + fn length(_self: Val) { + let output: f64 = bevy::math::DVec3::length(_self.into_inner()).into(); + output + } + fn length_recip(_self: Val) { + let output: f64 = bevy::math::DVec3::length_recip(_self.into_inner()).into(); + output + } + fn length_squared(_self: Val) { + let output: f64 = bevy::math::DVec3::length_squared(_self.into_inner()).into(); + output + } + fn lerp(_self: Val, rhs: Val, s: f64) { + let output: Val = bevy::math::DVec3::lerp( + _self.into_inner(), + rhs.into_inner(), + s, + ) + .into(); + output + } + fn max(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec3::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn max_element(_self: Val) { + let output: f64 = bevy::math::DVec3::max_element(_self.into_inner()).into(); + output + } + fn midpoint(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec3::midpoint( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec3::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min_element(_self: Val) { + let output: f64 = bevy::math::DVec3::min_element(_self.into_inner()).into(); + output + } + fn move_towards(_self: Ref, rhs: Val, d: f64) { + let output: Val = bevy::math::DVec3::move_towards( + &_self, + rhs.into_inner(), + d, + ) + .into(); + output + } + fn mul(_self: Val, rhs: Ref) { + let output: Val = >::mul(_self.into_inner(), &rhs) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: f64) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn mul_add( + _self: Val, + a: Val, + b: Val, + ) { + let output: Val = bevy::math::DVec3::mul_add( + _self.into_inner(), + a.into_inner(), + b.into_inner(), + ) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn new(x: f64, y: f64, z: f64) { + let output: Val = bevy::math::DVec3::new(x, y, z).into(); + output + } + fn normalize(_self: Val) { + let output: Val = bevy::math::DVec3::normalize( + _self.into_inner(), + ) + .into(); + output + } + fn normalize_or(_self: Val, fallback: Val) { + let output: Val = bevy::math::DVec3::normalize_or( + _self.into_inner(), + fallback.into_inner(), + ) + .into(); + output + } + fn normalize_or_zero(_self: Val) { + let output: Val = bevy::math::DVec3::normalize_or_zero( + _self.into_inner(), + ) + .into(); + output + } + fn powf(_self: Val, n: f64) { + let output: Val = bevy::math::DVec3::powf( + _self.into_inner(), + n, + ) + .into(); + output + } + fn project_onto(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec3::project_onto( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn project_onto_normalized( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::DVec3::project_onto_normalized( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn recip(_self: Val) { + let output: Val = bevy::math::DVec3::recip(_self.into_inner()) + .into(); + output + } + fn reflect(_self: Val, normal: Val) { + let output: Val = bevy::math::DVec3::reflect( + _self.into_inner(), + normal.into_inner(), + ) + .into(); + output + } + fn refract(_self: Val, normal: Val, eta: f64) { + let output: Val = bevy::math::DVec3::refract( + _self.into_inner(), + normal.into_inner(), + eta, + ) + .into(); + output + } + fn reject_from(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec3::reject_from( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn reject_from_normalized( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::DVec3::reject_from_normalized( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn rem(_self: Val, rhs: Ref) { + let output: Val = >::rem(_self.into_inner(), &rhs) + .into(); + output + } + fn rem(_self: Val, rhs: Val) { + let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn rem(_self: Val, rhs: f64) { + let output: Val = >::rem(_self.into_inner(), rhs) + .into(); + output + } + fn rem_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec3::rem_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn round(_self: Val) { + let output: Val = bevy::math::DVec3::round(_self.into_inner()) + .into(); + output + } + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) { + let output: Val = bevy::math::DVec3::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + fn signum(_self: Val) { + let output: Val = bevy::math::DVec3::signum( + _self.into_inner(), + ) + .into(); + output + } + fn splat(v: f64) { + let output: Val = bevy::math::DVec3::splat(v).into(); + output + } + fn sub(_self: Val, rhs: Ref) { + let output: Val = >::sub(_self.into_inner(), &rhs) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub(_self: Val, rhs: f64) { + let output: Val = >::sub(_self.into_inner(), rhs) + .into(); + output + } + fn to_array(_self: Ref) { + let output: [f64; 3] = bevy::math::DVec3::to_array(&_self).into(); + output + } + fn trunc(_self: Val) { + let output: Val = bevy::math::DVec3::trunc(_self.into_inner()) + .into(); + output + } + fn truncate(_self: Val) { + let output: Val = bevy::math::DVec3::truncate( + _self.into_inner(), + ) + .into(); + output + } + fn with_x(_self: Val, x: f64) { + let output: Val = bevy::math::DVec3::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + fn with_y(_self: Val, y: f64) { + let output: Val = bevy::math::DVec3::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + fn with_z(_self: Val, z: f64) { + let output: Val = bevy::math::DVec3::with_z( + _self.into_inner(), + z, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "d_vec_4")] +impl bevy::math::DVec4 { + fn abs(_self: Val) { + let output: Val = bevy::math::DVec4::abs(_self.into_inner()) + .into(); + output + } + fn abs_diff_eq( + _self: Val, + rhs: Val, + max_abs_diff: f64, + ) { + let output: bool = bevy::math::DVec4::abs_diff_eq( + _self.into_inner(), + rhs.into_inner(), + max_abs_diff, + ) + .into(); + output + } + fn add(_self: Val, rhs: Ref) { + let output: Val = >::add(_self.into_inner(), &rhs) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add(_self: Val, rhs: f64) { + let output: Val = >::add(_self.into_inner(), rhs) + .into(); + output + } + fn as_i64vec4(_self: Ref) { + let output: Val = bevy::math::DVec4::as_i64vec4(&_self) + .into(); + output + } + fn as_ivec4(_self: Ref) { + let output: Val = bevy::math::DVec4::as_ivec4(&_self).into(); + output + } + fn as_u64vec4(_self: Ref) { + let output: Val = bevy::math::DVec4::as_u64vec4(&_self) + .into(); + output + } + fn as_uvec4(_self: Ref) { + let output: Val = bevy::math::DVec4::as_uvec4(&_self).into(); + output + } + fn as_vec4(_self: Ref) { + let output: Val = bevy::math::DVec4::as_vec4(&_self).into(); + output + } + fn ceil(_self: Val) { + let output: Val = bevy::math::DVec4::ceil(_self.into_inner()) + .into(); + output + } + fn clamp( + _self: Val, + min: Val, + max: Val, + ) { + let output: Val = bevy::math::DVec4::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + fn clamp_length(_self: Val, min: f64, max: f64) { + let output: Val = bevy::math::DVec4::clamp_length( + _self.into_inner(), + min, + max, + ) + .into(); + output + } + fn clamp_length_max(_self: Val, max: f64) { + let output: Val = bevy::math::DVec4::clamp_length_max( + _self.into_inner(), + max, + ) + .into(); + output + } + fn clamp_length_min(_self: Val, min: f64) { + let output: Val = bevy::math::DVec4::clamp_length_min( + _self.into_inner(), + min, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn cmpeq(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec4::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpge(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec4::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpgt(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec4::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmple(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec4::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmplt(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec4::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn cmpne(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec4::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn copysign(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec4::copysign( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn distance(_self: Val, rhs: Val) { + let output: f64 = bevy::math::DVec4::distance( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn distance_squared(_self: Val, rhs: Val) { + let output: f64 = bevy::math::DVec4::distance_squared( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn div(_self: Val, rhs: Ref) { + let output: Val = >::div(_self.into_inner(), &rhs) + .into(); + output + } + fn div(_self: Val, rhs: Val) { + let output: Val = >::div(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn div(_self: Val, rhs: f64) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn div_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec4::div_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn dot(_self: Val, rhs: Val) { + let output: f64 = bevy::math::DVec4::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn dot_into_vec(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec4::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn element_product(_self: Val) { + let output: f64 = bevy::math::DVec4::element_product(_self.into_inner()).into(); + output + } + fn element_sum(_self: Val) { + let output: f64 = bevy::math::DVec4::element_sum(_self.into_inner()).into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn exp(_self: Val) { + let output: Val = bevy::math::DVec4::exp(_self.into_inner()) + .into(); + output + } + fn floor(_self: Val) { + let output: Val = bevy::math::DVec4::floor(_self.into_inner()) + .into(); + output + } + fn fract(_self: Val) { + let output: Val = bevy::math::DVec4::fract(_self.into_inner()) + .into(); + output + } + fn fract_gl(_self: Val) { + let output: Val = bevy::math::DVec4::fract_gl( + _self.into_inner(), + ) + .into(); + output + } + fn from_array(a: [f64; 4]) { + let output: Val = bevy::math::DVec4::from_array(a).into(); + output + } + fn is_finite(_self: Val) { + let output: bool = bevy::math::DVec4::is_finite(_self.into_inner()).into(); + output + } + fn is_finite_mask(_self: Val) { + let output: Val = bevy::math::DVec4::is_finite_mask( + _self.into_inner(), + ) + .into(); + output + } + fn is_nan(_self: Val) { + let output: bool = bevy::math::DVec4::is_nan(_self.into_inner()).into(); + output + } + fn is_nan_mask(_self: Val) { + let output: Val = bevy::math::DVec4::is_nan_mask( + _self.into_inner(), + ) + .into(); + output + } + fn is_negative_bitmask(_self: Val) { + let output: u32 = bevy::math::DVec4::is_negative_bitmask(_self.into_inner()) + .into(); + output + } + fn is_normalized(_self: Val) { + let output: bool = bevy::math::DVec4::is_normalized(_self.into_inner()).into(); + output + } + fn length(_self: Val) { + let output: f64 = bevy::math::DVec4::length(_self.into_inner()).into(); + output + } + fn length_recip(_self: Val) { + let output: f64 = bevy::math::DVec4::length_recip(_self.into_inner()).into(); + output + } + fn length_squared(_self: Val) { + let output: f64 = bevy::math::DVec4::length_squared(_self.into_inner()).into(); + output + } + fn lerp(_self: Val, rhs: Val, s: f64) { + let output: Val = bevy::math::DVec4::lerp( + _self.into_inner(), + rhs.into_inner(), + s, + ) + .into(); + output + } + fn max(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec4::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn max_element(_self: Val) { + let output: f64 = bevy::math::DVec4::max_element(_self.into_inner()).into(); + output + } + fn midpoint(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec4::midpoint( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec4::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn min_element(_self: Val) { + let output: f64 = bevy::math::DVec4::min_element(_self.into_inner()).into(); + output + } + fn move_towards(_self: Ref, rhs: Val, d: f64) { + let output: Val = bevy::math::DVec4::move_towards( + &_self, + rhs.into_inner(), + d, + ) + .into(); + output + } + fn mul(_self: Val, rhs: Ref) { + let output: Val = >::mul(_self.into_inner(), &rhs) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: f64) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn mul_add( + _self: Val, + a: Val, + b: Val, + ) { + let output: Val = bevy::math::DVec4::mul_add( + _self.into_inner(), + a.into_inner(), + b.into_inner(), + ) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn new(x: f64, y: f64, z: f64, w: f64) { + let output: Val = bevy::math::DVec4::new(x, y, z, w).into(); + output + } + fn normalize(_self: Val) { + let output: Val = bevy::math::DVec4::normalize( + _self.into_inner(), + ) + .into(); + output + } + fn normalize_or(_self: Val, fallback: Val) { + let output: Val = bevy::math::DVec4::normalize_or( + _self.into_inner(), + fallback.into_inner(), + ) + .into(); + output + } + fn normalize_or_zero(_self: Val) { + let output: Val = bevy::math::DVec4::normalize_or_zero( + _self.into_inner(), + ) + .into(); + output + } + fn powf(_self: Val, n: f64) { + let output: Val = bevy::math::DVec4::powf( + _self.into_inner(), + n, + ) + .into(); + output + } + fn project_onto(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec4::project_onto( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn project_onto_normalized( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::DVec4::project_onto_normalized( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn recip(_self: Val) { + let output: Val = bevy::math::DVec4::recip(_self.into_inner()) + .into(); + output + } + fn reflect(_self: Val, normal: Val) { + let output: Val = bevy::math::DVec4::reflect( + _self.into_inner(), + normal.into_inner(), + ) + .into(); + output + } + fn refract(_self: Val, normal: Val, eta: f64) { + let output: Val = bevy::math::DVec4::refract( + _self.into_inner(), + normal.into_inner(), + eta, + ) + .into(); + output + } + fn reject_from(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec4::reject_from( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn reject_from_normalized( + _self: Val, + rhs: Val, + ) { + let output: Val = bevy::math::DVec4::reject_from_normalized( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn rem(_self: Val, rhs: Ref) { + let output: Val = >::rem(_self.into_inner(), &rhs) + .into(); + output + } + fn rem(_self: Val, rhs: Val) { + let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn rem(_self: Val, rhs: f64) { + let output: Val = >::rem(_self.into_inner(), rhs) + .into(); + output + } + fn rem_euclid(_self: Val, rhs: Val) { + let output: Val = bevy::math::DVec4::rem_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn round(_self: Val) { + let output: Val = bevy::math::DVec4::round(_self.into_inner()) + .into(); + output + } + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) { + let output: Val = bevy::math::DVec4::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + fn signum(_self: Val) { + let output: Val = bevy::math::DVec4::signum( + _self.into_inner(), + ) + .into(); + output + } + fn splat(v: f64) { + let output: Val = bevy::math::DVec4::splat(v).into(); + output + } + fn sub(_self: Val, rhs: Ref) { + let output: Val = >::sub(_self.into_inner(), &rhs) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub(_self: Val, rhs: f64) { + let output: Val = >::sub(_self.into_inner(), rhs) + .into(); + output + } + fn to_array(_self: Ref) { + let output: [f64; 4] = bevy::math::DVec4::to_array(&_self).into(); + output + } + fn trunc(_self: Val) { + let output: Val = bevy::math::DVec4::trunc(_self.into_inner()) + .into(); + output + } + fn truncate(_self: Val) { + let output: Val = bevy::math::DVec4::truncate( + _self.into_inner(), + ) + .into(); + output + } + fn with_w(_self: Val, w: f64) { + let output: Val = bevy::math::DVec4::with_w( + _self.into_inner(), + w, + ) + .into(); + output + } + fn with_x(_self: Val, x: f64) { + let output: Val = bevy::math::DVec4::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + fn with_y(_self: Val, y: f64) { + let output: Val = bevy::math::DVec4::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + fn with_z(_self: Val, z: f64) { + let output: Val = bevy::math::DVec4::with_z( + _self.into_inner(), + z, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "mat_2")] +impl bevy::math::Mat2 { + fn abs(_self: Ref) { + let output: Val = bevy::math::Mat2::abs(&_self).into(); + output + } + fn abs_diff_eq( + _self: Ref, + rhs: Val, + max_abs_diff: f32, + ) { + let output: bool = bevy::math::Mat2::abs_diff_eq( + &_self, + rhs.into_inner(), + max_abs_diff, + ) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add_mat2(_self: Ref, rhs: Ref) { + let output: Val = bevy::math::Mat2::add_mat2(&_self, &rhs) + .into(); + output + } + fn as_dmat2(_self: Ref) { + let output: Val = bevy::math::Mat2::as_dmat2(&_self).into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn col(_self: Ref, index: usize) { + let output: Val = bevy::math::Mat2::col(&_self, index).into(); + output + } + fn determinant(_self: Ref) { + let output: f32 = bevy::math::Mat2::determinant(&_self).into(); + output + } + fn div(_self: Val, rhs: f32) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn div_scalar(_self: Ref, rhs: f32) { + let output: Val = bevy::math::Mat2::div_scalar(&_self, rhs) + .into(); + output + } + fn eq(_self: Ref, rhs: Ref) { + let output: bool = >::eq(&_self, &rhs) + .into(); + output + } + fn from_angle(angle: f32) { + let output: Val = bevy::math::Mat2::from_angle(angle).into(); + output + } + fn from_cols(x_axis: Val, y_axis: Val) { + let output: Val = bevy::math::Mat2::from_cols( + x_axis.into_inner(), + y_axis.into_inner(), + ) + .into(); + output + } + fn from_diagonal(diagonal: Val) { + let output: Val = bevy::math::Mat2::from_diagonal( + diagonal.into_inner(), + ) + .into(); + output + } + fn from_mat3(m: Val) { + let output: Val = bevy::math::Mat2::from_mat3(m.into_inner()) + .into(); + output + } + fn from_mat3_minor(m: Val, i: usize, j: usize) { + let output: Val = bevy::math::Mat2::from_mat3_minor( + m.into_inner(), + i, + j, + ) + .into(); + output + } + fn from_mat3a(m: Val) { + let output: Val = bevy::math::Mat2::from_mat3a(m.into_inner()) + .into(); + output + } + fn from_mat3a_minor(m: Val, i: usize, j: usize) { + let output: Val = bevy::math::Mat2::from_mat3a_minor( + m.into_inner(), + i, + j, + ) + .into(); + output + } + fn from_scale_angle(scale: Val, angle: f32) { + let output: Val = bevy::math::Mat2::from_scale_angle( + scale.into_inner(), + angle, + ) + .into(); + output + } + fn inverse(_self: Ref) { + let output: Val = bevy::math::Mat2::inverse(&_self).into(); + output + } + fn is_finite(_self: Ref) { + let output: bool = bevy::math::Mat2::is_finite(&_self).into(); + output + } + fn is_nan(_self: Ref) { + let output: bool = bevy::math::Mat2::is_nan(&_self).into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: f32) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn mul_mat2(_self: Ref, rhs: Ref) { + let output: Val = bevy::math::Mat2::mul_mat2(&_self, &rhs) + .into(); + output + } + fn mul_scalar(_self: Ref, rhs: f32) { + let output: Val = bevy::math::Mat2::mul_scalar(&_self, rhs) + .into(); + output + } + fn mul_vec2(_self: Ref, rhs: Val) { + let output: Val = bevy::math::Mat2::mul_vec2( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn row(_self: Ref, index: usize) { + let output: Val = bevy::math::Mat2::row(&_self, index).into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub_mat2(_self: Ref, rhs: Ref) { + let output: Val = bevy::math::Mat2::sub_mat2(&_self, &rhs) + .into(); + output + } + fn to_cols_array(_self: Ref) { + let output: [f32; 4] = bevy::math::Mat2::to_cols_array(&_self).into(); + output + } + fn to_cols_array_2d(_self: Ref) { + let output: [[f32; 2]; 2] = bevy::math::Mat2::to_cols_array_2d(&_self).into(); + output + } + fn transpose(_self: Ref) { + let output: Val = bevy::math::Mat2::transpose(&_self).into(); + output + } +} +#[script_bindings(remote, name = "mat_3")] +impl bevy::math::Mat3 { + fn abs(_self: Ref) { + let output: Val = bevy::math::Mat3::abs(&_self).into(); + output + } + fn abs_diff_eq( + _self: Ref, + rhs: Val, + max_abs_diff: f32, + ) { + let output: bool = bevy::math::Mat3::abs_diff_eq( + &_self, + rhs.into_inner(), + max_abs_diff, + ) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add_mat3(_self: Ref, rhs: Ref) { + let output: Val = bevy::math::Mat3::add_mat3(&_self, &rhs) + .into(); + output + } + fn as_dmat3(_self: Ref) { + let output: Val = bevy::math::Mat3::as_dmat3(&_self).into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn col(_self: Ref, index: usize) { + let output: Val = bevy::math::Mat3::col(&_self, index).into(); + output + } + fn determinant(_self: Ref) { + let output: f32 = bevy::math::Mat3::determinant(&_self).into(); + output + } + fn div(_self: Val, rhs: f32) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn div_scalar(_self: Ref, rhs: f32) { + let output: Val = bevy::math::Mat3::div_scalar(&_self, rhs) + .into(); + output + } + fn eq(_self: Ref, rhs: Ref) { + let output: bool = >::eq(&_self, &rhs) + .into(); + output + } + fn from_angle(angle: f32) { + let output: Val = bevy::math::Mat3::from_angle(angle).into(); + output + } + fn from_axis_angle(axis: Val, angle: f32) { + let output: Val = bevy::math::Mat3::from_axis_angle( + axis.into_inner(), + angle, + ) + .into(); + output + } + fn from_cols( + x_axis: Val, + y_axis: Val, + z_axis: Val, + ) { + let output: Val = bevy::math::Mat3::from_cols( + x_axis.into_inner(), + y_axis.into_inner(), + z_axis.into_inner(), + ) + .into(); + output + } + fn from_diagonal(diagonal: Val) { + let output: Val = bevy::math::Mat3::from_diagonal( + diagonal.into_inner(), + ) + .into(); + output + } + fn from_euler(order: Val, a: f32, b: f32, c: f32) { + let output: Val = bevy::math::Mat3::from_euler( + order.into_inner(), + a, + b, + c, + ) + .into(); + output + } + fn from_mat2(m: Val) { + let output: Val = bevy::math::Mat3::from_mat2(m.into_inner()) + .into(); + output + } + fn from_mat4(m: Val) { + let output: Val = bevy::math::Mat3::from_mat4(m.into_inner()) + .into(); + output + } + fn from_mat4_minor(m: Val, i: usize, j: usize) { + let output: Val = bevy::math::Mat3::from_mat4_minor( + m.into_inner(), + i, + j, + ) + .into(); + output + } + fn from_quat(rotation: Val) { + let output: Val = bevy::math::Mat3::from_quat( + rotation.into_inner(), + ) + .into(); + output + } + fn from_rotation_x(angle: f32) { + let output: Val = bevy::math::Mat3::from_rotation_x(angle) + .into(); + output + } + fn from_rotation_y(angle: f32) { + let output: Val = bevy::math::Mat3::from_rotation_y(angle) + .into(); + output + } + fn from_rotation_z(angle: f32) { + let output: Val = bevy::math::Mat3::from_rotation_z(angle) + .into(); + output + } + fn from_scale(scale: Val) { + let output: Val = bevy::math::Mat3::from_scale( + scale.into_inner(), + ) + .into(); + output + } + fn from_scale_angle_translation( + scale: Val, + angle: f32, + translation: Val, + ) { + let output: Val = bevy::math::Mat3::from_scale_angle_translation( + scale.into_inner(), + angle, + translation.into_inner(), + ) + .into(); + output + } + fn from_translation(translation: Val) { + let output: Val = bevy::math::Mat3::from_translation( + translation.into_inner(), + ) + .into(); + output + } + fn inverse(_self: Ref) { + let output: Val = bevy::math::Mat3::inverse(&_self).into(); + output + } + fn is_finite(_self: Ref) { + let output: bool = bevy::math::Mat3::is_finite(&_self).into(); + output + } + fn is_nan(_self: Ref) { + let output: bool = bevy::math::Mat3::is_nan(&_self).into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: f32) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn mul_mat3(_self: Ref, rhs: Ref) { + let output: Val = bevy::math::Mat3::mul_mat3(&_self, &rhs) + .into(); + output + } + fn mul_scalar(_self: Ref, rhs: f32) { + let output: Val = bevy::math::Mat3::mul_scalar(&_self, rhs) + .into(); + output + } + fn mul_vec3(_self: Ref, rhs: Val) { + let output: Val = bevy::math::Mat3::mul_vec3( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn mul_vec3a(_self: Ref, rhs: Val) { + let output: Val = bevy::math::Mat3::mul_vec3a( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn row(_self: Ref, index: usize) { + let output: Val = bevy::math::Mat3::row(&_self, index).into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub_mat3(_self: Ref, rhs: Ref) { + let output: Val = bevy::math::Mat3::sub_mat3(&_self, &rhs) + .into(); + output + } + fn to_cols_array(_self: Ref) { + let output: [f32; 9] = bevy::math::Mat3::to_cols_array(&_self).into(); + output + } + fn to_cols_array_2d(_self: Ref) { + let output: [[f32; 3]; 3] = bevy::math::Mat3::to_cols_array_2d(&_self).into(); + output + } + fn to_euler(_self: Ref, order: Val) { + let output: (f32, f32, f32) = bevy::math::Mat3::to_euler( + &_self, + order.into_inner(), + ) + .into(); + output + } + fn transform_point2(_self: Ref, rhs: Val) { + let output: Val = bevy::math::Mat3::transform_point2( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn transform_vector2(_self: Ref, rhs: Val) { + let output: Val = bevy::math::Mat3::transform_vector2( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn transpose(_self: Ref) { + let output: Val = bevy::math::Mat3::transpose(&_self).into(); + output + } +} +#[script_bindings(remote, name = "mat_3_a")] +impl bevy::math::Mat3A { + fn abs(_self: Ref) { + let output: Val = bevy::math::Mat3A::abs(&_self).into(); + output + } + fn abs_diff_eq( + _self: Ref, + rhs: Val, + max_abs_diff: f32, + ) { + let output: bool = bevy::math::Mat3A::abs_diff_eq( + &_self, + rhs.into_inner(), + max_abs_diff, + ) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add_mat3(_self: Ref, rhs: Ref) { + let output: Val = bevy::math::Mat3A::add_mat3(&_self, &rhs) + .into(); + output + } + fn as_dmat3(_self: Ref) { + let output: Val = bevy::math::Mat3A::as_dmat3(&_self).into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn col(_self: Ref, index: usize) { + let output: Val = bevy::math::Mat3A::col(&_self, index) + .into(); + output + } + fn determinant(_self: Ref) { + let output: f32 = bevy::math::Mat3A::determinant(&_self).into(); + output + } + fn div(_self: Val, rhs: f32) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn div_scalar(_self: Ref, rhs: f32) { + let output: Val = bevy::math::Mat3A::div_scalar(&_self, rhs) + .into(); + output + } + fn eq(_self: Ref, rhs: Ref) { + let output: bool = >::eq(&_self, &rhs) + .into(); + output + } + fn from_angle(angle: f32) { + let output: Val = bevy::math::Mat3A::from_angle(angle).into(); + output + } + fn from_axis_angle(axis: Val, angle: f32) { + let output: Val = bevy::math::Mat3A::from_axis_angle( + axis.into_inner(), + angle, + ) + .into(); + output + } + fn from_cols( + x_axis: Val, + y_axis: Val, + z_axis: Val, + ) { + let output: Val = bevy::math::Mat3A::from_cols( + x_axis.into_inner(), + y_axis.into_inner(), + z_axis.into_inner(), + ) + .into(); + output + } + fn from_diagonal(diagonal: Val) { + let output: Val = bevy::math::Mat3A::from_diagonal( + diagonal.into_inner(), + ) + .into(); + output + } + fn from_euler(order: Val, a: f32, b: f32, c: f32) { + let output: Val = bevy::math::Mat3A::from_euler( + order.into_inner(), + a, + b, + c, + ) + .into(); + output + } + fn from_mat2(m: Val) { + let output: Val = bevy::math::Mat3A::from_mat2(m.into_inner()) + .into(); + output + } + fn from_mat4(m: Val) { + let output: Val = bevy::math::Mat3A::from_mat4(m.into_inner()) + .into(); + output + } + fn from_mat4_minor(m: Val, i: usize, j: usize) { + let output: Val = bevy::math::Mat3A::from_mat4_minor( + m.into_inner(), + i, + j, + ) + .into(); + output + } + fn from_quat(rotation: Val) { + let output: Val = bevy::math::Mat3A::from_quat( + rotation.into_inner(), + ) + .into(); + output + } + fn from_rotation_x(angle: f32) { + let output: Val = bevy::math::Mat3A::from_rotation_x(angle) + .into(); + output + } + fn from_rotation_y(angle: f32) { + let output: Val = bevy::math::Mat3A::from_rotation_y(angle) + .into(); + output + } + fn from_rotation_z(angle: f32) { + let output: Val = bevy::math::Mat3A::from_rotation_z(angle) + .into(); + output + } + fn from_scale(scale: Val) { + let output: Val = bevy::math::Mat3A::from_scale( + scale.into_inner(), + ) + .into(); + output + } + fn from_scale_angle_translation( + scale: Val, + angle: f32, + translation: Val, + ) { + let output: Val = bevy::math::Mat3A::from_scale_angle_translation( + scale.into_inner(), + angle, + translation.into_inner(), + ) + .into(); + output + } + fn from_translation(translation: Val) { + let output: Val = bevy::math::Mat3A::from_translation( + translation.into_inner(), + ) + .into(); + output + } + fn inverse(_self: Ref) { + let output: Val = bevy::math::Mat3A::inverse(&_self).into(); + output + } + fn is_finite(_self: Ref) { + let output: bool = bevy::math::Mat3A::is_finite(&_self).into(); + output + } + fn is_nan(_self: Ref) { + let output: bool = bevy::math::Mat3A::is_nan(&_self).into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: f32) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn mul_mat3(_self: Ref, rhs: Ref) { + let output: Val = bevy::math::Mat3A::mul_mat3(&_self, &rhs) + .into(); + output + } + fn mul_scalar(_self: Ref, rhs: f32) { + let output: Val = bevy::math::Mat3A::mul_scalar(&_self, rhs) + .into(); + output + } + fn mul_vec3(_self: Ref, rhs: Val) { + let output: Val = bevy::math::Mat3A::mul_vec3( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn mul_vec3a(_self: Ref, rhs: Val) { + let output: Val = bevy::math::Mat3A::mul_vec3a( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn row(_self: Ref, index: usize) { + let output: Val = bevy::math::Mat3A::row(&_self, index) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub_mat3(_self: Ref, rhs: Ref) { + let output: Val = bevy::math::Mat3A::sub_mat3(&_self, &rhs) + .into(); + output + } + fn to_cols_array(_self: Ref) { + let output: [f32; 9] = bevy::math::Mat3A::to_cols_array(&_self).into(); + output + } + fn to_cols_array_2d(_self: Ref) { + let output: [[f32; 3]; 3] = bevy::math::Mat3A::to_cols_array_2d(&_self).into(); + output + } + fn to_euler(_self: Ref, order: Val) { + let output: (f32, f32, f32) = bevy::math::Mat3A::to_euler( + &_self, + order.into_inner(), + ) + .into(); + output + } + fn transform_point2(_self: Ref, rhs: Val) { + let output: Val = bevy::math::Mat3A::transform_point2( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn transform_vector2(_self: Ref, rhs: Val) { + let output: Val = bevy::math::Mat3A::transform_vector2( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn transpose(_self: Ref) { + let output: Val = bevy::math::Mat3A::transpose(&_self).into(); + output + } +} +#[script_bindings(remote, name = "mat_4")] +impl bevy::math::Mat4 { + fn abs(_self: Ref) { + let output: Val = bevy::math::Mat4::abs(&_self).into(); + output + } + fn abs_diff_eq( + _self: Ref, + rhs: Val, + max_abs_diff: f32, + ) { + let output: bool = bevy::math::Mat4::abs_diff_eq( + &_self, + rhs.into_inner(), + max_abs_diff, + ) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add_mat4(_self: Ref, rhs: Ref) { + let output: Val = bevy::math::Mat4::add_mat4(&_self, &rhs) + .into(); + output + } + fn as_dmat4(_self: Ref) { + let output: Val = bevy::math::Mat4::as_dmat4(&_self).into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn col(_self: Ref, index: usize) { + let output: Val = bevy::math::Mat4::col(&_self, index).into(); + output + } + fn determinant(_self: Ref) { + let output: f32 = bevy::math::Mat4::determinant(&_self).into(); + output + } + fn div(_self: Val, rhs: f32) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn div_scalar(_self: Ref, rhs: f32) { + let output: Val = bevy::math::Mat4::div_scalar(&_self, rhs) + .into(); + output + } + fn eq(_self: Ref, rhs: Ref) { + let output: bool = >::eq(&_self, &rhs) + .into(); + output + } + fn from_axis_angle(axis: Val, angle: f32) { + let output: Val = bevy::math::Mat4::from_axis_angle( + axis.into_inner(), + angle, + ) + .into(); + output + } + fn from_cols( + x_axis: Val, + y_axis: Val, + z_axis: Val, + w_axis: Val, + ) { + let output: Val = bevy::math::Mat4::from_cols( + x_axis.into_inner(), + y_axis.into_inner(), + z_axis.into_inner(), + w_axis.into_inner(), + ) + .into(); + output + } + fn from_diagonal(diagonal: Val) { + let output: Val = bevy::math::Mat4::from_diagonal( + diagonal.into_inner(), + ) + .into(); + output + } + fn from_euler(order: Val, a: f32, b: f32, c: f32) { + let output: Val = bevy::math::Mat4::from_euler( + order.into_inner(), + a, + b, + c, + ) + .into(); + output + } + fn from_mat3(m: Val) { + let output: Val = bevy::math::Mat4::from_mat3(m.into_inner()) + .into(); + output + } + fn from_mat3a(m: Val) { + let output: Val = bevy::math::Mat4::from_mat3a(m.into_inner()) + .into(); + output + } + fn from_quat(rotation: Val) { + let output: Val = bevy::math::Mat4::from_quat( + rotation.into_inner(), + ) + .into(); + output + } + fn from_rotation_translation( + rotation: Val, + translation: Val, + ) { + let output: Val = bevy::math::Mat4::from_rotation_translation( + rotation.into_inner(), + translation.into_inner(), + ) + .into(); + output + } + fn from_rotation_x(angle: f32) { + let output: Val = bevy::math::Mat4::from_rotation_x(angle) + .into(); + output + } + fn from_rotation_y(angle: f32) { + let output: Val = bevy::math::Mat4::from_rotation_y(angle) + .into(); + output + } + fn from_rotation_z(angle: f32) { + let output: Val = bevy::math::Mat4::from_rotation_z(angle) + .into(); + output + } + fn from_scale(scale: Val) { + let output: Val = bevy::math::Mat4::from_scale( + scale.into_inner(), + ) + .into(); + output + } + fn from_scale_rotation_translation( + scale: Val, + rotation: Val, + translation: Val, + ) { + let output: Val = bevy::math::Mat4::from_scale_rotation_translation( + scale.into_inner(), + rotation.into_inner(), + translation.into_inner(), + ) + .into(); + output + } + fn from_translation(translation: Val) { + let output: Val = bevy::math::Mat4::from_translation( + translation.into_inner(), + ) + .into(); + output + } + fn inverse(_self: Ref) { + let output: Val = bevy::math::Mat4::inverse(&_self).into(); + output + } + fn is_finite(_self: Ref) { + let output: bool = bevy::math::Mat4::is_finite(&_self).into(); + output + } + fn is_nan(_self: Ref) { + let output: bool = bevy::math::Mat4::is_nan(&_self).into(); + output + } + fn look_at_lh( + eye: Val, + center: Val, + up: Val, + ) { + let output: Val = bevy::math::Mat4::look_at_lh( + eye.into_inner(), + center.into_inner(), + up.into_inner(), + ) + .into(); + output + } + fn look_at_rh( + eye: Val, + center: Val, + up: Val, + ) { + let output: Val = bevy::math::Mat4::look_at_rh( + eye.into_inner(), + center.into_inner(), + up.into_inner(), + ) + .into(); + output + } + fn look_to_lh( + eye: Val, + dir: Val, + up: Val, + ) { + let output: Val = bevy::math::Mat4::look_to_lh( + eye.into_inner(), + dir.into_inner(), + up.into_inner(), + ) + .into(); + output + } + fn look_to_rh( + eye: Val, + dir: Val, + up: Val, + ) { + let output: Val = bevy::math::Mat4::look_to_rh( + eye.into_inner(), + dir.into_inner(), + up.into_inner(), + ) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: f32) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn mul_mat4(_self: Ref, rhs: Ref) { + let output: Val = bevy::math::Mat4::mul_mat4(&_self, &rhs) + .into(); + output + } + fn mul_scalar(_self: Ref, rhs: f32) { + let output: Val = bevy::math::Mat4::mul_scalar(&_self, rhs) + .into(); + output + } + fn mul_vec4(_self: Ref, rhs: Val) { + let output: Val = bevy::math::Mat4::mul_vec4( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn orthographic_lh( + left: f32, + right: f32, + bottom: f32, + top: f32, + near: f32, + far: f32, + ) { + let output: Val = bevy::math::Mat4::orthographic_lh( + left, + right, + bottom, + top, + near, + far, + ) + .into(); + output + } + fn orthographic_rh( + left: f32, + right: f32, + bottom: f32, + top: f32, + near: f32, + far: f32, + ) { + let output: Val = bevy::math::Mat4::orthographic_rh( + left, + right, + bottom, + top, + near, + far, + ) + .into(); + output + } + fn orthographic_rh_gl( + left: f32, + right: f32, + bottom: f32, + top: f32, + near: f32, + far: f32, + ) { + let output: Val = bevy::math::Mat4::orthographic_rh_gl( + left, + right, + bottom, + top, + near, + far, + ) + .into(); + output + } + fn perspective_infinite_lh(fov_y_radians: f32, aspect_ratio: f32, z_near: f32) { + let output: Val = bevy::math::Mat4::perspective_infinite_lh( + fov_y_radians, + aspect_ratio, + z_near, + ) + .into(); + output + } + fn perspective_infinite_reverse_lh( + fov_y_radians: f32, + aspect_ratio: f32, + z_near: f32, + ) { + let output: Val = bevy::math::Mat4::perspective_infinite_reverse_lh( + fov_y_radians, + aspect_ratio, + z_near, + ) + .into(); + output + } + fn perspective_infinite_reverse_rh( + fov_y_radians: f32, + aspect_ratio: f32, + z_near: f32, + ) { + let output: Val = bevy::math::Mat4::perspective_infinite_reverse_rh( + fov_y_radians, + aspect_ratio, + z_near, + ) + .into(); + output + } + fn perspective_infinite_rh(fov_y_radians: f32, aspect_ratio: f32, z_near: f32) { + let output: Val = bevy::math::Mat4::perspective_infinite_rh( + fov_y_radians, + aspect_ratio, + z_near, + ) + .into(); + output + } + fn perspective_lh(fov_y_radians: f32, aspect_ratio: f32, z_near: f32, z_far: f32) { + let output: Val = bevy::math::Mat4::perspective_lh( + fov_y_radians, + aspect_ratio, + z_near, + z_far, + ) + .into(); + output + } + fn perspective_rh(fov_y_radians: f32, aspect_ratio: f32, z_near: f32, z_far: f32) { + let output: Val = bevy::math::Mat4::perspective_rh( + fov_y_radians, + aspect_ratio, + z_near, + z_far, + ) + .into(); + output + } + fn perspective_rh_gl( + fov_y_radians: f32, + aspect_ratio: f32, + z_near: f32, + z_far: f32, + ) { + let output: Val = bevy::math::Mat4::perspective_rh_gl( + fov_y_radians, + aspect_ratio, + z_near, + z_far, + ) + .into(); + output + } + fn project_point3(_self: Ref, rhs: Val) { + let output: Val = bevy::math::Mat4::project_point3( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn project_point3a(_self: Ref, rhs: Val) { + let output: Val = bevy::math::Mat4::project_point3a( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn row(_self: Ref, index: usize) { + let output: Val = bevy::math::Mat4::row(&_self, index).into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub_mat4(_self: Ref, rhs: Ref) { + let output: Val = bevy::math::Mat4::sub_mat4(&_self, &rhs) + .into(); + output + } + fn to_cols_array(_self: Ref) { + let output: [f32; 16] = bevy::math::Mat4::to_cols_array(&_self).into(); + output + } + fn to_cols_array_2d(_self: Ref) { + let output: [[f32; 4]; 4] = bevy::math::Mat4::to_cols_array_2d(&_self).into(); + output + } + fn to_euler(_self: Ref, order: Val) { + let output: (f32, f32, f32) = bevy::math::Mat4::to_euler( + &_self, + order.into_inner(), + ) + .into(); + output + } + fn transform_point3(_self: Ref, rhs: Val) { + let output: Val = bevy::math::Mat4::transform_point3( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn transform_point3a(_self: Ref, rhs: Val) { + let output: Val = bevy::math::Mat4::transform_point3a( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn transform_vector3(_self: Ref, rhs: Val) { + let output: Val = bevy::math::Mat4::transform_vector3( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn transform_vector3a(_self: Ref, rhs: Val) { + let output: Val = bevy::math::Mat4::transform_vector3a( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn transpose(_self: Ref) { + let output: Val = bevy::math::Mat4::transpose(&_self).into(); + output + } +} +#[script_bindings(remote, name = "d_mat_2")] +impl bevy::math::DMat2 { + fn abs(_self: Ref) { + let output: Val = bevy::math::DMat2::abs(&_self).into(); + output + } + fn abs_diff_eq( + _self: Ref, + rhs: Val, + max_abs_diff: f64, + ) { + let output: bool = bevy::math::DMat2::abs_diff_eq( + &_self, + rhs.into_inner(), + max_abs_diff, + ) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add_mat2(_self: Ref, rhs: Ref) { + let output: Val = bevy::math::DMat2::add_mat2(&_self, &rhs) + .into(); + output + } + fn as_mat2(_self: Ref) { + let output: Val = bevy::math::DMat2::as_mat2(&_self).into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn col(_self: Ref, index: usize) { + let output: Val = bevy::math::DMat2::col(&_self, index) + .into(); + output + } + fn determinant(_self: Ref) { + let output: f64 = bevy::math::DMat2::determinant(&_self).into(); + output + } + fn div(_self: Val, rhs: f64) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn div_scalar(_self: Ref, rhs: f64) { + let output: Val = bevy::math::DMat2::div_scalar(&_self, rhs) + .into(); + output + } + fn eq(_self: Ref, rhs: Ref) { + let output: bool = >::eq(&_self, &rhs) + .into(); + output + } + fn from_angle(angle: f64) { + let output: Val = bevy::math::DMat2::from_angle(angle).into(); + output + } + fn from_cols(x_axis: Val, y_axis: Val) { + let output: Val = bevy::math::DMat2::from_cols( + x_axis.into_inner(), + y_axis.into_inner(), + ) + .into(); + output + } + fn from_diagonal(diagonal: Val) { + let output: Val = bevy::math::DMat2::from_diagonal( + diagonal.into_inner(), + ) + .into(); + output + } + fn from_mat3(m: Val) { + let output: Val = bevy::math::DMat2::from_mat3(m.into_inner()) + .into(); + output + } + fn from_mat3_minor(m: Val, i: usize, j: usize) { + let output: Val = bevy::math::DMat2::from_mat3_minor( + m.into_inner(), + i, + j, + ) + .into(); + output + } + fn from_scale_angle(scale: Val, angle: f64) { + let output: Val = bevy::math::DMat2::from_scale_angle( + scale.into_inner(), + angle, + ) + .into(); + output + } + fn inverse(_self: Ref) { + let output: Val = bevy::math::DMat2::inverse(&_self).into(); + output + } + fn is_finite(_self: Ref) { + let output: bool = bevy::math::DMat2::is_finite(&_self).into(); + output + } + fn is_nan(_self: Ref) { + let output: bool = bevy::math::DMat2::is_nan(&_self).into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: f64) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn mul_mat2(_self: Ref, rhs: Ref) { + let output: Val = bevy::math::DMat2::mul_mat2(&_self, &rhs) + .into(); + output + } + fn mul_scalar(_self: Ref, rhs: f64) { + let output: Val = bevy::math::DMat2::mul_scalar(&_self, rhs) + .into(); + output + } + fn mul_vec2(_self: Ref, rhs: Val) { + let output: Val = bevy::math::DMat2::mul_vec2( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn row(_self: Ref, index: usize) { + let output: Val = bevy::math::DMat2::row(&_self, index) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub_mat2(_self: Ref, rhs: Ref) { + let output: Val = bevy::math::DMat2::sub_mat2(&_self, &rhs) + .into(); + output + } + fn to_cols_array(_self: Ref) { + let output: [f64; 4] = bevy::math::DMat2::to_cols_array(&_self).into(); + output + } + fn to_cols_array_2d(_self: Ref) { + let output: [[f64; 2]; 2] = bevy::math::DMat2::to_cols_array_2d(&_self).into(); + output + } + fn transpose(_self: Ref) { + let output: Val = bevy::math::DMat2::transpose(&_self).into(); + output + } +} +#[script_bindings(remote, name = "d_mat_3")] +impl bevy::math::DMat3 { + fn abs(_self: Ref) { + let output: Val = bevy::math::DMat3::abs(&_self).into(); + output + } + fn abs_diff_eq( + _self: Ref, + rhs: Val, + max_abs_diff: f64, + ) { + let output: bool = bevy::math::DMat3::abs_diff_eq( + &_self, + rhs.into_inner(), + max_abs_diff, + ) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add_mat3(_self: Ref, rhs: Ref) { + let output: Val = bevy::math::DMat3::add_mat3(&_self, &rhs) + .into(); + output + } + fn as_mat3(_self: Ref) { + let output: Val = bevy::math::DMat3::as_mat3(&_self).into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn col(_self: Ref, index: usize) { + let output: Val = bevy::math::DMat3::col(&_self, index) + .into(); + output + } + fn determinant(_self: Ref) { + let output: f64 = bevy::math::DMat3::determinant(&_self).into(); + output + } + fn div(_self: Val, rhs: f64) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn div_scalar(_self: Ref, rhs: f64) { + let output: Val = bevy::math::DMat3::div_scalar(&_self, rhs) + .into(); + output + } + fn eq(_self: Ref, rhs: Ref) { + let output: bool = >::eq(&_self, &rhs) + .into(); + output + } + fn from_angle(angle: f64) { + let output: Val = bevy::math::DMat3::from_angle(angle).into(); + output + } + fn from_axis_angle(axis: Val, angle: f64) { + let output: Val = bevy::math::DMat3::from_axis_angle( + axis.into_inner(), + angle, + ) + .into(); + output + } + fn from_cols( + x_axis: Val, + y_axis: Val, + z_axis: Val, + ) { + let output: Val = bevy::math::DMat3::from_cols( + x_axis.into_inner(), + y_axis.into_inner(), + z_axis.into_inner(), + ) + .into(); + output + } + fn from_diagonal(diagonal: Val) { + let output: Val = bevy::math::DMat3::from_diagonal( + diagonal.into_inner(), + ) + .into(); + output + } + fn from_euler(order: Val, a: f64, b: f64, c: f64) { + let output: Val = bevy::math::DMat3::from_euler( + order.into_inner(), + a, + b, + c, + ) + .into(); + output + } + fn from_mat2(m: Val) { + let output: Val = bevy::math::DMat3::from_mat2(m.into_inner()) + .into(); + output + } + fn from_mat4(m: Val) { + let output: Val = bevy::math::DMat3::from_mat4(m.into_inner()) + .into(); + output + } + fn from_mat4_minor(m: Val, i: usize, j: usize) { + let output: Val = bevy::math::DMat3::from_mat4_minor( + m.into_inner(), + i, + j, + ) + .into(); + output + } + fn from_quat(rotation: Val) { + let output: Val = bevy::math::DMat3::from_quat( + rotation.into_inner(), + ) + .into(); + output + } + fn from_rotation_x(angle: f64) { + let output: Val = bevy::math::DMat3::from_rotation_x(angle) + .into(); + output + } + fn from_rotation_y(angle: f64) { + let output: Val = bevy::math::DMat3::from_rotation_y(angle) + .into(); + output + } + fn from_rotation_z(angle: f64) { + let output: Val = bevy::math::DMat3::from_rotation_z(angle) + .into(); + output + } + fn from_scale(scale: Val) { + let output: Val = bevy::math::DMat3::from_scale( + scale.into_inner(), + ) + .into(); + output + } + fn from_scale_angle_translation( + scale: Val, + angle: f64, + translation: Val, + ) { + let output: Val = bevy::math::DMat3::from_scale_angle_translation( + scale.into_inner(), + angle, + translation.into_inner(), + ) + .into(); + output + } + fn from_translation(translation: Val) { + let output: Val = bevy::math::DMat3::from_translation( + translation.into_inner(), + ) + .into(); + output + } + fn inverse(_self: Ref) { + let output: Val = bevy::math::DMat3::inverse(&_self).into(); + output + } + fn is_finite(_self: Ref) { + let output: bool = bevy::math::DMat3::is_finite(&_self).into(); + output + } + fn is_nan(_self: Ref) { + let output: bool = bevy::math::DMat3::is_nan(&_self).into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: f64) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn mul_mat3(_self: Ref, rhs: Ref) { + let output: Val = bevy::math::DMat3::mul_mat3(&_self, &rhs) + .into(); + output + } + fn mul_scalar(_self: Ref, rhs: f64) { + let output: Val = bevy::math::DMat3::mul_scalar(&_self, rhs) + .into(); + output + } + fn mul_vec3(_self: Ref, rhs: Val) { + let output: Val = bevy::math::DMat3::mul_vec3( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn row(_self: Ref, index: usize) { + let output: Val = bevy::math::DMat3::row(&_self, index) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub_mat3(_self: Ref, rhs: Ref) { + let output: Val = bevy::math::DMat3::sub_mat3(&_self, &rhs) + .into(); + output + } + fn to_cols_array(_self: Ref) { + let output: [f64; 9] = bevy::math::DMat3::to_cols_array(&_self).into(); + output + } + fn to_cols_array_2d(_self: Ref) { + let output: [[f64; 3]; 3] = bevy::math::DMat3::to_cols_array_2d(&_self).into(); + output + } + fn to_euler(_self: Ref, order: Val) { + let output: (f64, f64, f64) = bevy::math::DMat3::to_euler( + &_self, + order.into_inner(), + ) + .into(); + output + } + fn transform_point2(_self: Ref, rhs: Val) { + let output: Val = bevy::math::DMat3::transform_point2( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn transform_vector2(_self: Ref, rhs: Val) { + let output: Val = bevy::math::DMat3::transform_vector2( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn transpose(_self: Ref) { + let output: Val = bevy::math::DMat3::transpose(&_self).into(); + output + } +} +#[script_bindings(remote, name = "d_mat_4")] +impl bevy::math::DMat4 { + fn abs(_self: Ref) { + let output: Val = bevy::math::DMat4::abs(&_self).into(); + output + } + fn abs_diff_eq( + _self: Ref, + rhs: Val, + max_abs_diff: f64, + ) { + let output: bool = bevy::math::DMat4::abs_diff_eq( + &_self, + rhs.into_inner(), + max_abs_diff, + ) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn add_mat4(_self: Ref, rhs: Ref) { + let output: Val = bevy::math::DMat4::add_mat4(&_self, &rhs) + .into(); + output + } + fn as_mat4(_self: Ref) { + let output: Val = bevy::math::DMat4::as_mat4(&_self).into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn col(_self: Ref, index: usize) { + let output: Val = bevy::math::DMat4::col(&_self, index) + .into(); + output + } + fn determinant(_self: Ref) { + let output: f64 = bevy::math::DMat4::determinant(&_self).into(); + output + } + fn div(_self: Val, rhs: f64) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn div_scalar(_self: Ref, rhs: f64) { + let output: Val = bevy::math::DMat4::div_scalar(&_self, rhs) + .into(); + output + } + fn eq(_self: Ref, rhs: Ref) { + let output: bool = >::eq(&_self, &rhs) + .into(); + output + } + fn from_axis_angle(axis: Val, angle: f64) { + let output: Val = bevy::math::DMat4::from_axis_angle( + axis.into_inner(), + angle, + ) + .into(); + output + } + fn from_cols( + x_axis: Val, + y_axis: Val, + z_axis: Val, + w_axis: Val, + ) { + let output: Val = bevy::math::DMat4::from_cols( + x_axis.into_inner(), + y_axis.into_inner(), + z_axis.into_inner(), + w_axis.into_inner(), + ) + .into(); + output + } + fn from_diagonal(diagonal: Val) { + let output: Val = bevy::math::DMat4::from_diagonal( + diagonal.into_inner(), + ) + .into(); + output + } + fn from_euler(order: Val, a: f64, b: f64, c: f64) { + let output: Val = bevy::math::DMat4::from_euler( + order.into_inner(), + a, + b, + c, + ) + .into(); + output + } + fn from_mat3(m: Val) { + let output: Val = bevy::math::DMat4::from_mat3(m.into_inner()) + .into(); + output + } + fn from_quat(rotation: Val) { + let output: Val = bevy::math::DMat4::from_quat( + rotation.into_inner(), + ) + .into(); + output + } + fn from_rotation_translation( + rotation: Val, + translation: Val, + ) { + let output: Val = bevy::math::DMat4::from_rotation_translation( + rotation.into_inner(), + translation.into_inner(), + ) + .into(); + output + } + fn from_rotation_x(angle: f64) { + let output: Val = bevy::math::DMat4::from_rotation_x(angle) + .into(); + output + } + fn from_rotation_y(angle: f64) { + let output: Val = bevy::math::DMat4::from_rotation_y(angle) + .into(); + output + } + fn from_rotation_z(angle: f64) { + let output: Val = bevy::math::DMat4::from_rotation_z(angle) + .into(); + output + } + fn from_scale(scale: Val) { + let output: Val = bevy::math::DMat4::from_scale( + scale.into_inner(), + ) + .into(); + output + } + fn from_scale_rotation_translation( + scale: Val, + rotation: Val, + translation: Val, + ) { + let output: Val = bevy::math::DMat4::from_scale_rotation_translation( + scale.into_inner(), + rotation.into_inner(), + translation.into_inner(), + ) + .into(); + output + } + fn from_translation(translation: Val) { + let output: Val = bevy::math::DMat4::from_translation( + translation.into_inner(), + ) + .into(); + output + } + fn inverse(_self: Ref) { + let output: Val = bevy::math::DMat4::inverse(&_self).into(); + output + } + fn is_finite(_self: Ref) { + let output: bool = bevy::math::DMat4::is_finite(&_self).into(); + output + } + fn is_nan(_self: Ref) { + let output: bool = bevy::math::DMat4::is_nan(&_self).into(); + output + } + fn look_at_lh( + eye: Val, + center: Val, + up: Val, + ) { + let output: Val = bevy::math::DMat4::look_at_lh( + eye.into_inner(), + center.into_inner(), + up.into_inner(), + ) + .into(); + output + } + fn look_at_rh( + eye: Val, + center: Val, + up: Val, + ) { + let output: Val = bevy::math::DMat4::look_at_rh( + eye.into_inner(), + center.into_inner(), + up.into_inner(), + ) + .into(); + output + } + fn look_to_lh( + eye: Val, + dir: Val, + up: Val, + ) { + let output: Val = bevy::math::DMat4::look_to_lh( + eye.into_inner(), + dir.into_inner(), + up.into_inner(), + ) + .into(); + output + } + fn look_to_rh( + eye: Val, + dir: Val, + up: Val, + ) { + let output: Val = bevy::math::DMat4::look_to_rh( + eye.into_inner(), + dir.into_inner(), + up.into_inner(), + ) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: f64) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn mul_mat4(_self: Ref, rhs: Ref) { + let output: Val = bevy::math::DMat4::mul_mat4(&_self, &rhs) + .into(); + output + } + fn mul_scalar(_self: Ref, rhs: f64) { + let output: Val = bevy::math::DMat4::mul_scalar(&_self, rhs) + .into(); + output + } + fn mul_vec4(_self: Ref, rhs: Val) { + let output: Val = bevy::math::DMat4::mul_vec4( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn orthographic_lh( + left: f64, + right: f64, + bottom: f64, + top: f64, + near: f64, + far: f64, + ) { + let output: Val = bevy::math::DMat4::orthographic_lh( + left, + right, + bottom, + top, + near, + far, + ) + .into(); + output + } + fn orthographic_rh( + left: f64, + right: f64, + bottom: f64, + top: f64, + near: f64, + far: f64, + ) { + let output: Val = bevy::math::DMat4::orthographic_rh( + left, + right, + bottom, + top, + near, + far, + ) + .into(); + output + } + fn orthographic_rh_gl( + left: f64, + right: f64, + bottom: f64, + top: f64, + near: f64, + far: f64, + ) { + let output: Val = bevy::math::DMat4::orthographic_rh_gl( + left, + right, + bottom, + top, + near, + far, + ) + .into(); + output + } + fn perspective_infinite_lh(fov_y_radians: f64, aspect_ratio: f64, z_near: f64) { + let output: Val = bevy::math::DMat4::perspective_infinite_lh( + fov_y_radians, + aspect_ratio, + z_near, + ) + .into(); + output + } + fn perspective_infinite_reverse_lh( + fov_y_radians: f64, + aspect_ratio: f64, + z_near: f64, + ) { + let output: Val = bevy::math::DMat4::perspective_infinite_reverse_lh( + fov_y_radians, + aspect_ratio, + z_near, + ) + .into(); + output + } + fn perspective_infinite_reverse_rh( + fov_y_radians: f64, + aspect_ratio: f64, + z_near: f64, + ) { + let output: Val = bevy::math::DMat4::perspective_infinite_reverse_rh( + fov_y_radians, + aspect_ratio, + z_near, + ) + .into(); + output + } + fn perspective_infinite_rh(fov_y_radians: f64, aspect_ratio: f64, z_near: f64) { + let output: Val = bevy::math::DMat4::perspective_infinite_rh( + fov_y_radians, + aspect_ratio, + z_near, + ) + .into(); + output + } + fn perspective_lh(fov_y_radians: f64, aspect_ratio: f64, z_near: f64, z_far: f64) { + let output: Val = bevy::math::DMat4::perspective_lh( + fov_y_radians, + aspect_ratio, + z_near, + z_far, + ) + .into(); + output + } + fn perspective_rh(fov_y_radians: f64, aspect_ratio: f64, z_near: f64, z_far: f64) { + let output: Val = bevy::math::DMat4::perspective_rh( + fov_y_radians, + aspect_ratio, + z_near, + z_far, + ) + .into(); + output + } + fn perspective_rh_gl( + fov_y_radians: f64, + aspect_ratio: f64, + z_near: f64, + z_far: f64, + ) { + let output: Val = bevy::math::DMat4::perspective_rh_gl( + fov_y_radians, + aspect_ratio, + z_near, + z_far, + ) + .into(); + output + } + fn project_point3(_self: Ref, rhs: Val) { + let output: Val = bevy::math::DMat4::project_point3( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn row(_self: Ref, index: usize) { + let output: Val = bevy::math::DMat4::row(&_self, index) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn sub_mat4(_self: Ref, rhs: Ref) { + let output: Val = bevy::math::DMat4::sub_mat4(&_self, &rhs) + .into(); + output + } + fn to_cols_array(_self: Ref) { + let output: [f64; 16] = bevy::math::DMat4::to_cols_array(&_self).into(); + output + } + fn to_cols_array_2d(_self: Ref) { + let output: [[f64; 4]; 4] = bevy::math::DMat4::to_cols_array_2d(&_self).into(); + output + } + fn to_euler(_self: Ref, order: Val) { + let output: (f64, f64, f64) = bevy::math::DMat4::to_euler( + &_self, + order.into_inner(), + ) + .into(); + output + } + fn transform_point3(_self: Ref, rhs: Val) { + let output: Val = bevy::math::DMat4::transform_point3( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn transform_vector3(_self: Ref, rhs: Val) { + let output: Val = bevy::math::DMat4::transform_vector3( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn transpose(_self: Ref) { + let output: Val = bevy::math::DMat4::transpose(&_self).into(); + output + } +} +#[script_bindings(remote, name = "affine_2")] +impl bevy::math::Affine2 { + fn abs_diff_eq( + _self: Ref, + rhs: Val, + max_abs_diff: f32, + ) { + let output: bool = bevy::math::Affine2::abs_diff_eq( + &_self, + rhs.into_inner(), + max_abs_diff, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq(_self: Ref, rhs: Ref) { + let output: bool = >::eq(&_self, &rhs) + .into(); + output + } + fn from_angle(angle: f32) { + let output: Val = bevy::math::Affine2::from_angle(angle) + .into(); + output + } + fn from_angle_translation(angle: f32, translation: Val) { + let output: Val = bevy::math::Affine2::from_angle_translation( + angle, + translation.into_inner(), + ) + .into(); + output + } + fn from_cols( + x_axis: Val, + y_axis: Val, + z_axis: Val, + ) { + let output: Val = bevy::math::Affine2::from_cols( + x_axis.into_inner(), + y_axis.into_inner(), + z_axis.into_inner(), + ) + .into(); + output + } + fn from_mat2(matrix2: Val) { + let output: Val = bevy::math::Affine2::from_mat2( + matrix2.into_inner(), + ) + .into(); + output + } + fn from_mat2_translation( + matrix2: Val, + translation: Val, + ) { + let output: Val = bevy::math::Affine2::from_mat2_translation( + matrix2.into_inner(), + translation.into_inner(), + ) + .into(); + output + } + fn from_mat3(m: Val) { + let output: Val = bevy::math::Affine2::from_mat3( + m.into_inner(), + ) + .into(); + output + } + fn from_mat3a(m: Val) { + let output: Val = bevy::math::Affine2::from_mat3a( + m.into_inner(), + ) + .into(); + output + } + fn from_scale(scale: Val) { + let output: Val = bevy::math::Affine2::from_scale( + scale.into_inner(), + ) + .into(); + output + } + fn from_scale_angle_translation( + scale: Val, + angle: f32, + translation: Val, + ) { + let output: Val = bevy::math::Affine2::from_scale_angle_translation( + scale.into_inner(), + angle, + translation.into_inner(), + ) + .into(); + output + } + fn from_translation(translation: Val) { + let output: Val = bevy::math::Affine2::from_translation( + translation.into_inner(), + ) + .into(); + output + } + fn inverse(_self: Ref) { + let output: Val = bevy::math::Affine2::inverse(&_self) + .into(); + output + } + fn is_finite(_self: Ref) { + let output: bool = bevy::math::Affine2::is_finite(&_self).into(); + output + } + fn is_nan(_self: Ref) { + let output: bool = bevy::math::Affine2::is_nan(&_self).into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn to_cols_array(_self: Ref) { + let output: [f32; 6] = bevy::math::Affine2::to_cols_array(&_self).into(); + output + } + fn to_cols_array_2d(_self: Ref) { + let output: [[f32; 2]; 3] = bevy::math::Affine2::to_cols_array_2d(&_self).into(); + output + } + fn transform_point2(_self: Ref, rhs: Val) { + let output: Val = bevy::math::Affine2::transform_point2( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn transform_vector2(_self: Ref, rhs: Val) { + let output: Val = bevy::math::Affine2::transform_vector2( + &_self, + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "affine_3_a")] +impl bevy::math::Affine3A { + fn abs_diff_eq( + _self: Ref, + rhs: Val, + max_abs_diff: f32, + ) { + let output: bool = bevy::math::Affine3A::abs_diff_eq( + &_self, + rhs.into_inner(), + max_abs_diff, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq(_self: Ref, rhs: Ref) { + let output: bool = >::eq(&_self, &rhs) + .into(); + output + } + fn from_axis_angle(axis: Val, angle: f32) { + let output: Val = bevy::math::Affine3A::from_axis_angle( + axis.into_inner(), + angle, + ) + .into(); + output + } + fn from_cols( + x_axis: Val, + y_axis: Val, + z_axis: Val, + w_axis: Val, + ) { + let output: Val = bevy::math::Affine3A::from_cols( + x_axis.into_inner(), + y_axis.into_inner(), + z_axis.into_inner(), + w_axis.into_inner(), + ) + .into(); + output + } + fn from_mat3(mat3: Val) { + let output: Val = bevy::math::Affine3A::from_mat3( + mat3.into_inner(), + ) + .into(); + output + } + fn from_mat3_translation( + mat3: Val, + translation: Val, + ) { + let output: Val = bevy::math::Affine3A::from_mat3_translation( + mat3.into_inner(), + translation.into_inner(), + ) + .into(); + output + } + fn from_mat4(m: Val) { + let output: Val = bevy::math::Affine3A::from_mat4( + m.into_inner(), + ) + .into(); + output + } + fn from_quat(rotation: Val) { + let output: Val = bevy::math::Affine3A::from_quat( + rotation.into_inner(), + ) + .into(); + output + } + fn from_rotation_translation( + rotation: Val, + translation: Val, + ) { + let output: Val = bevy::math::Affine3A::from_rotation_translation( + rotation.into_inner(), + translation.into_inner(), + ) + .into(); + output + } + fn from_rotation_x(angle: f32) { + let output: Val = bevy::math::Affine3A::from_rotation_x( + angle, + ) + .into(); + output + } + fn from_rotation_y(angle: f32) { + let output: Val = bevy::math::Affine3A::from_rotation_y( + angle, + ) + .into(); + output + } + fn from_rotation_z(angle: f32) { + let output: Val = bevy::math::Affine3A::from_rotation_z( + angle, + ) + .into(); + output + } + fn from_scale(scale: Val) { + let output: Val = bevy::math::Affine3A::from_scale( + scale.into_inner(), + ) + .into(); + output + } + fn from_scale_rotation_translation( + scale: Val, + rotation: Val, + translation: Val, + ) { + let output: Val = bevy::math::Affine3A::from_scale_rotation_translation( + scale.into_inner(), + rotation.into_inner(), + translation.into_inner(), + ) + .into(); + output + } + fn from_translation(translation: Val) { + let output: Val = bevy::math::Affine3A::from_translation( + translation.into_inner(), + ) + .into(); + output + } + fn inverse(_self: Ref) { + let output: Val = bevy::math::Affine3A::inverse(&_self) + .into(); + output + } + fn is_finite(_self: Ref) { + let output: bool = bevy::math::Affine3A::is_finite(&_self).into(); + output + } + fn is_nan(_self: Ref) { + let output: bool = bevy::math::Affine3A::is_nan(&_self).into(); + output + } + fn look_at_lh( + eye: Val, + center: Val, + up: Val, + ) { + let output: Val = bevy::math::Affine3A::look_at_lh( + eye.into_inner(), + center.into_inner(), + up.into_inner(), + ) + .into(); + output + } + fn look_at_rh( + eye: Val, + center: Val, + up: Val, + ) { + let output: Val = bevy::math::Affine3A::look_at_rh( + eye.into_inner(), + center.into_inner(), + up.into_inner(), + ) + .into(); + output + } + fn look_to_lh( + eye: Val, + dir: Val, + up: Val, + ) { + let output: Val = bevy::math::Affine3A::look_to_lh( + eye.into_inner(), + dir.into_inner(), + up.into_inner(), + ) + .into(); + output + } + fn look_to_rh( + eye: Val, + dir: Val, + up: Val, + ) { + let output: Val = bevy::math::Affine3A::look_to_rh( + eye.into_inner(), + dir.into_inner(), + up.into_inner(), + ) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn to_cols_array(_self: Ref) { + let output: [f32; 12] = bevy::math::Affine3A::to_cols_array(&_self).into(); + output + } + fn to_cols_array_2d(_self: Ref) { + let output: [[f32; 3]; 4] = bevy::math::Affine3A::to_cols_array_2d(&_self) + .into(); + output + } + fn transform_point3(_self: Ref, rhs: Val) { + let output: Val = bevy::math::Affine3A::transform_point3( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn transform_point3a(_self: Ref, rhs: Val) { + let output: Val = bevy::math::Affine3A::transform_point3a( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn transform_vector3(_self: Ref, rhs: Val) { + let output: Val = bevy::math::Affine3A::transform_vector3( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn transform_vector3a( + _self: Ref, + rhs: Val, + ) { + let output: Val = bevy::math::Affine3A::transform_vector3a( + &_self, + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "d_affine_2")] +impl bevy::math::DAffine2 { + fn abs_diff_eq( + _self: Ref, + rhs: Val, + max_abs_diff: f64, + ) { + let output: bool = bevy::math::DAffine2::abs_diff_eq( + &_self, + rhs.into_inner(), + max_abs_diff, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq(_self: Ref, rhs: Ref) { + let output: bool = >::eq(&_self, &rhs) + .into(); + output + } + fn from_angle(angle: f64) { + let output: Val = bevy::math::DAffine2::from_angle(angle) + .into(); + output + } + fn from_angle_translation(angle: f64, translation: Val) { + let output: Val = bevy::math::DAffine2::from_angle_translation( + angle, + translation.into_inner(), + ) + .into(); + output + } + fn from_cols( + x_axis: Val, + y_axis: Val, + z_axis: Val, + ) { + let output: Val = bevy::math::DAffine2::from_cols( + x_axis.into_inner(), + y_axis.into_inner(), + z_axis.into_inner(), + ) + .into(); + output + } + fn from_mat2(matrix2: Val) { + let output: Val = bevy::math::DAffine2::from_mat2( + matrix2.into_inner(), + ) + .into(); + output + } + fn from_mat2_translation( + matrix2: Val, + translation: Val, + ) { + let output: Val = bevy::math::DAffine2::from_mat2_translation( + matrix2.into_inner(), + translation.into_inner(), + ) + .into(); + output + } + fn from_mat3(m: Val) { + let output: Val = bevy::math::DAffine2::from_mat3( + m.into_inner(), + ) + .into(); + output + } + fn from_scale(scale: Val) { + let output: Val = bevy::math::DAffine2::from_scale( + scale.into_inner(), + ) + .into(); + output + } + fn from_scale_angle_translation( + scale: Val, + angle: f64, + translation: Val, + ) { + let output: Val = bevy::math::DAffine2::from_scale_angle_translation( + scale.into_inner(), + angle, + translation.into_inner(), + ) + .into(); + output + } + fn from_translation(translation: Val) { + let output: Val = bevy::math::DAffine2::from_translation( + translation.into_inner(), + ) + .into(); + output + } + fn inverse(_self: Ref) { + let output: Val = bevy::math::DAffine2::inverse(&_self) + .into(); + output + } + fn is_finite(_self: Ref) { + let output: bool = bevy::math::DAffine2::is_finite(&_self).into(); + output + } + fn is_nan(_self: Ref) { + let output: bool = bevy::math::DAffine2::is_nan(&_self).into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn to_cols_array(_self: Ref) { + let output: [f64; 6] = bevy::math::DAffine2::to_cols_array(&_self).into(); + output + } + fn to_cols_array_2d(_self: Ref) { + let output: [[f64; 2]; 3] = bevy::math::DAffine2::to_cols_array_2d(&_self) + .into(); + output + } + fn transform_point2(_self: Ref, rhs: Val) { + let output: Val = bevy::math::DAffine2::transform_point2( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn transform_vector2(_self: Ref, rhs: Val) { + let output: Val = bevy::math::DAffine2::transform_vector2( + &_self, + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "d_affine_3")] +impl bevy::math::DAffine3 { + fn abs_diff_eq( + _self: Ref, + rhs: Val, + max_abs_diff: f64, + ) { + let output: bool = bevy::math::DAffine3::abs_diff_eq( + &_self, + rhs.into_inner(), + max_abs_diff, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq(_self: Ref, rhs: Ref) { + let output: bool = >::eq(&_self, &rhs) + .into(); + output + } + fn from_axis_angle(axis: Val, angle: f64) { + let output: Val = bevy::math::DAffine3::from_axis_angle( + axis.into_inner(), + angle, + ) + .into(); + output + } + fn from_cols( + x_axis: Val, + y_axis: Val, + z_axis: Val, + w_axis: Val, + ) { + let output: Val = bevy::math::DAffine3::from_cols( + x_axis.into_inner(), + y_axis.into_inner(), + z_axis.into_inner(), + w_axis.into_inner(), + ) + .into(); + output + } + fn from_mat3(mat3: Val) { + let output: Val = bevy::math::DAffine3::from_mat3( + mat3.into_inner(), + ) + .into(); + output + } + fn from_mat3_translation( + mat3: Val, + translation: Val, + ) { + let output: Val = bevy::math::DAffine3::from_mat3_translation( + mat3.into_inner(), + translation.into_inner(), + ) + .into(); + output + } + fn from_mat4(m: Val) { + let output: Val = bevy::math::DAffine3::from_mat4( + m.into_inner(), + ) + .into(); + output + } + fn from_quat(rotation: Val) { + let output: Val = bevy::math::DAffine3::from_quat( + rotation.into_inner(), + ) + .into(); + output + } + fn from_rotation_translation( + rotation: Val, + translation: Val, + ) { + let output: Val = bevy::math::DAffine3::from_rotation_translation( + rotation.into_inner(), + translation.into_inner(), + ) + .into(); + output + } + fn from_rotation_x(angle: f64) { + let output: Val = bevy::math::DAffine3::from_rotation_x( + angle, + ) + .into(); + output + } + fn from_rotation_y(angle: f64) { + let output: Val = bevy::math::DAffine3::from_rotation_y( + angle, + ) + .into(); + output + } + fn from_rotation_z(angle: f64) { + let output: Val = bevy::math::DAffine3::from_rotation_z( + angle, + ) + .into(); + output + } + fn from_scale(scale: Val) { + let output: Val = bevy::math::DAffine3::from_scale( + scale.into_inner(), + ) + .into(); + output + } + fn from_scale_rotation_translation( + scale: Val, + rotation: Val, + translation: Val, + ) { + let output: Val = bevy::math::DAffine3::from_scale_rotation_translation( + scale.into_inner(), + rotation.into_inner(), + translation.into_inner(), + ) + .into(); + output + } + fn from_translation(translation: Val) { + let output: Val = bevy::math::DAffine3::from_translation( + translation.into_inner(), + ) + .into(); + output + } + fn inverse(_self: Ref) { + let output: Val = bevy::math::DAffine3::inverse(&_self) + .into(); + output + } + fn is_finite(_self: Ref) { + let output: bool = bevy::math::DAffine3::is_finite(&_self).into(); + output + } + fn is_nan(_self: Ref) { + let output: bool = bevy::math::DAffine3::is_nan(&_self).into(); + output + } + fn look_at_lh( + eye: Val, + center: Val, + up: Val, + ) { + let output: Val = bevy::math::DAffine3::look_at_lh( + eye.into_inner(), + center.into_inner(), + up.into_inner(), + ) + .into(); + output + } + fn look_at_rh( + eye: Val, + center: Val, + up: Val, + ) { + let output: Val = bevy::math::DAffine3::look_at_rh( + eye.into_inner(), + center.into_inner(), + up.into_inner(), + ) + .into(); + output + } + fn look_to_lh( + eye: Val, + dir: Val, + up: Val, + ) { + let output: Val = bevy::math::DAffine3::look_to_lh( + eye.into_inner(), + dir.into_inner(), + up.into_inner(), + ) + .into(); + output + } + fn look_to_rh( + eye: Val, + dir: Val, + up: Val, + ) { + let output: Val = bevy::math::DAffine3::look_to_rh( + eye.into_inner(), + dir.into_inner(), + up.into_inner(), + ) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn to_cols_array(_self: Ref) { + let output: [f64; 12] = bevy::math::DAffine3::to_cols_array(&_self).into(); + output + } + fn to_cols_array_2d(_self: Ref) { + let output: [[f64; 3]; 4] = bevy::math::DAffine3::to_cols_array_2d(&_self) + .into(); + output + } + fn transform_point3(_self: Ref, rhs: Val) { + let output: Val = bevy::math::DAffine3::transform_point3( + &_self, + rhs.into_inner(), + ) + .into(); + output + } + fn transform_vector3(_self: Ref, rhs: Val) { + let output: Val = bevy::math::DAffine3::transform_vector3( + &_self, + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings(remote, name = "d_quat")] +impl bevy::math::DQuat { + fn abs_diff_eq( + _self: Val, + rhs: Val, + max_abs_diff: f64, + ) { + let output: bool = bevy::math::DQuat::abs_diff_eq( + _self.into_inner(), + rhs.into_inner(), + max_abs_diff, + ) + .into(); + output + } + fn add(_self: Val, rhs: Val) { + let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn angle_between(_self: Val, rhs: Val) { + let output: f64 = bevy::math::DQuat::angle_between( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn as_quat(_self: Val) { + let output: Val = bevy::math::DQuat::as_quat( + _self.into_inner(), + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn conjugate(_self: Val) { + let output: Val = bevy::math::DQuat::conjugate( + _self.into_inner(), + ) + .into(); + output + } + fn div(_self: Val, rhs: f64) { + let output: Val = >::div(_self.into_inner(), rhs) + .into(); + output + } + fn dot(_self: Val, rhs: Val) { + let output: f64 = bevy::math::DQuat::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn eq(_self: Ref, rhs: Ref) { + let output: bool = >::eq(&_self, &rhs) + .into(); + output + } + fn from_affine3(a: Ref) { + let output: Val = bevy::math::DQuat::from_affine3(&a).into(); + output + } + fn from_array(a: [f64; 4]) { + let output: Val = bevy::math::DQuat::from_array(a).into(); + output + } + fn from_axis_angle(axis: Val, angle: f64) { + let output: Val = bevy::math::DQuat::from_axis_angle( + axis.into_inner(), + angle, + ) + .into(); + output + } + fn from_euler(euler: Val, a: f64, b: f64, c: f64) { + let output: Val = bevy::math::DQuat::from_euler( + euler.into_inner(), + a, + b, + c, + ) + .into(); + output + } + fn from_mat3(mat: Ref) { + let output: Val = bevy::math::DQuat::from_mat3(&mat).into(); + output + } + fn from_mat4(mat: Ref) { + let output: Val = bevy::math::DQuat::from_mat4(&mat).into(); + output + } + fn from_rotation_arc(from: Val, to: Val) { + let output: Val = bevy::math::DQuat::from_rotation_arc( + from.into_inner(), + to.into_inner(), + ) + .into(); + output + } + fn from_rotation_arc_2d(from: Val, to: Val) { + let output: Val = bevy::math::DQuat::from_rotation_arc_2d( + from.into_inner(), + to.into_inner(), + ) + .into(); + output + } + fn from_rotation_arc_colinear( + from: Val, + to: Val, + ) { + let output: Val = bevy::math::DQuat::from_rotation_arc_colinear( + from.into_inner(), + to.into_inner(), + ) + .into(); + output + } + fn from_rotation_x(angle: f64) { + let output: Val = bevy::math::DQuat::from_rotation_x(angle) + .into(); + output + } + fn from_rotation_y(angle: f64) { + let output: Val = bevy::math::DQuat::from_rotation_y(angle) + .into(); + output + } + fn from_rotation_z(angle: f64) { + let output: Val = bevy::math::DQuat::from_rotation_z(angle) + .into(); + output + } + fn from_scaled_axis(v: Val) { + let output: Val = bevy::math::DQuat::from_scaled_axis( + v.into_inner(), + ) + .into(); + output + } + fn from_vec4(v: Val) { + let output: Val = bevy::math::DQuat::from_vec4(v.into_inner()) + .into(); + output + } + fn from_xyzw(x: f64, y: f64, z: f64, w: f64) { + let output: Val = bevy::math::DQuat::from_xyzw(x, y, z, w) + .into(); + output + } + fn inverse(_self: Val) { + let output: Val = bevy::math::DQuat::inverse( + _self.into_inner(), + ) + .into(); + output + } + fn is_finite(_self: Val) { + let output: bool = bevy::math::DQuat::is_finite(_self.into_inner()).into(); + output + } + fn is_nan(_self: Val) { + let output: bool = bevy::math::DQuat::is_nan(_self.into_inner()).into(); + output + } + fn is_near_identity(_self: Val) { + let output: bool = bevy::math::DQuat::is_near_identity(_self.into_inner()) + .into(); + output + } + fn is_normalized(_self: Val) { + let output: bool = bevy::math::DQuat::is_normalized(_self.into_inner()).into(); + output + } + fn length(_self: Val) { + let output: f64 = bevy::math::DQuat::length(_self.into_inner()).into(); + output + } + fn length_recip(_self: Val) { + let output: f64 = bevy::math::DQuat::length_recip(_self.into_inner()).into(); + output + } + fn length_squared(_self: Val) { + let output: f64 = bevy::math::DQuat::length_squared(_self.into_inner()).into(); + output + } + fn lerp(_self: Val, end: Val, s: f64) { + let output: Val = bevy::math::DQuat::lerp( + _self.into_inner(), + end.into_inner(), + s, + ) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: Val) { + let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn mul(_self: Val, rhs: f64) { + let output: Val = >::mul(_self.into_inner(), rhs) + .into(); + output + } + fn mul_quat(_self: Val, rhs: Val) { + let output: Val = bevy::math::DQuat::mul_quat( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn mul_vec3(_self: Val, rhs: Val) { + let output: Val = bevy::math::DQuat::mul_vec3( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + fn neg(_self: Val) { + let output: Val = ::neg( + _self.into_inner(), + ) + .into(); + output + } + fn normalize(_self: Val) { + let output: Val = bevy::math::DQuat::normalize( + _self.into_inner(), + ) + .into(); + output + } + fn rotate_towards( + _self: Ref, + rhs: Val, + max_angle: f64, + ) { + let output: Val = bevy::math::DQuat::rotate_towards( + &_self, + rhs.into_inner(), + max_angle, + ) + .into(); + output + } + fn slerp(_self: Val, end: Val, s: f64) { + let output: Val = bevy::math::DQuat::slerp( + _self.into_inner(), + end.into_inner(), + s, + ) + .into(); + output + } + fn sub(_self: Val, rhs: Val) { + let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + fn to_array(_self: Ref) { + let output: [f64; 4] = bevy::math::DQuat::to_array(&_self).into(); + output + } + fn to_euler(_self: Val, order: Val) { + let output: (f64, f64, f64) = bevy::math::DQuat::to_euler( + _self.into_inner(), + order.into_inner(), + ) + .into(); + output + } + fn to_scaled_axis(_self: Val) { + let output: Val = bevy::math::DQuat::to_scaled_axis( + _self.into_inner(), + ) + .into(); + output + } + fn xyz(_self: Val) { + let output: Val = bevy::math::DQuat::xyz(_self.into_inner()) + .into(); + output + } +} +#[script_bindings(remote, name = "euler_rot")] +impl bevy::math::EulerRot { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "b_vec_3_a")] +impl bevy::math::BVec3A { + fn all(_self: Val) { + let output: bool = bevy::math::BVec3A::all(_self.into_inner()).into(); + output + } + fn any(_self: Val) { + let output: bool = bevy::math::BVec3A::any(_self.into_inner()).into(); + output + } + fn bitmask(_self: Val) { + let output: u32 = bevy::math::BVec3A::bitmask(_self.into_inner()).into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq(_self: Ref, rhs: Ref) { + let output: bool = >::eq(&_self, &rhs) + .into(); + output + } + fn from_array(a: [bool; 3]) { + let output: Val = bevy::math::BVec3A::from_array(a).into(); + output + } + fn new(x: bool, y: bool, z: bool) { + let output: Val = bevy::math::BVec3A::new(x, y, z).into(); + output + } + fn set(mut _self: Mut, index: usize, value: bool) { + let output: () = bevy::math::BVec3A::set(&mut _self, index, value).into(); + output + } + fn splat(v: bool) { + let output: Val = bevy::math::BVec3A::splat(v).into(); + output + } + fn test(_self: Ref, index: usize) { + let output: bool = bevy::math::BVec3A::test(&_self, index).into(); + output + } +} +#[script_bindings(remote, name = "b_vec_4_a")] +impl bevy::math::BVec4A { + fn all(_self: Val) { + let output: bool = bevy::math::BVec4A::all(_self.into_inner()).into(); + output + } + fn any(_self: Val) { + let output: bool = bevy::math::BVec4A::any(_self.into_inner()).into(); + output + } + fn bitmask(_self: Val) { + let output: u32 = bevy::math::BVec4A::bitmask(_self.into_inner()).into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq(_self: Ref, rhs: Ref) { + let output: bool = >::eq(&_self, &rhs) + .into(); + output + } + fn from_array(a: [bool; 4]) { + let output: Val = bevy::math::BVec4A::from_array(a).into(); + output + } + fn new(x: bool, y: bool, z: bool, w: bool) { + let output: Val = bevy::math::BVec4A::new(x, y, z, w).into(); + output + } + fn set(mut _self: Mut, index: usize, value: bool) { + let output: () = bevy::math::BVec4A::set(&mut _self, index, value).into(); + output + } + fn splat(v: bool) { + let output: Val = bevy::math::BVec4A::splat(v).into(); + output + } + fn test(_self: Ref, index: usize) { + let output: bool = bevy::math::BVec4A::test(&_self, index).into(); + output + } +} +#[script_bindings(remote, name = "smol_str")] +impl smol_str::SmolStr { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn is_empty(_self: Ref) { + let output: bool = smol_str::SmolStr::is_empty(&_self).into(); + output + } + fn is_heap_allocated(_self: Ref) { + let output: bool = smol_str::SmolStr::is_heap_allocated(&_self).into(); + output + } + fn len(_self: Ref) { + let output: usize = smol_str::SmolStr::len(&_self).into(); + output + } + fn to_string(_self: Ref) { + let output: std::string::String = smol_str::SmolStr::to_string(&_self).into(); + output + } +} +#[script_bindings(remote, name = "uuid")] +impl uuid::Uuid { + fn as_u128(_self: Ref) { + let output: u128 = uuid::Uuid::as_u128(&_self).into(); + output + } + fn as_u64_pair(_self: Ref) { + let output: (u64, u64) = uuid::Uuid::as_u64_pair(&_self).into(); + output + } + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn encode_buffer() { + let output: [u8; 45] = uuid::Uuid::encode_buffer().into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn from_bytes(bytes: [u8; 16]) { + let output: Val = uuid::Uuid::from_bytes(bytes).into(); + output + } + fn from_bytes_le(b: [u8; 16]) { + let output: Val = uuid::Uuid::from_bytes_le(b).into(); + output + } + fn from_u128(v: u128) { + let output: Val = uuid::Uuid::from_u128(v).into(); + output + } + fn from_u128_le(v: u128) { + let output: Val = uuid::Uuid::from_u128_le(v).into(); + output + } + fn from_u64_pair(high_bits: u64, low_bits: u64) { + let output: Val = uuid::Uuid::from_u64_pair(high_bits, low_bits) + .into(); + output + } + fn get_node_id(_self: Ref) { + let output: bevy::reflect::erased_serde::__private::serde::__private::Option< + [u8; 6], + > = uuid::Uuid::get_node_id(&_self).into(); + output + } + fn get_version_num(_self: Ref) { + let output: usize = uuid::Uuid::get_version_num(&_self).into(); + output + } + fn into_bytes(_self: Val) { + let output: [u8; 16] = uuid::Uuid::into_bytes(_self.into_inner()).into(); + output + } + fn is_max(_self: Ref) { + let output: bool = uuid::Uuid::is_max(&_self).into(); + output + } + fn is_nil(_self: Ref) { + let output: bool = uuid::Uuid::is_nil(&_self).into(); + output + } + fn max() { + let output: Val = uuid::Uuid::max().into(); + output + } + fn new_v4() { + let output: Val = uuid::Uuid::new_v4().into(); + output + } + fn nil() { + let output: Val = uuid::Uuid::nil().into(); + output + } + fn to_bytes_le(_self: Ref) { + let output: [u8; 16] = uuid::Uuid::to_bytes_le(&_self).into(); + output + } + fn to_u128_le(_self: Ref) { + let output: u128 = uuid::Uuid::to_u128_le(&_self).into(); + output + } +} impl ::bevy::app::Plugin for BevyReflectScriptingPlugin { fn build(&self, app: &mut ::bevy::prelude::App) { let mut world = app.world_mut(); - NamespaceBuilder::<::std::sync::atomic::AtomicBool>::new(world) - .register( - "into_inner", - |_self: Val| { - let output: bool = std::sync::atomic::AtomicBool::into_inner( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |v: bool| { - let output: Val = std::sync::atomic::AtomicBool::new( - v, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::std::sync::atomic::AtomicI16>::new(world) - .register( - "into_inner", - |_self: Val| { - let output: i16 = std::sync::atomic::AtomicI16::into_inner( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |v: i16| { - let output: Val = std::sync::atomic::AtomicI16::new( - v, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::std::sync::atomic::AtomicI32>::new(world) - .register( - "into_inner", - |_self: Val| { - let output: i32 = std::sync::atomic::AtomicI32::into_inner( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |v: i32| { - let output: Val = std::sync::atomic::AtomicI32::new( - v, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::std::sync::atomic::AtomicI64>::new(world) - .register( - "into_inner", - |_self: Val| { - let output: i64 = std::sync::atomic::AtomicI64::into_inner( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |v: i64| { - let output: Val = std::sync::atomic::AtomicI64::new( - v, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::std::sync::atomic::AtomicI8>::new(world) - .register( - "into_inner", - |_self: Val| { - let output: i8 = std::sync::atomic::AtomicI8::into_inner( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |v: i8| { - let output: Val = std::sync::atomic::AtomicI8::new( - v, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::std::sync::atomic::AtomicIsize>::new(world) - .register( - "into_inner", - |_self: Val| { - let output: isize = std::sync::atomic::AtomicIsize::into_inner( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |v: isize| { - let output: Val = std::sync::atomic::AtomicIsize::new( - v, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::std::sync::atomic::AtomicU16>::new(world) - .register( - "into_inner", - |_self: Val| { - let output: u16 = std::sync::atomic::AtomicU16::into_inner( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |v: u16| { - let output: Val = std::sync::atomic::AtomicU16::new( - v, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::std::sync::atomic::AtomicU32>::new(world) - .register( - "into_inner", - |_self: Val| { - let output: u32 = std::sync::atomic::AtomicU32::into_inner( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |v: u32| { - let output: Val = std::sync::atomic::AtomicU32::new( - v, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::std::sync::atomic::AtomicU64>::new(world) - .register( - "into_inner", - |_self: Val| { - let output: u64 = std::sync::atomic::AtomicU64::into_inner( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |v: u64| { - let output: Val = std::sync::atomic::AtomicU64::new( - v, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::std::sync::atomic::AtomicU8>::new(world) - .register( - "into_inner", - |_self: Val| { - let output: u8 = std::sync::atomic::AtomicU8::into_inner( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |v: u8| { - let output: Val = std::sync::atomic::AtomicU8::new( - v, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::std::sync::atomic::AtomicUsize>::new(world) - .register( - "into_inner", - |_self: Val| { - let output: usize = std::sync::atomic::AtomicUsize::into_inner( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |v: usize| { - let output: Val = std::sync::atomic::AtomicUsize::new( - v, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::utils::Duration>::new(world) - .register( - "abs_diff", - |_self: Val, other: Val| { - let output: Val = bevy::utils::Duration::abs_diff( - _self.into_inner(), - other.into_inner(), - ) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "as_micros", - |_self: Ref| { - let output: u128 = bevy::utils::Duration::as_micros(&_self).into(); - output - }, - ) - .register( - "as_millis", - |_self: Ref| { - let output: u128 = bevy::utils::Duration::as_millis(&_self).into(); - output - }, - ) - .register( - "as_nanos", - |_self: Ref| { - let output: u128 = bevy::utils::Duration::as_nanos(&_self).into(); - output - }, - ) - .register( - "as_secs", - |_self: Ref| { - let output: u64 = bevy::utils::Duration::as_secs(&_self).into(); - output - }, - ) - .register( - "as_secs_f32", - |_self: Ref| { - let output: f32 = bevy::utils::Duration::as_secs_f32(&_self).into(); - output - }, - ) - .register( - "as_secs_f64", - |_self: Ref| { - let output: f64 = bevy::utils::Duration::as_secs_f64(&_self).into(); - output - }, - ) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: u32| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "div_duration_f32", - |_self: Val, rhs: Val| { - let output: f32 = bevy::utils::Duration::div_duration_f32( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "div_duration_f64", - |_self: Val, rhs: Val| { - let output: f64 = bevy::utils::Duration::div_duration_f64( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "div_f32", - |_self: Val, rhs: f32| { - let output: Val = bevy::utils::Duration::div_f32( - _self.into_inner(), - rhs, - ) - .into(); - output - }, - ) - .register( - "div_f64", - |_self: Val, rhs: f64| { - let output: Val = bevy::utils::Duration::div_f64( - _self.into_inner(), - rhs, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "from_micros", - |micros: u64| { - let output: Val = bevy::utils::Duration::from_micros( - micros, - ) - .into(); - output - }, - ) - .register( - "from_millis", - |millis: u64| { - let output: Val = bevy::utils::Duration::from_millis( - millis, - ) - .into(); - output - }, - ) - .register( - "from_nanos", - |nanos: u64| { - let output: Val = bevy::utils::Duration::from_nanos( - nanos, - ) - .into(); - output - }, - ) - .register( - "from_secs", - |secs: u64| { - let output: Val = bevy::utils::Duration::from_secs( - secs, - ) - .into(); - output - }, - ) - .register( - "from_secs_f32", - |secs: f32| { - let output: Val = bevy::utils::Duration::from_secs_f32( - secs, - ) - .into(); - output - }, - ) - .register( - "from_secs_f64", - |secs: f64| { - let output: Val = bevy::utils::Duration::from_secs_f64( - secs, - ) - .into(); - output - }, - ) - .register( - "is_zero", - |_self: Ref| { - let output: bool = bevy::utils::Duration::is_zero(&_self).into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: u32| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "mul_f32", - |_self: Val, rhs: f32| { - let output: Val = bevy::utils::Duration::mul_f32( - _self.into_inner(), - rhs, - ) - .into(); - output - }, - ) - .register( - "mul_f64", - |_self: Val, rhs: f64| { - let output: Val = bevy::utils::Duration::mul_f64( - _self.into_inner(), - rhs, - ) - .into(); - output - }, - ) - .register( - "new", - |secs: u64, nanos: u32| { - let output: Val = bevy::utils::Duration::new( - secs, - nanos, - ) - .into(); - output - }, - ) - .register( - "saturating_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::utils::Duration::saturating_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_mul", - |_self: Val, rhs: u32| { - let output: Val = bevy::utils::Duration::saturating_mul( - _self.into_inner(), - rhs, - ) - .into(); - output - }, - ) - .register( - "saturating_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::utils::Duration::saturating_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "subsec_micros", - |_self: Ref| { - let output: u32 = bevy::utils::Duration::subsec_micros(&_self) - .into(); - output - }, - ) - .register( - "subsec_millis", - |_self: Ref| { - let output: u32 = bevy::utils::Duration::subsec_millis(&_self) - .into(); - output - }, - ) - .register( - "subsec_nanos", - |_self: Ref| { - let output: u32 = bevy::utils::Duration::subsec_nanos(&_self).into(); - output - }, - ); - NamespaceBuilder::<::bevy::utils::Instant>::new(world) - .register( - "add", - |_self: Val, other: Val| { - let output: Val = >::add(_self.into_inner(), other.into_inner()) - .into(); - output - }, - ) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "duration_since", - |_self: Ref, earlier: Val| { - let output: Val = bevy::utils::Instant::duration_since( - &_self, - earlier.into_inner(), - ) - .into(); - output - }, - ) - .register( - "elapsed", - |_self: Ref| { - let output: Val = bevy::utils::Instant::elapsed( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "now", - || { - let output: Val = bevy::utils::Instant::now() - .into(); - output - }, - ) - .register( - "saturating_duration_since", - |_self: Ref, earlier: Val| { - let output: Val = bevy::utils::Instant::saturating_duration_since( - &_self, - earlier.into_inner(), - ) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, other: Val| { - let output: Val = >::sub(_self.into_inner(), other.into_inner()) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, other: Val| { - let output: Val = >::sub(_self.into_inner(), other.into_inner()) - .into(); - output - }, - ); - NamespaceBuilder::<::std::ops::RangeFull>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::Quat>::new(world) - .register( - "abs_diff_eq", - | - _self: Val, - rhs: Val, - max_abs_diff: f32| - { - let output: bool = bevy::math::Quat::abs_diff_eq( - _self.into_inner(), - rhs.into_inner(), - max_abs_diff, - ) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "angle_between", - |_self: Val, rhs: Val| { - let output: f32 = bevy::math::Quat::angle_between( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "as_dquat", - |_self: Val| { - let output: Val = bevy::math::Quat::as_dquat( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "conjugate", - |_self: Val| { - let output: Val = bevy::math::Quat::conjugate( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: f32| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "dot", - |_self: Val, rhs: Val| { - let output: f32 = bevy::math::Quat::dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, rhs: Ref| { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - }, - ) - .register( - "from_affine3", - |a: Ref| { - let output: Val = bevy::math::Quat::from_affine3( - &a, - ) - .into(); - output - }, - ) - .register( - "from_array", - |a: [f32; 4]| { - let output: Val = bevy::math::Quat::from_array(a) - .into(); - output - }, - ) - .register( - "from_axis_angle", - |axis: Val, angle: f32| { - let output: Val = bevy::math::Quat::from_axis_angle( - axis.into_inner(), - angle, - ) - .into(); - output - }, - ) - .register( - "from_euler", - |euler: Val, a: f32, b: f32, c: f32| { - let output: Val = bevy::math::Quat::from_euler( - euler.into_inner(), - a, - b, - c, - ) - .into(); - output - }, - ) - .register( - "from_mat3", - |mat: Ref| { - let output: Val = bevy::math::Quat::from_mat3(&mat) - .into(); - output - }, - ) - .register( - "from_mat3a", - |mat: Ref| { - let output: Val = bevy::math::Quat::from_mat3a( - &mat, - ) - .into(); - output - }, - ) - .register( - "from_mat4", - |mat: Ref| { - let output: Val = bevy::math::Quat::from_mat4(&mat) - .into(); - output - }, - ) - .register( - "from_rotation_arc", - |from: Val, to: Val| { - let output: Val = bevy::math::Quat::from_rotation_arc( - from.into_inner(), - to.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_rotation_arc_2d", - |from: Val, to: Val| { - let output: Val = bevy::math::Quat::from_rotation_arc_2d( - from.into_inner(), - to.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_rotation_arc_colinear", - |from: Val, to: Val| { - let output: Val = bevy::math::Quat::from_rotation_arc_colinear( - from.into_inner(), - to.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_rotation_x", - |angle: f32| { - let output: Val = bevy::math::Quat::from_rotation_x( - angle, - ) - .into(); - output - }, - ) - .register( - "from_rotation_y", - |angle: f32| { - let output: Val = bevy::math::Quat::from_rotation_y( - angle, - ) - .into(); - output - }, - ) - .register( - "from_rotation_z", - |angle: f32| { - let output: Val = bevy::math::Quat::from_rotation_z( - angle, - ) - .into(); - output - }, - ) - .register( - "from_scaled_axis", - |v: Val| { - let output: Val = bevy::math::Quat::from_scaled_axis( - v.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_vec4", - |v: Val| { - let output: Val = bevy::math::Quat::from_vec4( - v.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_xyzw", - |x: f32, y: f32, z: f32, w: f32| { - let output: Val = bevy::math::Quat::from_xyzw( - x, - y, - z, - w, - ) - .into(); - output - }, - ) - .register( - "inverse", - |_self: Val| { - let output: Val = bevy::math::Quat::inverse( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_finite", - |_self: Val| { - let output: bool = bevy::math::Quat::is_finite(_self.into_inner()) - .into(); - output - }, - ) - .register( - "is_nan", - |_self: Val| { - let output: bool = bevy::math::Quat::is_nan(_self.into_inner()) - .into(); - output - }, - ) - .register( - "is_near_identity", - |_self: Val| { - let output: bool = bevy::math::Quat::is_near_identity( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_normalized", - |_self: Val| { - let output: bool = bevy::math::Quat::is_normalized( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "length", - |_self: Val| { - let output: f32 = bevy::math::Quat::length(_self.into_inner()) - .into(); - output - }, - ) - .register( - "length_recip", - |_self: Val| { - let output: f32 = bevy::math::Quat::length_recip(_self.into_inner()) - .into(); - output - }, - ) - .register( - "length_squared", - |_self: Val| { - let output: f32 = bevy::math::Quat::length_squared( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "lerp", - |_self: Val, end: Val, s: f32| { - let output: Val = bevy::math::Quat::lerp( - _self.into_inner(), - end.into_inner(), - s, - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: f32| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "mul_quat", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Quat::mul_quat( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "mul_vec3", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Quat::mul_vec3( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "mul_vec3a", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Quat::mul_vec3a( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "normalize", - |_self: Val| { - let output: Val = bevy::math::Quat::normalize( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rotate_towards", - | - _self: Ref, - rhs: Val, - max_angle: f32| - { - let output: Val = bevy::math::Quat::rotate_towards( - &_self, - rhs.into_inner(), - max_angle, - ) - .into(); - output - }, - ) - .register( - "slerp", - |_self: Val, end: Val, s: f32| { - let output: Val = bevy::math::Quat::slerp( - _self.into_inner(), - end.into_inner(), - s, - ) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "to_array", - |_self: Ref| { - let output: [f32; 4] = bevy::math::Quat::to_array(&_self).into(); - output - }, - ) - .register( - "to_euler", - |_self: Val, order: Val| { - let output: (f32, f32, f32) = bevy::math::Quat::to_euler( - _self.into_inner(), - order.into_inner(), - ) - .into(); - output - }, - ) - .register( - "to_scaled_axis", - |_self: Val| { - let output: Val = bevy::math::Quat::to_scaled_axis( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "xyz", - |_self: Val| { - let output: Val = bevy::math::Quat::xyz( - _self.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::Vec3>::new(world) - .register( - "abs", - |_self: Val| { - let output: Val = bevy::math::Vec3::abs( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "abs_diff_eq", - | - _self: Val, - rhs: Val, - max_abs_diff: f32| - { - let output: bool = bevy::math::Vec3::abs_diff_eq( - _self.into_inner(), - rhs.into_inner(), - max_abs_diff, - ) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Ref| { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: f32| { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "angle_between", - |_self: Val, rhs: Val| { - let output: f32 = bevy::math::Vec3::angle_between( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "any_orthogonal_vector", - |_self: Ref| { - let output: Val = bevy::math::Vec3::any_orthogonal_vector( - &_self, - ) - .into(); - output - }, - ) - .register( - "any_orthonormal_vector", - |_self: Ref| { - let output: Val = bevy::math::Vec3::any_orthonormal_vector( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_dvec3", - |_self: Ref| { - let output: Val = bevy::math::Vec3::as_dvec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_i64vec3", - |_self: Ref| { - let output: Val = bevy::math::Vec3::as_i64vec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_ivec3", - |_self: Ref| { - let output: Val = bevy::math::Vec3::as_ivec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_u64vec3", - |_self: Ref| { - let output: Val = bevy::math::Vec3::as_u64vec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_uvec3", - |_self: Ref| { - let output: Val = bevy::math::Vec3::as_uvec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "ceil", - |_self: Val| { - let output: Val = bevy::math::Vec3::ceil( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clamp", - | - _self: Val, - min: Val, - max: Val| - { - let output: Val = bevy::math::Vec3::clamp( - _self.into_inner(), - min.into_inner(), - max.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clamp_length", - |_self: Val, min: f32, max: f32| { - let output: Val = bevy::math::Vec3::clamp_length( - _self.into_inner(), - min, - max, - ) - .into(); - output - }, - ) - .register( - "clamp_length_max", - |_self: Val, max: f32| { - let output: Val = bevy::math::Vec3::clamp_length_max( - _self.into_inner(), - max, - ) - .into(); - output - }, - ) - .register( - "clamp_length_min", - |_self: Val, min: f32| { - let output: Val = bevy::math::Vec3::clamp_length_min( - _self.into_inner(), - min, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "cmpeq", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3::cmpeq( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpge", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3::cmpge( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpgt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3::cmpgt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmple", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3::cmple( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmplt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3::cmplt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpne", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3::cmpne( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "copysign", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3::copysign( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cross", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3::cross( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "distance", - |_self: Val, rhs: Val| { - let output: f32 = bevy::math::Vec3::distance( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "distance_squared", - |_self: Val, rhs: Val| { - let output: f32 = bevy::math::Vec3::distance_squared( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Ref| { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Val| { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: f32| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "div_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3::div_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot", - |_self: Val, rhs: Val| { - let output: f32 = bevy::math::Vec3::dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot_into_vec", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3::dot_into_vec( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_product", - |_self: Val| { - let output: f32 = bevy::math::Vec3::element_product( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_sum", - |_self: Val| { - let output: f32 = bevy::math::Vec3::element_sum(_self.into_inner()) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "exp", - |_self: Val| { - let output: Val = bevy::math::Vec3::exp( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "extend", - |_self: Val, w: f32| { - let output: Val = bevy::math::Vec3::extend( - _self.into_inner(), - w, - ) - .into(); - output - }, - ) - .register( - "floor", - |_self: Val| { - let output: Val = bevy::math::Vec3::floor( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "fract", - |_self: Val| { - let output: Val = bevy::math::Vec3::fract( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "fract_gl", - |_self: Val| { - let output: Val = bevy::math::Vec3::fract_gl( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_array", - |a: [f32; 3]| { - let output: Val = bevy::math::Vec3::from_array(a) - .into(); - output - }, - ) - .register( - "is_finite", - |_self: Val| { - let output: bool = bevy::math::Vec3::is_finite(_self.into_inner()) - .into(); - output - }, - ) - .register( - "is_finite_mask", - |_self: Val| { - let output: Val = bevy::math::Vec3::is_finite_mask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_nan", - |_self: Val| { - let output: bool = bevy::math::Vec3::is_nan(_self.into_inner()) - .into(); - output - }, - ) - .register( - "is_nan_mask", - |_self: Val| { - let output: Val = bevy::math::Vec3::is_nan_mask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_negative_bitmask", - |_self: Val| { - let output: u32 = bevy::math::Vec3::is_negative_bitmask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_normalized", - |_self: Val| { - let output: bool = bevy::math::Vec3::is_normalized( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "length", - |_self: Val| { - let output: f32 = bevy::math::Vec3::length(_self.into_inner()) - .into(); - output - }, - ) - .register( - "length_recip", - |_self: Val| { - let output: f32 = bevy::math::Vec3::length_recip(_self.into_inner()) - .into(); - output - }, - ) - .register( - "length_squared", - |_self: Val| { - let output: f32 = bevy::math::Vec3::length_squared( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "lerp", - |_self: Val, rhs: Val, s: f32| { - let output: Val = bevy::math::Vec3::lerp( - _self.into_inner(), - rhs.into_inner(), - s, - ) - .into(); - output - }, - ) - .register( - "max", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3::max( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max_element", - |_self: Val| { - let output: f32 = bevy::math::Vec3::max_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "midpoint", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3::midpoint( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3::min( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min_element", - |_self: Val| { - let output: f32 = bevy::math::Vec3::min_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "move_towards", - |_self: Ref, rhs: Val, d: f32| { - let output: Val = bevy::math::Vec3::move_towards( - &_self, - rhs.into_inner(), - d, - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Ref| { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: f32| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "mul_add", - | - _self: Val, - a: Val, - b: Val| - { - let output: Val = bevy::math::Vec3::mul_add( - _self.into_inner(), - a.into_inner(), - b.into_inner(), - ) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |x: f32, y: f32, z: f32| { - let output: Val = bevy::math::Vec3::new(x, y, z) - .into(); - output - }, - ) - .register( - "normalize", - |_self: Val| { - let output: Val = bevy::math::Vec3::normalize( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "normalize_or", - |_self: Val, fallback: Val| { - let output: Val = bevy::math::Vec3::normalize_or( - _self.into_inner(), - fallback.into_inner(), - ) - .into(); - output - }, - ) - .register( - "normalize_or_zero", - |_self: Val| { - let output: Val = bevy::math::Vec3::normalize_or_zero( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "powf", - |_self: Val, n: f32| { - let output: Val = bevy::math::Vec3::powf( - _self.into_inner(), - n, - ) - .into(); - output - }, - ) - .register( - "project_onto", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3::project_onto( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "project_onto_normalized", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3::project_onto_normalized( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "recip", - |_self: Val| { - let output: Val = bevy::math::Vec3::recip( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "reflect", - |_self: Val, normal: Val| { - let output: Val = bevy::math::Vec3::reflect( - _self.into_inner(), - normal.into_inner(), - ) - .into(); - output - }, - ) - .register( - "refract", - |_self: Val, normal: Val, eta: f32| { - let output: Val = bevy::math::Vec3::refract( - _self.into_inner(), - normal.into_inner(), - eta, - ) - .into(); - output - }, - ) - .register( - "reject_from", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3::reject_from( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "reject_from_normalized", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3::reject_from_normalized( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Ref| { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Val| { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: f32| { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "rem_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3::rem_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "round", - |_self: Val| { - let output: Val = bevy::math::Vec3::round( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "select", - | - mask: Val, - if_true: Val, - if_false: Val| - { - let output: Val = bevy::math::Vec3::select( - mask.into_inner(), - if_true.into_inner(), - if_false.into_inner(), - ) - .into(); - output - }, - ) - .register( - "signum", - |_self: Val| { - let output: Val = bevy::math::Vec3::signum( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "splat", - |v: f32| { - let output: Val = bevy::math::Vec3::splat(v) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Ref| { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: f32| { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "to_array", - |_self: Ref| { - let output: [f32; 3] = bevy::math::Vec3::to_array(&_self).into(); - output - }, - ) - .register( - "trunc", - |_self: Val| { - let output: Val = bevy::math::Vec3::trunc( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "truncate", - |_self: Val| { - let output: Val = bevy::math::Vec3::truncate( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "with_x", - |_self: Val, x: f32| { - let output: Val = bevy::math::Vec3::with_x( - _self.into_inner(), - x, - ) - .into(); - output - }, - ) - .register( - "with_y", - |_self: Val, y: f32| { - let output: Val = bevy::math::Vec3::with_y( - _self.into_inner(), - y, - ) - .into(); - output - }, - ) - .register( - "with_z", - |_self: Val, z: f32| { - let output: Val = bevy::math::Vec3::with_z( - _self.into_inner(), - z, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::IVec2>::new(world) - .register( - "abs", - |_self: Val| { - let output: Val = bevy::math::IVec2::abs( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Ref| { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: i32| { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "as_dvec2", - |_self: Ref| { - let output: Val = bevy::math::IVec2::as_dvec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_i64vec2", - |_self: Ref| { - let output: Val = bevy::math::IVec2::as_i64vec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_u64vec2", - |_self: Ref| { - let output: Val = bevy::math::IVec2::as_u64vec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_uvec2", - |_self: Ref| { - let output: Val = bevy::math::IVec2::as_uvec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_vec2", - |_self: Ref| { - let output: Val = bevy::math::IVec2::as_vec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clamp", - | - _self: Val, - min: Val, - max: Val| - { - let output: Val = bevy::math::IVec2::clamp( - _self.into_inner(), - min.into_inner(), - max.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "cmpeq", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::cmpeq( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpge", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::cmpge( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpgt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::cmpgt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmple", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::cmple( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmplt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::cmplt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpne", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::cmpne( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "distance_squared", - |_self: Val, rhs: Val| { - let output: i32 = bevy::math::IVec2::distance_squared( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Ref| { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Val| { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: i32| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "div_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::div_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot", - |_self: Val, rhs: Val| { - let output: i32 = bevy::math::IVec2::dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot_into_vec", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::dot_into_vec( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_product", - |_self: Val| { - let output: i32 = bevy::math::IVec2::element_product( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_sum", - |_self: Val| { - let output: i32 = bevy::math::IVec2::element_sum(_self.into_inner()) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "extend", - |_self: Val, z: i32| { - let output: Val = bevy::math::IVec2::extend( - _self.into_inner(), - z, - ) - .into(); - output - }, - ) - .register( - "from_array", - |a: [i32; 2]| { - let output: Val = bevy::math::IVec2::from_array(a) - .into(); - output - }, - ) - .register( - "is_negative_bitmask", - |_self: Val| { - let output: u32 = bevy::math::IVec2::is_negative_bitmask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "length_squared", - |_self: Val| { - let output: i32 = bevy::math::IVec2::length_squared( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::max( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max_element", - |_self: Val| { - let output: i32 = bevy::math::IVec2::max_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "min", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::min( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min_element", - |_self: Val| { - let output: i32 = bevy::math::IVec2::min_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Ref| { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: i32| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |x: i32, y: i32| { - let output: Val = bevy::math::IVec2::new(x, y) - .into(); - output - }, - ) - .register( - "perp", - |_self: Val| { - let output: Val = bevy::math::IVec2::perp( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "perp_dot", - |_self: Val, rhs: Val| { - let output: i32 = bevy::math::IVec2::perp_dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Ref| { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Val| { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: i32| { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "rem_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::rem_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rotate", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::rotate( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::saturating_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_add_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::saturating_add_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::saturating_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::saturating_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::saturating_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_sub_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::saturating_sub_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "select", - | - mask: Val, - if_true: Val, - if_false: Val| - { - let output: Val = bevy::math::IVec2::select( - mask.into_inner(), - if_true.into_inner(), - if_false.into_inner(), - ) - .into(); - output - }, - ) - .register( - "signum", - |_self: Val| { - let output: Val = bevy::math::IVec2::signum( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "splat", - |v: i32| { - let output: Val = bevy::math::IVec2::splat(v) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Ref| { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: i32| { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "to_array", - |_self: Ref| { - let output: [i32; 2] = bevy::math::IVec2::to_array(&_self).into(); - output - }, - ) - .register( - "with_x", - |_self: Val, x: i32| { - let output: Val = bevy::math::IVec2::with_x( - _self.into_inner(), - x, - ) - .into(); - output - }, - ) - .register( - "with_y", - |_self: Val, y: i32| { - let output: Val = bevy::math::IVec2::with_y( - _self.into_inner(), - y, - ) - .into(); - output - }, - ) - .register( - "wrapping_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::wrapping_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_add_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::wrapping_add_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::wrapping_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::wrapping_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::wrapping_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_sub_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec2::wrapping_sub_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::IVec3>::new(world) - .register( - "abs", - |_self: Val| { - let output: Val = bevy::math::IVec3::abs( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Ref| { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: i32| { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "as_dvec3", - |_self: Ref| { - let output: Val = bevy::math::IVec3::as_dvec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_i64vec3", - |_self: Ref| { - let output: Val = bevy::math::IVec3::as_i64vec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_u64vec3", - |_self: Ref| { - let output: Val = bevy::math::IVec3::as_u64vec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_uvec3", - |_self: Ref| { - let output: Val = bevy::math::IVec3::as_uvec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_vec3", - |_self: Ref| { - let output: Val = bevy::math::IVec3::as_vec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_vec3a", - |_self: Ref| { - let output: Val = bevy::math::IVec3::as_vec3a( - &_self, - ) - .into(); - output - }, - ) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clamp", - | - _self: Val, - min: Val, - max: Val| - { - let output: Val = bevy::math::IVec3::clamp( - _self.into_inner(), - min.into_inner(), - max.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "cmpeq", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::cmpeq( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpge", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::cmpge( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpgt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::cmpgt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmple", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::cmple( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmplt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::cmplt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpne", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::cmpne( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cross", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::cross( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "distance_squared", - |_self: Val, rhs: Val| { - let output: i32 = bevy::math::IVec3::distance_squared( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Ref| { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Val| { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: i32| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "div_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::div_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot", - |_self: Val, rhs: Val| { - let output: i32 = bevy::math::IVec3::dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot_into_vec", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::dot_into_vec( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_product", - |_self: Val| { - let output: i32 = bevy::math::IVec3::element_product( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_sum", - |_self: Val| { - let output: i32 = bevy::math::IVec3::element_sum(_self.into_inner()) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "extend", - |_self: Val, w: i32| { - let output: Val = bevy::math::IVec3::extend( - _self.into_inner(), - w, - ) - .into(); - output - }, - ) - .register( - "from_array", - |a: [i32; 3]| { - let output: Val = bevy::math::IVec3::from_array(a) - .into(); - output - }, - ) - .register( - "is_negative_bitmask", - |_self: Val| { - let output: u32 = bevy::math::IVec3::is_negative_bitmask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "length_squared", - |_self: Val| { - let output: i32 = bevy::math::IVec3::length_squared( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::max( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max_element", - |_self: Val| { - let output: i32 = bevy::math::IVec3::max_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "min", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::min( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min_element", - |_self: Val| { - let output: i32 = bevy::math::IVec3::min_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Ref| { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: i32| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |x: i32, y: i32, z: i32| { - let output: Val = bevy::math::IVec3::new(x, y, z) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Ref| { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Val| { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: i32| { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "rem_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::rem_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::saturating_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_add_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::saturating_add_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::saturating_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::saturating_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::saturating_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_sub_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::saturating_sub_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "select", - | - mask: Val, - if_true: Val, - if_false: Val| - { - let output: Val = bevy::math::IVec3::select( - mask.into_inner(), - if_true.into_inner(), - if_false.into_inner(), - ) - .into(); - output - }, - ) - .register( - "signum", - |_self: Val| { - let output: Val = bevy::math::IVec3::signum( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "splat", - |v: i32| { - let output: Val = bevy::math::IVec3::splat(v) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Ref| { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: i32| { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "to_array", - |_self: Ref| { - let output: [i32; 3] = bevy::math::IVec3::to_array(&_self).into(); - output - }, - ) - .register( - "truncate", - |_self: Val| { - let output: Val = bevy::math::IVec3::truncate( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "with_x", - |_self: Val, x: i32| { - let output: Val = bevy::math::IVec3::with_x( - _self.into_inner(), - x, - ) - .into(); - output - }, - ) - .register( - "with_y", - |_self: Val, y: i32| { - let output: Val = bevy::math::IVec3::with_y( - _self.into_inner(), - y, - ) - .into(); - output - }, - ) - .register( - "with_z", - |_self: Val, z: i32| { - let output: Val = bevy::math::IVec3::with_z( - _self.into_inner(), - z, - ) - .into(); - output - }, - ) - .register( - "wrapping_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::wrapping_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_add_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::wrapping_add_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::wrapping_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::wrapping_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::wrapping_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_sub_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec3::wrapping_sub_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::IVec4>::new(world) - .register( - "abs", - |_self: Val| { - let output: Val = bevy::math::IVec4::abs( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Ref| { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: i32| { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "as_dvec4", - |_self: Ref| { - let output: Val = bevy::math::IVec4::as_dvec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_i64vec4", - |_self: Ref| { - let output: Val = bevy::math::IVec4::as_i64vec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_u64vec4", - |_self: Ref| { - let output: Val = bevy::math::IVec4::as_u64vec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_uvec4", - |_self: Ref| { - let output: Val = bevy::math::IVec4::as_uvec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_vec4", - |_self: Ref| { - let output: Val = bevy::math::IVec4::as_vec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clamp", - | - _self: Val, - min: Val, - max: Val| - { - let output: Val = bevy::math::IVec4::clamp( - _self.into_inner(), - min.into_inner(), - max.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "cmpeq", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec4::cmpeq( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpge", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec4::cmpge( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpgt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec4::cmpgt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmple", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec4::cmple( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmplt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec4::cmplt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpne", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec4::cmpne( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "distance_squared", - |_self: Val, rhs: Val| { - let output: i32 = bevy::math::IVec4::distance_squared( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Ref| { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Val| { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: i32| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "div_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec4::div_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot", - |_self: Val, rhs: Val| { - let output: i32 = bevy::math::IVec4::dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot_into_vec", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec4::dot_into_vec( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_product", - |_self: Val| { - let output: i32 = bevy::math::IVec4::element_product( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_sum", - |_self: Val| { - let output: i32 = bevy::math::IVec4::element_sum(_self.into_inner()) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "from_array", - |a: [i32; 4]| { - let output: Val = bevy::math::IVec4::from_array(a) - .into(); - output - }, - ) - .register( - "is_negative_bitmask", - |_self: Val| { - let output: u32 = bevy::math::IVec4::is_negative_bitmask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "length_squared", - |_self: Val| { - let output: i32 = bevy::math::IVec4::length_squared( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec4::max( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max_element", - |_self: Val| { - let output: i32 = bevy::math::IVec4::max_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "min", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec4::min( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min_element", - |_self: Val| { - let output: i32 = bevy::math::IVec4::min_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Ref| { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: i32| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |x: i32, y: i32, z: i32, w: i32| { - let output: Val = bevy::math::IVec4::new( - x, - y, - z, - w, - ) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Ref| { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Val| { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: i32| { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "rem_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec4::rem_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec4::saturating_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_add_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec4::saturating_add_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec4::saturating_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec4::saturating_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec4::saturating_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_sub_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec4::saturating_sub_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "select", - | - mask: Val, - if_true: Val, - if_false: Val| - { - let output: Val = bevy::math::IVec4::select( - mask.into_inner(), - if_true.into_inner(), - if_false.into_inner(), - ) - .into(); - output - }, - ) - .register( - "signum", - |_self: Val| { - let output: Val = bevy::math::IVec4::signum( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "splat", - |v: i32| { - let output: Val = bevy::math::IVec4::splat(v) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Ref| { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: i32| { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "to_array", - |_self: Ref| { - let output: [i32; 4] = bevy::math::IVec4::to_array(&_self).into(); - output - }, - ) - .register( - "truncate", - |_self: Val| { - let output: Val = bevy::math::IVec4::truncate( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "with_w", - |_self: Val, w: i32| { - let output: Val = bevy::math::IVec4::with_w( - _self.into_inner(), - w, - ) - .into(); - output - }, - ) - .register( - "with_x", - |_self: Val, x: i32| { - let output: Val = bevy::math::IVec4::with_x( - _self.into_inner(), - x, - ) - .into(); - output - }, - ) - .register( - "with_y", - |_self: Val, y: i32| { - let output: Val = bevy::math::IVec4::with_y( - _self.into_inner(), - y, - ) - .into(); - output - }, - ) - .register( - "with_z", - |_self: Val, z: i32| { - let output: Val = bevy::math::IVec4::with_z( - _self.into_inner(), - z, - ) - .into(); - output - }, - ) - .register( - "wrapping_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec4::wrapping_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_add_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec4::wrapping_add_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec4::wrapping_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec4::wrapping_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec4::wrapping_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_sub_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::IVec4::wrapping_sub_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::I64Vec2>::new(world) - .register( - "abs", - |_self: Val| { - let output: Val = bevy::math::I64Vec2::abs( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Ref| { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: i64| { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "as_dvec2", - |_self: Ref| { - let output: Val = bevy::math::I64Vec2::as_dvec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_ivec2", - |_self: Ref| { - let output: Val = bevy::math::I64Vec2::as_ivec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_u64vec2", - |_self: Ref| { - let output: Val = bevy::math::I64Vec2::as_u64vec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_uvec2", - |_self: Ref| { - let output: Val = bevy::math::I64Vec2::as_uvec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_vec2", - |_self: Ref| { - let output: Val = bevy::math::I64Vec2::as_vec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clamp", - | - _self: Val, - min: Val, - max: Val| - { - let output: Val = bevy::math::I64Vec2::clamp( - _self.into_inner(), - min.into_inner(), - max.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "cmpeq", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::cmpeq( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpge", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::cmpge( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpgt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::cmpgt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmple", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::cmple( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmplt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::cmplt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpne", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::cmpne( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "distance_squared", - |_self: Val, rhs: Val| { - let output: i64 = bevy::math::I64Vec2::distance_squared( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Ref| { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Val| { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: i64| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "div_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::div_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot", - |_self: Val, rhs: Val| { - let output: i64 = bevy::math::I64Vec2::dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot_into_vec", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::dot_into_vec( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_product", - |_self: Val| { - let output: i64 = bevy::math::I64Vec2::element_product( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_sum", - |_self: Val| { - let output: i64 = bevy::math::I64Vec2::element_sum( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "extend", - |_self: Val, z: i64| { - let output: Val = bevy::math::I64Vec2::extend( - _self.into_inner(), - z, - ) - .into(); - output - }, - ) - .register( - "from_array", - |a: [i64; 2]| { - let output: Val = bevy::math::I64Vec2::from_array( - a, - ) - .into(); - output - }, - ) - .register( - "is_negative_bitmask", - |_self: Val| { - let output: u32 = bevy::math::I64Vec2::is_negative_bitmask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "length_squared", - |_self: Val| { - let output: i64 = bevy::math::I64Vec2::length_squared( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::max( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max_element", - |_self: Val| { - let output: i64 = bevy::math::I64Vec2::max_element( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::min( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min_element", - |_self: Val| { - let output: i64 = bevy::math::I64Vec2::min_element( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Ref| { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: i64| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |x: i64, y: i64| { - let output: Val = bevy::math::I64Vec2::new(x, y) - .into(); - output - }, - ) - .register( - "perp", - |_self: Val| { - let output: Val = bevy::math::I64Vec2::perp( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "perp_dot", - |_self: Val, rhs: Val| { - let output: i64 = bevy::math::I64Vec2::perp_dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Ref| { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Val| { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: i64| { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "rem_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::rem_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rotate", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::rotate( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::saturating_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_add_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::saturating_add_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::saturating_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::saturating_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::saturating_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_sub_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::saturating_sub_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "select", - | - mask: Val, - if_true: Val, - if_false: Val| - { - let output: Val = bevy::math::I64Vec2::select( - mask.into_inner(), - if_true.into_inner(), - if_false.into_inner(), - ) - .into(); - output - }, - ) - .register( - "signum", - |_self: Val| { - let output: Val = bevy::math::I64Vec2::signum( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "splat", - |v: i64| { - let output: Val = bevy::math::I64Vec2::splat(v) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Ref| { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: i64| { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "to_array", - |_self: Ref| { - let output: [i64; 2] = bevy::math::I64Vec2::to_array(&_self).into(); - output - }, - ) - .register( - "with_x", - |_self: Val, x: i64| { - let output: Val = bevy::math::I64Vec2::with_x( - _self.into_inner(), - x, - ) - .into(); - output - }, - ) - .register( - "with_y", - |_self: Val, y: i64| { - let output: Val = bevy::math::I64Vec2::with_y( - _self.into_inner(), - y, - ) - .into(); - output - }, - ) - .register( - "wrapping_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::wrapping_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_add_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::wrapping_add_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::wrapping_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::wrapping_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::wrapping_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_sub_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec2::wrapping_sub_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::I64Vec3>::new(world) - .register( - "abs", - |_self: Val| { - let output: Val = bevy::math::I64Vec3::abs( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Ref| { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: i64| { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "as_dvec3", - |_self: Ref| { - let output: Val = bevy::math::I64Vec3::as_dvec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_ivec3", - |_self: Ref| { - let output: Val = bevy::math::I64Vec3::as_ivec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_u64vec3", - |_self: Ref| { - let output: Val = bevy::math::I64Vec3::as_u64vec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_uvec3", - |_self: Ref| { - let output: Val = bevy::math::I64Vec3::as_uvec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_vec3", - |_self: Ref| { - let output: Val = bevy::math::I64Vec3::as_vec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_vec3a", - |_self: Ref| { - let output: Val = bevy::math::I64Vec3::as_vec3a( - &_self, - ) - .into(); - output - }, - ) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clamp", - | - _self: Val, - min: Val, - max: Val| - { - let output: Val = bevy::math::I64Vec3::clamp( - _self.into_inner(), - min.into_inner(), - max.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "cmpeq", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::cmpeq( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpge", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::cmpge( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpgt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::cmpgt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmple", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::cmple( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmplt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::cmplt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpne", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::cmpne( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cross", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::cross( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "distance_squared", - |_self: Val, rhs: Val| { - let output: i64 = bevy::math::I64Vec3::distance_squared( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Ref| { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Val| { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: i64| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "div_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::div_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot", - |_self: Val, rhs: Val| { - let output: i64 = bevy::math::I64Vec3::dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot_into_vec", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::dot_into_vec( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_product", - |_self: Val| { - let output: i64 = bevy::math::I64Vec3::element_product( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_sum", - |_self: Val| { - let output: i64 = bevy::math::I64Vec3::element_sum( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "extend", - |_self: Val, w: i64| { - let output: Val = bevy::math::I64Vec3::extend( - _self.into_inner(), - w, - ) - .into(); - output - }, - ) - .register( - "from_array", - |a: [i64; 3]| { - let output: Val = bevy::math::I64Vec3::from_array( - a, - ) - .into(); - output - }, - ) - .register( - "is_negative_bitmask", - |_self: Val| { - let output: u32 = bevy::math::I64Vec3::is_negative_bitmask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "length_squared", - |_self: Val| { - let output: i64 = bevy::math::I64Vec3::length_squared( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::max( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max_element", - |_self: Val| { - let output: i64 = bevy::math::I64Vec3::max_element( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::min( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min_element", - |_self: Val| { - let output: i64 = bevy::math::I64Vec3::min_element( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Ref| { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: i64| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |x: i64, y: i64, z: i64| { - let output: Val = bevy::math::I64Vec3::new( - x, - y, - z, - ) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Ref| { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Val| { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: i64| { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "rem_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::rem_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::saturating_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_add_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::saturating_add_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::saturating_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::saturating_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::saturating_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_sub_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::saturating_sub_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "select", - | - mask: Val, - if_true: Val, - if_false: Val| - { - let output: Val = bevy::math::I64Vec3::select( - mask.into_inner(), - if_true.into_inner(), - if_false.into_inner(), - ) - .into(); - output - }, - ) - .register( - "signum", - |_self: Val| { - let output: Val = bevy::math::I64Vec3::signum( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "splat", - |v: i64| { - let output: Val = bevy::math::I64Vec3::splat(v) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Ref| { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: i64| { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "to_array", - |_self: Ref| { - let output: [i64; 3] = bevy::math::I64Vec3::to_array(&_self).into(); - output - }, - ) - .register( - "truncate", - |_self: Val| { - let output: Val = bevy::math::I64Vec3::truncate( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "with_x", - |_self: Val, x: i64| { - let output: Val = bevy::math::I64Vec3::with_x( - _self.into_inner(), - x, - ) - .into(); - output - }, - ) - .register( - "with_y", - |_self: Val, y: i64| { - let output: Val = bevy::math::I64Vec3::with_y( - _self.into_inner(), - y, - ) - .into(); - output - }, - ) - .register( - "with_z", - |_self: Val, z: i64| { - let output: Val = bevy::math::I64Vec3::with_z( - _self.into_inner(), - z, - ) - .into(); - output - }, - ) - .register( - "wrapping_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::wrapping_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_add_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::wrapping_add_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::wrapping_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::wrapping_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::wrapping_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_sub_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec3::wrapping_sub_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::I64Vec4>::new(world) - .register( - "abs", - |_self: Val| { - let output: Val = bevy::math::I64Vec4::abs( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Ref| { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: i64| { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "as_dvec4", - |_self: Ref| { - let output: Val = bevy::math::I64Vec4::as_dvec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_ivec4", - |_self: Ref| { - let output: Val = bevy::math::I64Vec4::as_ivec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_u64vec4", - |_self: Ref| { - let output: Val = bevy::math::I64Vec4::as_u64vec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_uvec4", - |_self: Ref| { - let output: Val = bevy::math::I64Vec4::as_uvec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_vec4", - |_self: Ref| { - let output: Val = bevy::math::I64Vec4::as_vec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clamp", - | - _self: Val, - min: Val, - max: Val| - { - let output: Val = bevy::math::I64Vec4::clamp( - _self.into_inner(), - min.into_inner(), - max.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "cmpeq", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec4::cmpeq( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpge", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec4::cmpge( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpgt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec4::cmpgt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmple", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec4::cmple( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmplt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec4::cmplt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpne", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec4::cmpne( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "distance_squared", - |_self: Val, rhs: Val| { - let output: i64 = bevy::math::I64Vec4::distance_squared( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Ref| { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Val| { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: i64| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "div_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec4::div_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot", - |_self: Val, rhs: Val| { - let output: i64 = bevy::math::I64Vec4::dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot_into_vec", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec4::dot_into_vec( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_product", - |_self: Val| { - let output: i64 = bevy::math::I64Vec4::element_product( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_sum", - |_self: Val| { - let output: i64 = bevy::math::I64Vec4::element_sum( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "from_array", - |a: [i64; 4]| { - let output: Val = bevy::math::I64Vec4::from_array( - a, - ) - .into(); - output - }, - ) - .register( - "is_negative_bitmask", - |_self: Val| { - let output: u32 = bevy::math::I64Vec4::is_negative_bitmask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "length_squared", - |_self: Val| { - let output: i64 = bevy::math::I64Vec4::length_squared( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec4::max( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max_element", - |_self: Val| { - let output: i64 = bevy::math::I64Vec4::max_element( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec4::min( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min_element", - |_self: Val| { - let output: i64 = bevy::math::I64Vec4::min_element( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Ref| { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: i64| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |x: i64, y: i64, z: i64, w: i64| { - let output: Val = bevy::math::I64Vec4::new( - x, - y, - z, - w, - ) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Ref| { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Val| { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: i64| { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "rem_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec4::rem_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec4::saturating_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_add_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec4::saturating_add_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec4::saturating_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec4::saturating_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec4::saturating_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_sub_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec4::saturating_sub_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "select", - | - mask: Val, - if_true: Val, - if_false: Val| - { - let output: Val = bevy::math::I64Vec4::select( - mask.into_inner(), - if_true.into_inner(), - if_false.into_inner(), - ) - .into(); - output - }, - ) - .register( - "signum", - |_self: Val| { - let output: Val = bevy::math::I64Vec4::signum( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "splat", - |v: i64| { - let output: Val = bevy::math::I64Vec4::splat(v) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Ref| { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: i64| { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "to_array", - |_self: Ref| { - let output: [i64; 4] = bevy::math::I64Vec4::to_array(&_self).into(); - output - }, - ) - .register( - "truncate", - |_self: Val| { - let output: Val = bevy::math::I64Vec4::truncate( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "with_w", - |_self: Val, w: i64| { - let output: Val = bevy::math::I64Vec4::with_w( - _self.into_inner(), - w, - ) - .into(); - output - }, - ) - .register( - "with_x", - |_self: Val, x: i64| { - let output: Val = bevy::math::I64Vec4::with_x( - _self.into_inner(), - x, - ) - .into(); - output - }, - ) - .register( - "with_y", - |_self: Val, y: i64| { - let output: Val = bevy::math::I64Vec4::with_y( - _self.into_inner(), - y, - ) - .into(); - output - }, - ) - .register( - "with_z", - |_self: Val, z: i64| { - let output: Val = bevy::math::I64Vec4::with_z( - _self.into_inner(), - z, - ) - .into(); - output - }, - ) - .register( - "wrapping_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec4::wrapping_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_add_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec4::wrapping_add_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec4::wrapping_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec4::wrapping_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec4::wrapping_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_sub_unsigned", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::I64Vec4::wrapping_sub_unsigned( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::UVec2>::new(world) - .register( - "add", - |_self: Val, rhs: Ref| { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: u32| { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "as_dvec2", - |_self: Ref| { - let output: Val = bevy::math::UVec2::as_dvec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_i64vec2", - |_self: Ref| { - let output: Val = bevy::math::UVec2::as_i64vec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_ivec2", - |_self: Ref| { - let output: Val = bevy::math::UVec2::as_ivec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_u64vec2", - |_self: Ref| { - let output: Val = bevy::math::UVec2::as_u64vec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_vec2", - |_self: Ref| { - let output: Val = bevy::math::UVec2::as_vec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clamp", - | - _self: Val, - min: Val, - max: Val| - { - let output: Val = bevy::math::UVec2::clamp( - _self.into_inner(), - min.into_inner(), - max.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "cmpeq", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec2::cmpeq( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpge", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec2::cmpge( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpgt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec2::cmpgt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmple", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec2::cmple( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmplt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec2::cmplt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpne", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec2::cmpne( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Ref| { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Val| { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: u32| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "dot", - |_self: Val, rhs: Val| { - let output: u32 = bevy::math::UVec2::dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot_into_vec", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec2::dot_into_vec( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_product", - |_self: Val| { - let output: u32 = bevy::math::UVec2::element_product( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_sum", - |_self: Val| { - let output: u32 = bevy::math::UVec2::element_sum(_self.into_inner()) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "extend", - |_self: Val, z: u32| { - let output: Val = bevy::math::UVec2::extend( - _self.into_inner(), - z, - ) - .into(); - output - }, - ) - .register( - "from_array", - |a: [u32; 2]| { - let output: Val = bevy::math::UVec2::from_array(a) - .into(); - output - }, - ) - .register( - "length_squared", - |_self: Val| { - let output: u32 = bevy::math::UVec2::length_squared( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec2::max( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max_element", - |_self: Val| { - let output: u32 = bevy::math::UVec2::max_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "min", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec2::min( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min_element", - |_self: Val| { - let output: u32 = bevy::math::UVec2::min_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Ref| { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: u32| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "new", - |x: u32, y: u32| { - let output: Val = bevy::math::UVec2::new(x, y) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Ref| { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Val| { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: u32| { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "saturating_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec2::saturating_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_add_signed", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec2::saturating_add_signed( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec2::saturating_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec2::saturating_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec2::saturating_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "select", - | - mask: Val, - if_true: Val, - if_false: Val| - { - let output: Val = bevy::math::UVec2::select( - mask.into_inner(), - if_true.into_inner(), - if_false.into_inner(), - ) - .into(); - output - }, - ) - .register( - "splat", - |v: u32| { - let output: Val = bevy::math::UVec2::splat(v) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Ref| { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: u32| { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "to_array", - |_self: Ref| { - let output: [u32; 2] = bevy::math::UVec2::to_array(&_self).into(); - output - }, - ) - .register( - "with_x", - |_self: Val, x: u32| { - let output: Val = bevy::math::UVec2::with_x( - _self.into_inner(), - x, - ) - .into(); - output - }, - ) - .register( - "with_y", - |_self: Val, y: u32| { - let output: Val = bevy::math::UVec2::with_y( - _self.into_inner(), - y, - ) - .into(); - output - }, - ) - .register( - "wrapping_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec2::wrapping_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_add_signed", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec2::wrapping_add_signed( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec2::wrapping_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec2::wrapping_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec2::wrapping_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::UVec3>::new(world) - .register( - "add", - |_self: Val, rhs: Ref| { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: u32| { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "as_dvec3", - |_self: Ref| { - let output: Val = bevy::math::UVec3::as_dvec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_i64vec3", - |_self: Ref| { - let output: Val = bevy::math::UVec3::as_i64vec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_ivec3", - |_self: Ref| { - let output: Val = bevy::math::UVec3::as_ivec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_u64vec3", - |_self: Ref| { - let output: Val = bevy::math::UVec3::as_u64vec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_vec3", - |_self: Ref| { - let output: Val = bevy::math::UVec3::as_vec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_vec3a", - |_self: Ref| { - let output: Val = bevy::math::UVec3::as_vec3a( - &_self, - ) - .into(); - output - }, - ) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clamp", - | - _self: Val, - min: Val, - max: Val| - { - let output: Val = bevy::math::UVec3::clamp( - _self.into_inner(), - min.into_inner(), - max.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "cmpeq", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec3::cmpeq( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpge", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec3::cmpge( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpgt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec3::cmpgt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmple", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec3::cmple( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmplt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec3::cmplt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpne", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec3::cmpne( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cross", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec3::cross( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Ref| { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Val| { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: u32| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "dot", - |_self: Val, rhs: Val| { - let output: u32 = bevy::math::UVec3::dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot_into_vec", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec3::dot_into_vec( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_product", - |_self: Val| { - let output: u32 = bevy::math::UVec3::element_product( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_sum", - |_self: Val| { - let output: u32 = bevy::math::UVec3::element_sum(_self.into_inner()) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "extend", - |_self: Val, w: u32| { - let output: Val = bevy::math::UVec3::extend( - _self.into_inner(), - w, - ) - .into(); - output - }, - ) - .register( - "from_array", - |a: [u32; 3]| { - let output: Val = bevy::math::UVec3::from_array(a) - .into(); - output - }, - ) - .register( - "length_squared", - |_self: Val| { - let output: u32 = bevy::math::UVec3::length_squared( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec3::max( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max_element", - |_self: Val| { - let output: u32 = bevy::math::UVec3::max_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "min", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec3::min( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min_element", - |_self: Val| { - let output: u32 = bevy::math::UVec3::min_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Ref| { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: u32| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "new", - |x: u32, y: u32, z: u32| { - let output: Val = bevy::math::UVec3::new(x, y, z) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Ref| { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Val| { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: u32| { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "saturating_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec3::saturating_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_add_signed", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec3::saturating_add_signed( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec3::saturating_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec3::saturating_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec3::saturating_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "select", - | - mask: Val, - if_true: Val, - if_false: Val| - { - let output: Val = bevy::math::UVec3::select( - mask.into_inner(), - if_true.into_inner(), - if_false.into_inner(), - ) - .into(); - output - }, - ) - .register( - "splat", - |v: u32| { - let output: Val = bevy::math::UVec3::splat(v) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Ref| { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: u32| { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "to_array", - |_self: Ref| { - let output: [u32; 3] = bevy::math::UVec3::to_array(&_self).into(); - output - }, - ) - .register( - "truncate", - |_self: Val| { - let output: Val = bevy::math::UVec3::truncate( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "with_x", - |_self: Val, x: u32| { - let output: Val = bevy::math::UVec3::with_x( - _self.into_inner(), - x, - ) - .into(); - output - }, - ) - .register( - "with_y", - |_self: Val, y: u32| { - let output: Val = bevy::math::UVec3::with_y( - _self.into_inner(), - y, - ) - .into(); - output - }, - ) - .register( - "with_z", - |_self: Val, z: u32| { - let output: Val = bevy::math::UVec3::with_z( - _self.into_inner(), - z, - ) - .into(); - output - }, - ) - .register( - "wrapping_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec3::wrapping_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_add_signed", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec3::wrapping_add_signed( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec3::wrapping_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec3::wrapping_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec3::wrapping_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::UVec4>::new(world) - .register( - "add", - |_self: Val, rhs: Ref| { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: u32| { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "as_dvec4", - |_self: Ref| { - let output: Val = bevy::math::UVec4::as_dvec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_i64vec4", - |_self: Ref| { - let output: Val = bevy::math::UVec4::as_i64vec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_ivec4", - |_self: Ref| { - let output: Val = bevy::math::UVec4::as_ivec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_u64vec4", - |_self: Ref| { - let output: Val = bevy::math::UVec4::as_u64vec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_vec4", - |_self: Ref| { - let output: Val = bevy::math::UVec4::as_vec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clamp", - | - _self: Val, - min: Val, - max: Val| - { - let output: Val = bevy::math::UVec4::clamp( - _self.into_inner(), - min.into_inner(), - max.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "cmpeq", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec4::cmpeq( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpge", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec4::cmpge( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpgt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec4::cmpgt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmple", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec4::cmple( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmplt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec4::cmplt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpne", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec4::cmpne( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Ref| { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Val| { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: u32| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "dot", - |_self: Val, rhs: Val| { - let output: u32 = bevy::math::UVec4::dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot_into_vec", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec4::dot_into_vec( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_product", - |_self: Val| { - let output: u32 = bevy::math::UVec4::element_product( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_sum", - |_self: Val| { - let output: u32 = bevy::math::UVec4::element_sum(_self.into_inner()) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "from_array", - |a: [u32; 4]| { - let output: Val = bevy::math::UVec4::from_array(a) - .into(); - output - }, - ) - .register( - "length_squared", - |_self: Val| { - let output: u32 = bevy::math::UVec4::length_squared( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec4::max( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max_element", - |_self: Val| { - let output: u32 = bevy::math::UVec4::max_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "min", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec4::min( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min_element", - |_self: Val| { - let output: u32 = bevy::math::UVec4::min_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Ref| { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: u32| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "new", - |x: u32, y: u32, z: u32, w: u32| { - let output: Val = bevy::math::UVec4::new( - x, - y, - z, - w, - ) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Ref| { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Val| { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: u32| { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "saturating_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec4::saturating_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_add_signed", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec4::saturating_add_signed( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec4::saturating_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec4::saturating_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec4::saturating_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "select", - | - mask: Val, - if_true: Val, - if_false: Val| - { - let output: Val = bevy::math::UVec4::select( - mask.into_inner(), - if_true.into_inner(), - if_false.into_inner(), - ) - .into(); - output - }, - ) - .register( - "splat", - |v: u32| { - let output: Val = bevy::math::UVec4::splat(v) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Ref| { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: u32| { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "to_array", - |_self: Ref| { - let output: [u32; 4] = bevy::math::UVec4::to_array(&_self).into(); - output - }, - ) - .register( - "truncate", - |_self: Val| { - let output: Val = bevy::math::UVec4::truncate( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "with_w", - |_self: Val, w: u32| { - let output: Val = bevy::math::UVec4::with_w( - _self.into_inner(), - w, - ) - .into(); - output - }, - ) - .register( - "with_x", - |_self: Val, x: u32| { - let output: Val = bevy::math::UVec4::with_x( - _self.into_inner(), - x, - ) - .into(); - output - }, - ) - .register( - "with_y", - |_self: Val, y: u32| { - let output: Val = bevy::math::UVec4::with_y( - _self.into_inner(), - y, - ) - .into(); - output - }, - ) - .register( - "with_z", - |_self: Val, z: u32| { - let output: Val = bevy::math::UVec4::with_z( - _self.into_inner(), - z, - ) - .into(); - output - }, - ) - .register( - "wrapping_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec4::wrapping_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_add_signed", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec4::wrapping_add_signed( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec4::wrapping_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec4::wrapping_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::UVec4::wrapping_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::U64Vec2>::new(world) - .register( - "add", - |_self: Val, rhs: Ref| { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: u64| { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "as_dvec2", - |_self: Ref| { - let output: Val = bevy::math::U64Vec2::as_dvec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_i64vec2", - |_self: Ref| { - let output: Val = bevy::math::U64Vec2::as_i64vec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_ivec2", - |_self: Ref| { - let output: Val = bevy::math::U64Vec2::as_ivec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_uvec2", - |_self: Ref| { - let output: Val = bevy::math::U64Vec2::as_uvec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_vec2", - |_self: Ref| { - let output: Val = bevy::math::U64Vec2::as_vec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clamp", - | - _self: Val, - min: Val, - max: Val| - { - let output: Val = bevy::math::U64Vec2::clamp( - _self.into_inner(), - min.into_inner(), - max.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "cmpeq", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec2::cmpeq( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpge", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec2::cmpge( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpgt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec2::cmpgt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmple", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec2::cmple( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmplt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec2::cmplt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpne", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec2::cmpne( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Ref| { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Val| { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: u64| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "dot", - |_self: Val, rhs: Val| { - let output: u64 = bevy::math::U64Vec2::dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot_into_vec", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec2::dot_into_vec( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_product", - |_self: Val| { - let output: u64 = bevy::math::U64Vec2::element_product( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_sum", - |_self: Val| { - let output: u64 = bevy::math::U64Vec2::element_sum( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "extend", - |_self: Val, z: u64| { - let output: Val = bevy::math::U64Vec2::extend( - _self.into_inner(), - z, - ) - .into(); - output - }, - ) - .register( - "from_array", - |a: [u64; 2]| { - let output: Val = bevy::math::U64Vec2::from_array( - a, - ) - .into(); - output - }, - ) - .register( - "length_squared", - |_self: Val| { - let output: u64 = bevy::math::U64Vec2::length_squared( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec2::max( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max_element", - |_self: Val| { - let output: u64 = bevy::math::U64Vec2::max_element( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec2::min( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min_element", - |_self: Val| { - let output: u64 = bevy::math::U64Vec2::min_element( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Ref| { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: u64| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "new", - |x: u64, y: u64| { - let output: Val = bevy::math::U64Vec2::new(x, y) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Ref| { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Val| { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: u64| { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "saturating_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec2::saturating_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_add_signed", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec2::saturating_add_signed( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec2::saturating_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec2::saturating_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec2::saturating_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "select", - | - mask: Val, - if_true: Val, - if_false: Val| - { - let output: Val = bevy::math::U64Vec2::select( - mask.into_inner(), - if_true.into_inner(), - if_false.into_inner(), - ) - .into(); - output - }, - ) - .register( - "splat", - |v: u64| { - let output: Val = bevy::math::U64Vec2::splat(v) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Ref| { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: u64| { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "to_array", - |_self: Ref| { - let output: [u64; 2] = bevy::math::U64Vec2::to_array(&_self).into(); - output - }, - ) - .register( - "with_x", - |_self: Val, x: u64| { - let output: Val = bevy::math::U64Vec2::with_x( - _self.into_inner(), - x, - ) - .into(); - output - }, - ) - .register( - "with_y", - |_self: Val, y: u64| { - let output: Val = bevy::math::U64Vec2::with_y( - _self.into_inner(), - y, - ) - .into(); - output - }, - ) - .register( - "wrapping_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec2::wrapping_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_add_signed", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec2::wrapping_add_signed( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec2::wrapping_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec2::wrapping_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec2::wrapping_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::U64Vec3>::new(world) - .register( - "add", - |_self: Val, rhs: Ref| { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: u64| { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "as_dvec3", - |_self: Ref| { - let output: Val = bevy::math::U64Vec3::as_dvec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_i64vec3", - |_self: Ref| { - let output: Val = bevy::math::U64Vec3::as_i64vec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_ivec3", - |_self: Ref| { - let output: Val = bevy::math::U64Vec3::as_ivec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_uvec3", - |_self: Ref| { - let output: Val = bevy::math::U64Vec3::as_uvec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_vec3", - |_self: Ref| { - let output: Val = bevy::math::U64Vec3::as_vec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_vec3a", - |_self: Ref| { - let output: Val = bevy::math::U64Vec3::as_vec3a( - &_self, - ) - .into(); - output - }, - ) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clamp", - | - _self: Val, - min: Val, - max: Val| - { - let output: Val = bevy::math::U64Vec3::clamp( - _self.into_inner(), - min.into_inner(), - max.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "cmpeq", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec3::cmpeq( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpge", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec3::cmpge( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpgt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec3::cmpgt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmple", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec3::cmple( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmplt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec3::cmplt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpne", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec3::cmpne( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cross", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec3::cross( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Ref| { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Val| { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: u64| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "dot", - |_self: Val, rhs: Val| { - let output: u64 = bevy::math::U64Vec3::dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot_into_vec", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec3::dot_into_vec( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_product", - |_self: Val| { - let output: u64 = bevy::math::U64Vec3::element_product( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_sum", - |_self: Val| { - let output: u64 = bevy::math::U64Vec3::element_sum( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "extend", - |_self: Val, w: u64| { - let output: Val = bevy::math::U64Vec3::extend( - _self.into_inner(), - w, - ) - .into(); - output - }, - ) - .register( - "from_array", - |a: [u64; 3]| { - let output: Val = bevy::math::U64Vec3::from_array( - a, - ) - .into(); - output - }, - ) - .register( - "length_squared", - |_self: Val| { - let output: u64 = bevy::math::U64Vec3::length_squared( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec3::max( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max_element", - |_self: Val| { - let output: u64 = bevy::math::U64Vec3::max_element( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec3::min( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min_element", - |_self: Val| { - let output: u64 = bevy::math::U64Vec3::min_element( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Ref| { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: u64| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "new", - |x: u64, y: u64, z: u64| { - let output: Val = bevy::math::U64Vec3::new( - x, - y, - z, - ) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Ref| { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Val| { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: u64| { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "saturating_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec3::saturating_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_add_signed", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec3::saturating_add_signed( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec3::saturating_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec3::saturating_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec3::saturating_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "select", - | - mask: Val, - if_true: Val, - if_false: Val| - { - let output: Val = bevy::math::U64Vec3::select( - mask.into_inner(), - if_true.into_inner(), - if_false.into_inner(), - ) - .into(); - output - }, - ) - .register( - "splat", - |v: u64| { - let output: Val = bevy::math::U64Vec3::splat(v) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Ref| { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: u64| { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "to_array", - |_self: Ref| { - let output: [u64; 3] = bevy::math::U64Vec3::to_array(&_self).into(); - output - }, - ) - .register( - "truncate", - |_self: Val| { - let output: Val = bevy::math::U64Vec3::truncate( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "with_x", - |_self: Val, x: u64| { - let output: Val = bevy::math::U64Vec3::with_x( - _self.into_inner(), - x, - ) - .into(); - output - }, - ) - .register( - "with_y", - |_self: Val, y: u64| { - let output: Val = bevy::math::U64Vec3::with_y( - _self.into_inner(), - y, - ) - .into(); - output - }, - ) - .register( - "with_z", - |_self: Val, z: u64| { - let output: Val = bevy::math::U64Vec3::with_z( - _self.into_inner(), - z, - ) - .into(); - output - }, - ) - .register( - "wrapping_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec3::wrapping_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_add_signed", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec3::wrapping_add_signed( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec3::wrapping_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec3::wrapping_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec3::wrapping_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::U64Vec4>::new(world) - .register( - "add", - |_self: Val, rhs: Ref| { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: u64| { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "as_dvec4", - |_self: Ref| { - let output: Val = bevy::math::U64Vec4::as_dvec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_i64vec4", - |_self: Ref| { - let output: Val = bevy::math::U64Vec4::as_i64vec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_ivec4", - |_self: Ref| { - let output: Val = bevy::math::U64Vec4::as_ivec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_uvec4", - |_self: Ref| { - let output: Val = bevy::math::U64Vec4::as_uvec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_vec4", - |_self: Ref| { - let output: Val = bevy::math::U64Vec4::as_vec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clamp", - | - _self: Val, - min: Val, - max: Val| - { - let output: Val = bevy::math::U64Vec4::clamp( - _self.into_inner(), - min.into_inner(), - max.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "cmpeq", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec4::cmpeq( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpge", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec4::cmpge( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpgt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec4::cmpgt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmple", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec4::cmple( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmplt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec4::cmplt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpne", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec4::cmpne( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Ref| { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Val| { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: u64| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "dot", - |_self: Val, rhs: Val| { - let output: u64 = bevy::math::U64Vec4::dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot_into_vec", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec4::dot_into_vec( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_product", - |_self: Val| { - let output: u64 = bevy::math::U64Vec4::element_product( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_sum", - |_self: Val| { - let output: u64 = bevy::math::U64Vec4::element_sum( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "from_array", - |a: [u64; 4]| { - let output: Val = bevy::math::U64Vec4::from_array( - a, - ) - .into(); - output - }, - ) - .register( - "length_squared", - |_self: Val| { - let output: u64 = bevy::math::U64Vec4::length_squared( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec4::max( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max_element", - |_self: Val| { - let output: u64 = bevy::math::U64Vec4::max_element( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec4::min( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min_element", - |_self: Val| { - let output: u64 = bevy::math::U64Vec4::min_element( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Ref| { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: u64| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "new", - |x: u64, y: u64, z: u64, w: u64| { - let output: Val = bevy::math::U64Vec4::new( - x, - y, - z, - w, - ) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Ref| { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Val| { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: u64| { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "saturating_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec4::saturating_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_add_signed", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec4::saturating_add_signed( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec4::saturating_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec4::saturating_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "saturating_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec4::saturating_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "select", - | - mask: Val, - if_true: Val, - if_false: Val| - { - let output: Val = bevy::math::U64Vec4::select( - mask.into_inner(), - if_true.into_inner(), - if_false.into_inner(), - ) - .into(); - output - }, - ) - .register( - "splat", - |v: u64| { - let output: Val = bevy::math::U64Vec4::splat(v) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Ref| { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: u64| { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "to_array", - |_self: Ref| { - let output: [u64; 4] = bevy::math::U64Vec4::to_array(&_self).into(); - output - }, - ) - .register( - "truncate", - |_self: Val| { - let output: Val = bevy::math::U64Vec4::truncate( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "with_w", - |_self: Val, w: u64| { - let output: Val = bevy::math::U64Vec4::with_w( - _self.into_inner(), - w, - ) - .into(); - output - }, - ) - .register( - "with_x", - |_self: Val, x: u64| { - let output: Val = bevy::math::U64Vec4::with_x( - _self.into_inner(), - x, - ) - .into(); - output - }, - ) - .register( - "with_y", - |_self: Val, y: u64| { - let output: Val = bevy::math::U64Vec4::with_y( - _self.into_inner(), - y, - ) - .into(); - output - }, - ) - .register( - "with_z", - |_self: Val, z: u64| { - let output: Val = bevy::math::U64Vec4::with_z( - _self.into_inner(), - z, - ) - .into(); - output - }, - ) - .register( - "wrapping_add", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec4::wrapping_add( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_add_signed", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec4::wrapping_add_signed( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_div", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec4::wrapping_div( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_mul", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec4::wrapping_mul( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "wrapping_sub", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::U64Vec4::wrapping_sub( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::Vec2>::new(world) - .register( - "abs", - |_self: Val| { - let output: Val = bevy::math::Vec2::abs( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "abs_diff_eq", - | - _self: Val, - rhs: Val, - max_abs_diff: f32| - { - let output: bool = bevy::math::Vec2::abs_diff_eq( - _self.into_inner(), - rhs.into_inner(), - max_abs_diff, - ) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Ref| { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: f32| { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "angle_between", - |_self: Val, rhs: Val| { - let output: f32 = bevy::math::Vec2::angle_between( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "angle_to", - |_self: Val, rhs: Val| { - let output: f32 = bevy::math::Vec2::angle_to( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "as_dvec2", - |_self: Ref| { - let output: Val = bevy::math::Vec2::as_dvec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_i64vec2", - |_self: Ref| { - let output: Val = bevy::math::Vec2::as_i64vec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_ivec2", - |_self: Ref| { - let output: Val = bevy::math::Vec2::as_ivec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_u64vec2", - |_self: Ref| { - let output: Val = bevy::math::Vec2::as_u64vec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_uvec2", - |_self: Ref| { - let output: Val = bevy::math::Vec2::as_uvec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "ceil", - |_self: Val| { - let output: Val = bevy::math::Vec2::ceil( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clamp", - | - _self: Val, - min: Val, - max: Val| - { - let output: Val = bevy::math::Vec2::clamp( - _self.into_inner(), - min.into_inner(), - max.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clamp_length", - |_self: Val, min: f32, max: f32| { - let output: Val = bevy::math::Vec2::clamp_length( - _self.into_inner(), - min, - max, - ) - .into(); - output - }, - ) - .register( - "clamp_length_max", - |_self: Val, max: f32| { - let output: Val = bevy::math::Vec2::clamp_length_max( - _self.into_inner(), - max, - ) - .into(); - output - }, - ) - .register( - "clamp_length_min", - |_self: Val, min: f32| { - let output: Val = bevy::math::Vec2::clamp_length_min( - _self.into_inner(), - min, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "cmpeq", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec2::cmpeq( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpge", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec2::cmpge( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpgt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec2::cmpgt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmple", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec2::cmple( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmplt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec2::cmplt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpne", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec2::cmpne( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "copysign", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec2::copysign( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "distance", - |_self: Val, rhs: Val| { - let output: f32 = bevy::math::Vec2::distance( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "distance_squared", - |_self: Val, rhs: Val| { - let output: f32 = bevy::math::Vec2::distance_squared( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Ref| { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Val| { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: f32| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "div_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec2::div_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot", - |_self: Val, rhs: Val| { - let output: f32 = bevy::math::Vec2::dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot_into_vec", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec2::dot_into_vec( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_product", - |_self: Val| { - let output: f32 = bevy::math::Vec2::element_product( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_sum", - |_self: Val| { - let output: f32 = bevy::math::Vec2::element_sum(_self.into_inner()) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "exp", - |_self: Val| { - let output: Val = bevy::math::Vec2::exp( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "extend", - |_self: Val, z: f32| { - let output: Val = bevy::math::Vec2::extend( - _self.into_inner(), - z, - ) - .into(); - output - }, - ) - .register( - "floor", - |_self: Val| { - let output: Val = bevy::math::Vec2::floor( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "fract", - |_self: Val| { - let output: Val = bevy::math::Vec2::fract( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "fract_gl", - |_self: Val| { - let output: Val = bevy::math::Vec2::fract_gl( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_angle", - |angle: f32| { - let output: Val = bevy::math::Vec2::from_angle( - angle, - ) - .into(); - output - }, - ) - .register( - "from_array", - |a: [f32; 2]| { - let output: Val = bevy::math::Vec2::from_array(a) - .into(); - output - }, - ) - .register( - "is_finite", - |_self: Val| { - let output: bool = bevy::math::Vec2::is_finite(_self.into_inner()) - .into(); - output - }, - ) - .register( - "is_finite_mask", - |_self: Val| { - let output: Val = bevy::math::Vec2::is_finite_mask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_nan", - |_self: Val| { - let output: bool = bevy::math::Vec2::is_nan(_self.into_inner()) - .into(); - output - }, - ) - .register( - "is_nan_mask", - |_self: Val| { - let output: Val = bevy::math::Vec2::is_nan_mask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_negative_bitmask", - |_self: Val| { - let output: u32 = bevy::math::Vec2::is_negative_bitmask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_normalized", - |_self: Val| { - let output: bool = bevy::math::Vec2::is_normalized( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "length", - |_self: Val| { - let output: f32 = bevy::math::Vec2::length(_self.into_inner()) - .into(); - output - }, - ) - .register( - "length_recip", - |_self: Val| { - let output: f32 = bevy::math::Vec2::length_recip(_self.into_inner()) - .into(); - output - }, - ) - .register( - "length_squared", - |_self: Val| { - let output: f32 = bevy::math::Vec2::length_squared( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "lerp", - |_self: Val, rhs: Val, s: f32| { - let output: Val = bevy::math::Vec2::lerp( - _self.into_inner(), - rhs.into_inner(), - s, - ) - .into(); - output - }, - ) - .register( - "max", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec2::max( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max_element", - |_self: Val| { - let output: f32 = bevy::math::Vec2::max_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "midpoint", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec2::midpoint( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec2::min( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min_element", - |_self: Val| { - let output: f32 = bevy::math::Vec2::min_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "move_towards", - |_self: Ref, rhs: Val, d: f32| { - let output: Val = bevy::math::Vec2::move_towards( - &_self, - rhs.into_inner(), - d, - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Ref| { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: f32| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "mul_add", - | - _self: Val, - a: Val, - b: Val| - { - let output: Val = bevy::math::Vec2::mul_add( - _self.into_inner(), - a.into_inner(), - b.into_inner(), - ) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |x: f32, y: f32| { - let output: Val = bevy::math::Vec2::new(x, y) - .into(); - output - }, - ) - .register( - "normalize", - |_self: Val| { - let output: Val = bevy::math::Vec2::normalize( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "normalize_or", - |_self: Val, fallback: Val| { - let output: Val = bevy::math::Vec2::normalize_or( - _self.into_inner(), - fallback.into_inner(), - ) - .into(); - output - }, - ) - .register( - "normalize_or_zero", - |_self: Val| { - let output: Val = bevy::math::Vec2::normalize_or_zero( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "perp", - |_self: Val| { - let output: Val = bevy::math::Vec2::perp( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "perp_dot", - |_self: Val, rhs: Val| { - let output: f32 = bevy::math::Vec2::perp_dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "powf", - |_self: Val, n: f32| { - let output: Val = bevy::math::Vec2::powf( - _self.into_inner(), - n, - ) - .into(); - output - }, - ) - .register( - "project_onto", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec2::project_onto( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "project_onto_normalized", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec2::project_onto_normalized( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "recip", - |_self: Val| { - let output: Val = bevy::math::Vec2::recip( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "reflect", - |_self: Val, normal: Val| { - let output: Val = bevy::math::Vec2::reflect( - _self.into_inner(), - normal.into_inner(), - ) - .into(); - output - }, - ) - .register( - "refract", - |_self: Val, normal: Val, eta: f32| { - let output: Val = bevy::math::Vec2::refract( - _self.into_inner(), - normal.into_inner(), - eta, - ) - .into(); - output - }, - ) - .register( - "reject_from", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec2::reject_from( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "reject_from_normalized", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec2::reject_from_normalized( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Ref| { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Val| { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: f32| { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "rem_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec2::rem_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rotate", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec2::rotate( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rotate_towards", - | - _self: Ref, - rhs: Val, - max_angle: f32| - { - let output: Val = bevy::math::Vec2::rotate_towards( - &_self, - rhs.into_inner(), - max_angle, - ) - .into(); - output - }, - ) - .register( - "round", - |_self: Val| { - let output: Val = bevy::math::Vec2::round( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "select", - | - mask: Val, - if_true: Val, - if_false: Val| - { - let output: Val = bevy::math::Vec2::select( - mask.into_inner(), - if_true.into_inner(), - if_false.into_inner(), - ) - .into(); - output - }, - ) - .register( - "signum", - |_self: Val| { - let output: Val = bevy::math::Vec2::signum( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "splat", - |v: f32| { - let output: Val = bevy::math::Vec2::splat(v) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Ref| { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: f32| { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "to_angle", - |_self: Val| { - let output: f32 = bevy::math::Vec2::to_angle(_self.into_inner()) - .into(); - output - }, - ) - .register( - "to_array", - |_self: Ref| { - let output: [f32; 2] = bevy::math::Vec2::to_array(&_self).into(); - output - }, - ) - .register( - "trunc", - |_self: Val| { - let output: Val = bevy::math::Vec2::trunc( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "with_x", - |_self: Val, x: f32| { - let output: Val = bevy::math::Vec2::with_x( - _self.into_inner(), - x, - ) - .into(); - output - }, - ) - .register( - "with_y", - |_self: Val, y: f32| { - let output: Val = bevy::math::Vec2::with_y( - _self.into_inner(), - y, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::Vec3A>::new(world) - .register( - "abs", - |_self: Val| { - let output: Val = bevy::math::Vec3A::abs( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "abs_diff_eq", - | - _self: Val, - rhs: Val, - max_abs_diff: f32| - { - let output: bool = bevy::math::Vec3A::abs_diff_eq( - _self.into_inner(), - rhs.into_inner(), - max_abs_diff, - ) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Ref| { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: f32| { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "angle_between", - |_self: Val, rhs: Val| { - let output: f32 = bevy::math::Vec3A::angle_between( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "any_orthogonal_vector", - |_self: Ref| { - let output: Val = bevy::math::Vec3A::any_orthogonal_vector( - &_self, - ) - .into(); - output - }, - ) - .register( - "any_orthonormal_vector", - |_self: Ref| { - let output: Val = bevy::math::Vec3A::any_orthonormal_vector( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_dvec3", - |_self: Ref| { - let output: Val = bevy::math::Vec3A::as_dvec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_i64vec3", - |_self: Ref| { - let output: Val = bevy::math::Vec3A::as_i64vec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_ivec3", - |_self: Ref| { - let output: Val = bevy::math::Vec3A::as_ivec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_u64vec3", - |_self: Ref| { - let output: Val = bevy::math::Vec3A::as_u64vec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_uvec3", - |_self: Ref| { - let output: Val = bevy::math::Vec3A::as_uvec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "ceil", - |_self: Val| { - let output: Val = bevy::math::Vec3A::ceil( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clamp", - | - _self: Val, - min: Val, - max: Val| - { - let output: Val = bevy::math::Vec3A::clamp( - _self.into_inner(), - min.into_inner(), - max.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clamp_length", - |_self: Val, min: f32, max: f32| { - let output: Val = bevy::math::Vec3A::clamp_length( - _self.into_inner(), - min, - max, - ) - .into(); - output - }, - ) - .register( - "clamp_length_max", - |_self: Val, max: f32| { - let output: Val = bevy::math::Vec3A::clamp_length_max( - _self.into_inner(), - max, - ) - .into(); - output - }, - ) - .register( - "clamp_length_min", - |_self: Val, min: f32| { - let output: Val = bevy::math::Vec3A::clamp_length_min( - _self.into_inner(), - min, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "cmpeq", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3A::cmpeq( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpge", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3A::cmpge( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpgt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3A::cmpgt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmple", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3A::cmple( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmplt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3A::cmplt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpne", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3A::cmpne( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "copysign", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3A::copysign( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cross", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3A::cross( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "distance", - |_self: Val, rhs: Val| { - let output: f32 = bevy::math::Vec3A::distance( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "distance_squared", - |_self: Val, rhs: Val| { - let output: f32 = bevy::math::Vec3A::distance_squared( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Ref| { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Val| { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: f32| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "div_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3A::div_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot", - |_self: Val, rhs: Val| { - let output: f32 = bevy::math::Vec3A::dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot_into_vec", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3A::dot_into_vec( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_product", - |_self: Val| { - let output: f32 = bevy::math::Vec3A::element_product( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_sum", - |_self: Val| { - let output: f32 = bevy::math::Vec3A::element_sum(_self.into_inner()) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, rhs: Ref| { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - }, - ) - .register( - "exp", - |_self: Val| { - let output: Val = bevy::math::Vec3A::exp( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "extend", - |_self: Val, w: f32| { - let output: Val = bevy::math::Vec3A::extend( - _self.into_inner(), - w, - ) - .into(); - output - }, - ) - .register( - "floor", - |_self: Val| { - let output: Val = bevy::math::Vec3A::floor( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "fract", - |_self: Val| { - let output: Val = bevy::math::Vec3A::fract( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "fract_gl", - |_self: Val| { - let output: Val = bevy::math::Vec3A::fract_gl( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_array", - |a: [f32; 3]| { - let output: Val = bevy::math::Vec3A::from_array(a) - .into(); - output - }, - ) - .register( - "from_vec4", - |v: Val| { - let output: Val = bevy::math::Vec3A::from_vec4( - v.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_finite", - |_self: Val| { - let output: bool = bevy::math::Vec3A::is_finite(_self.into_inner()) - .into(); - output - }, - ) - .register( - "is_finite_mask", - |_self: Val| { - let output: Val = bevy::math::Vec3A::is_finite_mask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_nan", - |_self: Val| { - let output: bool = bevy::math::Vec3A::is_nan(_self.into_inner()) - .into(); - output - }, - ) - .register( - "is_nan_mask", - |_self: Val| { - let output: Val = bevy::math::Vec3A::is_nan_mask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_negative_bitmask", - |_self: Val| { - let output: u32 = bevy::math::Vec3A::is_negative_bitmask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_normalized", - |_self: Val| { - let output: bool = bevy::math::Vec3A::is_normalized( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "length", - |_self: Val| { - let output: f32 = bevy::math::Vec3A::length(_self.into_inner()) - .into(); - output - }, - ) - .register( - "length_recip", - |_self: Val| { - let output: f32 = bevy::math::Vec3A::length_recip(_self.into_inner()) - .into(); - output - }, - ) - .register( - "length_squared", - |_self: Val| { - let output: f32 = bevy::math::Vec3A::length_squared( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "lerp", - |_self: Val, rhs: Val, s: f32| { - let output: Val = bevy::math::Vec3A::lerp( - _self.into_inner(), - rhs.into_inner(), - s, - ) - .into(); - output - }, - ) - .register( - "max", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3A::max( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max_element", - |_self: Val| { - let output: f32 = bevy::math::Vec3A::max_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "midpoint", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3A::midpoint( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3A::min( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min_element", - |_self: Val| { - let output: f32 = bevy::math::Vec3A::min_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "move_towards", - |_self: Ref, rhs: Val, d: f32| { - let output: Val = bevy::math::Vec3A::move_towards( - &_self, - rhs.into_inner(), - d, - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Ref| { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: f32| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "mul_add", - | - _self: Val, - a: Val, - b: Val| - { - let output: Val = bevy::math::Vec3A::mul_add( - _self.into_inner(), - a.into_inner(), - b.into_inner(), - ) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |x: f32, y: f32, z: f32| { - let output: Val = bevy::math::Vec3A::new(x, y, z) - .into(); - output - }, - ) - .register( - "normalize", - |_self: Val| { - let output: Val = bevy::math::Vec3A::normalize( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "normalize_or", - |_self: Val, fallback: Val| { - let output: Val = bevy::math::Vec3A::normalize_or( - _self.into_inner(), - fallback.into_inner(), - ) - .into(); - output - }, - ) - .register( - "normalize_or_zero", - |_self: Val| { - let output: Val = bevy::math::Vec3A::normalize_or_zero( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "powf", - |_self: Val, n: f32| { - let output: Val = bevy::math::Vec3A::powf( - _self.into_inner(), - n, - ) - .into(); - output - }, - ) - .register( - "project_onto", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3A::project_onto( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "project_onto_normalized", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3A::project_onto_normalized( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "recip", - |_self: Val| { - let output: Val = bevy::math::Vec3A::recip( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "reflect", - |_self: Val, normal: Val| { - let output: Val = bevy::math::Vec3A::reflect( - _self.into_inner(), - normal.into_inner(), - ) - .into(); - output - }, - ) - .register( - "refract", - | - _self: Val, - normal: Val, - eta: f32| - { - let output: Val = bevy::math::Vec3A::refract( - _self.into_inner(), - normal.into_inner(), - eta, - ) - .into(); - output - }, - ) - .register( - "reject_from", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3A::reject_from( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "reject_from_normalized", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3A::reject_from_normalized( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Ref| { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Val| { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: f32| { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "rem_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec3A::rem_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "round", - |_self: Val| { - let output: Val = bevy::math::Vec3A::round( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "select", - | - mask: Val, - if_true: Val, - if_false: Val| - { - let output: Val = bevy::math::Vec3A::select( - mask.into_inner(), - if_true.into_inner(), - if_false.into_inner(), - ) - .into(); - output - }, - ) - .register( - "signum", - |_self: Val| { - let output: Val = bevy::math::Vec3A::signum( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "splat", - |v: f32| { - let output: Val = bevy::math::Vec3A::splat(v) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Ref| { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: f32| { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "to_array", - |_self: Ref| { - let output: [f32; 3] = bevy::math::Vec3A::to_array(&_self).into(); - output - }, - ) - .register( - "trunc", - |_self: Val| { - let output: Val = bevy::math::Vec3A::trunc( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "truncate", - |_self: Val| { - let output: Val = bevy::math::Vec3A::truncate( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "with_x", - |_self: Val, x: f32| { - let output: Val = bevy::math::Vec3A::with_x( - _self.into_inner(), - x, - ) - .into(); - output - }, - ) - .register( - "with_y", - |_self: Val, y: f32| { - let output: Val = bevy::math::Vec3A::with_y( - _self.into_inner(), - y, - ) - .into(); - output - }, - ) - .register( - "with_z", - |_self: Val, z: f32| { - let output: Val = bevy::math::Vec3A::with_z( - _self.into_inner(), - z, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::Vec4>::new(world) - .register( - "abs", - |_self: Val| { - let output: Val = bevy::math::Vec4::abs( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "abs_diff_eq", - | - _self: Val, - rhs: Val, - max_abs_diff: f32| - { - let output: bool = bevy::math::Vec4::abs_diff_eq( - _self.into_inner(), - rhs.into_inner(), - max_abs_diff, - ) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Ref| { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: f32| { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "as_dvec4", - |_self: Ref| { - let output: Val = bevy::math::Vec4::as_dvec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_i64vec4", - |_self: Ref| { - let output: Val = bevy::math::Vec4::as_i64vec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_ivec4", - |_self: Ref| { - let output: Val = bevy::math::Vec4::as_ivec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_u64vec4", - |_self: Ref| { - let output: Val = bevy::math::Vec4::as_u64vec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_uvec4", - |_self: Ref| { - let output: Val = bevy::math::Vec4::as_uvec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "ceil", - |_self: Val| { - let output: Val = bevy::math::Vec4::ceil( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clamp", - | - _self: Val, - min: Val, - max: Val| - { - let output: Val = bevy::math::Vec4::clamp( - _self.into_inner(), - min.into_inner(), - max.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clamp_length", - |_self: Val, min: f32, max: f32| { - let output: Val = bevy::math::Vec4::clamp_length( - _self.into_inner(), - min, - max, - ) - .into(); - output - }, - ) - .register( - "clamp_length_max", - |_self: Val, max: f32| { - let output: Val = bevy::math::Vec4::clamp_length_max( - _self.into_inner(), - max, - ) - .into(); - output - }, - ) - .register( - "clamp_length_min", - |_self: Val, min: f32| { - let output: Val = bevy::math::Vec4::clamp_length_min( - _self.into_inner(), - min, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "cmpeq", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec4::cmpeq( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpge", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec4::cmpge( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpgt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec4::cmpgt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmple", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec4::cmple( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmplt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec4::cmplt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpne", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec4::cmpne( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "copysign", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec4::copysign( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "distance", - |_self: Val, rhs: Val| { - let output: f32 = bevy::math::Vec4::distance( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "distance_squared", - |_self: Val, rhs: Val| { - let output: f32 = bevy::math::Vec4::distance_squared( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Ref| { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Val| { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: f32| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "div_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec4::div_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot", - |_self: Val, rhs: Val| { - let output: f32 = bevy::math::Vec4::dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot_into_vec", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec4::dot_into_vec( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_product", - |_self: Val| { - let output: f32 = bevy::math::Vec4::element_product( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_sum", - |_self: Val| { - let output: f32 = bevy::math::Vec4::element_sum(_self.into_inner()) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, rhs: Ref| { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - }, - ) - .register( - "exp", - |_self: Val| { - let output: Val = bevy::math::Vec4::exp( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "floor", - |_self: Val| { - let output: Val = bevy::math::Vec4::floor( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "fract", - |_self: Val| { - let output: Val = bevy::math::Vec4::fract( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "fract_gl", - |_self: Val| { - let output: Val = bevy::math::Vec4::fract_gl( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_array", - |a: [f32; 4]| { - let output: Val = bevy::math::Vec4::from_array(a) - .into(); - output - }, - ) - .register( - "is_finite", - |_self: Val| { - let output: bool = bevy::math::Vec4::is_finite(_self.into_inner()) - .into(); - output - }, - ) - .register( - "is_finite_mask", - |_self: Val| { - let output: Val = bevy::math::Vec4::is_finite_mask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_nan", - |_self: Val| { - let output: bool = bevy::math::Vec4::is_nan(_self.into_inner()) - .into(); - output - }, - ) - .register( - "is_nan_mask", - |_self: Val| { - let output: Val = bevy::math::Vec4::is_nan_mask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_negative_bitmask", - |_self: Val| { - let output: u32 = bevy::math::Vec4::is_negative_bitmask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_normalized", - |_self: Val| { - let output: bool = bevy::math::Vec4::is_normalized( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "length", - |_self: Val| { - let output: f32 = bevy::math::Vec4::length(_self.into_inner()) - .into(); - output - }, - ) - .register( - "length_recip", - |_self: Val| { - let output: f32 = bevy::math::Vec4::length_recip(_self.into_inner()) - .into(); - output - }, - ) - .register( - "length_squared", - |_self: Val| { - let output: f32 = bevy::math::Vec4::length_squared( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "lerp", - |_self: Val, rhs: Val, s: f32| { - let output: Val = bevy::math::Vec4::lerp( - _self.into_inner(), - rhs.into_inner(), - s, - ) - .into(); - output - }, - ) - .register( - "max", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec4::max( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max_element", - |_self: Val| { - let output: f32 = bevy::math::Vec4::max_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "midpoint", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec4::midpoint( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec4::min( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min_element", - |_self: Val| { - let output: f32 = bevy::math::Vec4::min_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "move_towards", - |_self: Ref, rhs: Val, d: f32| { - let output: Val = bevy::math::Vec4::move_towards( - &_self, - rhs.into_inner(), - d, - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Ref| { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: f32| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "mul_add", - | - _self: Val, - a: Val, - b: Val| - { - let output: Val = bevy::math::Vec4::mul_add( - _self.into_inner(), - a.into_inner(), - b.into_inner(), - ) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |x: f32, y: f32, z: f32, w: f32| { - let output: Val = bevy::math::Vec4::new(x, y, z, w) - .into(); - output - }, - ) - .register( - "normalize", - |_self: Val| { - let output: Val = bevy::math::Vec4::normalize( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "normalize_or", - |_self: Val, fallback: Val| { - let output: Val = bevy::math::Vec4::normalize_or( - _self.into_inner(), - fallback.into_inner(), - ) - .into(); - output - }, - ) - .register( - "normalize_or_zero", - |_self: Val| { - let output: Val = bevy::math::Vec4::normalize_or_zero( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "powf", - |_self: Val, n: f32| { - let output: Val = bevy::math::Vec4::powf( - _self.into_inner(), - n, - ) - .into(); - output - }, - ) - .register( - "project_onto", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec4::project_onto( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "project_onto_normalized", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec4::project_onto_normalized( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "recip", - |_self: Val| { - let output: Val = bevy::math::Vec4::recip( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "reflect", - |_self: Val, normal: Val| { - let output: Val = bevy::math::Vec4::reflect( - _self.into_inner(), - normal.into_inner(), - ) - .into(); - output - }, - ) - .register( - "refract", - |_self: Val, normal: Val, eta: f32| { - let output: Val = bevy::math::Vec4::refract( - _self.into_inner(), - normal.into_inner(), - eta, - ) - .into(); - output - }, - ) - .register( - "reject_from", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec4::reject_from( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "reject_from_normalized", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec4::reject_from_normalized( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Ref| { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Val| { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: f32| { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "rem_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::Vec4::rem_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "round", - |_self: Val| { - let output: Val = bevy::math::Vec4::round( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "select", - | - mask: Val, - if_true: Val, - if_false: Val| - { - let output: Val = bevy::math::Vec4::select( - mask.into_inner(), - if_true.into_inner(), - if_false.into_inner(), - ) - .into(); - output - }, - ) - .register( - "signum", - |_self: Val| { - let output: Val = bevy::math::Vec4::signum( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "splat", - |v: f32| { - let output: Val = bevy::math::Vec4::splat(v) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Ref| { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: f32| { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "to_array", - |_self: Ref| { - let output: [f32; 4] = bevy::math::Vec4::to_array(&_self).into(); - output - }, - ) - .register( - "trunc", - |_self: Val| { - let output: Val = bevy::math::Vec4::trunc( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "truncate", - |_self: Val| { - let output: Val = bevy::math::Vec4::truncate( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "with_w", - |_self: Val, w: f32| { - let output: Val = bevy::math::Vec4::with_w( - _self.into_inner(), - w, - ) - .into(); - output - }, - ) - .register( - "with_x", - |_self: Val, x: f32| { - let output: Val = bevy::math::Vec4::with_x( - _self.into_inner(), - x, - ) - .into(); - output - }, - ) - .register( - "with_y", - |_self: Val, y: f32| { - let output: Val = bevy::math::Vec4::with_y( - _self.into_inner(), - y, - ) - .into(); - output - }, - ) - .register( - "with_z", - |_self: Val, z: f32| { - let output: Val = bevy::math::Vec4::with_z( - _self.into_inner(), - z, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::BVec2>::new(world) - .register( - "all", - |_self: Val| { - let output: bool = bevy::math::BVec2::all(_self.into_inner()).into(); - output - }, - ) - .register( - "any", - |_self: Val| { - let output: bool = bevy::math::BVec2::any(_self.into_inner()).into(); - output - }, - ) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "bitmask", - |_self: Val| { - let output: u32 = bevy::math::BVec2::bitmask(_self.into_inner()) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "from_array", - |a: [bool; 2]| { - let output: Val = bevy::math::BVec2::from_array(a) - .into(); - output - }, - ) - .register( - "new", - |x: bool, y: bool| { - let output: Val = bevy::math::BVec2::new(x, y) - .into(); - output - }, - ) - .register( - "set", - |mut _self: Mut, index: usize, value: bool| { - let output: () = bevy::math::BVec2::set(&mut _self, index, value) - .into(); - output - }, - ) - .register( - "splat", - |v: bool| { - let output: Val = bevy::math::BVec2::splat(v) - .into(); - output - }, - ) - .register( - "test", - |_self: Ref, index: usize| { - let output: bool = bevy::math::BVec2::test(&_self, index).into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::BVec3>::new(world) - .register( - "all", - |_self: Val| { - let output: bool = bevy::math::BVec3::all(_self.into_inner()).into(); - output - }, - ) - .register( - "any", - |_self: Val| { - let output: bool = bevy::math::BVec3::any(_self.into_inner()).into(); - output - }, - ) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "bitmask", - |_self: Val| { - let output: u32 = bevy::math::BVec3::bitmask(_self.into_inner()) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "from_array", - |a: [bool; 3]| { - let output: Val = bevy::math::BVec3::from_array(a) - .into(); - output - }, - ) - .register( - "new", - |x: bool, y: bool, z: bool| { - let output: Val = bevy::math::BVec3::new(x, y, z) - .into(); - output - }, - ) - .register( - "set", - |mut _self: Mut, index: usize, value: bool| { - let output: () = bevy::math::BVec3::set(&mut _self, index, value) - .into(); - output - }, - ) - .register( - "splat", - |v: bool| { - let output: Val = bevy::math::BVec3::splat(v) - .into(); - output - }, - ) - .register( - "test", - |_self: Ref, index: usize| { - let output: bool = bevy::math::BVec3::test(&_self, index).into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::BVec4>::new(world) - .register( - "all", - |_self: Val| { - let output: bool = bevy::math::BVec4::all(_self.into_inner()).into(); - output - }, - ) - .register( - "any", - |_self: Val| { - let output: bool = bevy::math::BVec4::any(_self.into_inner()).into(); - output - }, - ) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "bitmask", - |_self: Val| { - let output: u32 = bevy::math::BVec4::bitmask(_self.into_inner()) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "from_array", - |a: [bool; 4]| { - let output: Val = bevy::math::BVec4::from_array(a) - .into(); - output - }, - ) - .register( - "new", - |x: bool, y: bool, z: bool, w: bool| { - let output: Val = bevy::math::BVec4::new( - x, - y, - z, - w, - ) - .into(); - output - }, - ) - .register( - "set", - |mut _self: Mut, index: usize, value: bool| { - let output: () = bevy::math::BVec4::set(&mut _self, index, value) - .into(); - output - }, - ) - .register( - "splat", - |v: bool| { - let output: Val = bevy::math::BVec4::splat(v) - .into(); - output - }, - ) - .register( - "test", - |_self: Ref, index: usize| { - let output: bool = bevy::math::BVec4::test(&_self, index).into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::DVec2>::new(world) - .register( - "abs", - |_self: Val| { - let output: Val = bevy::math::DVec2::abs( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "abs_diff_eq", - | - _self: Val, - rhs: Val, - max_abs_diff: f64| - { - let output: bool = bevy::math::DVec2::abs_diff_eq( - _self.into_inner(), - rhs.into_inner(), - max_abs_diff, - ) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Ref| { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: f64| { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "angle_between", - |_self: Val, rhs: Val| { - let output: f64 = bevy::math::DVec2::angle_between( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "angle_to", - |_self: Val, rhs: Val| { - let output: f64 = bevy::math::DVec2::angle_to( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "as_i64vec2", - |_self: Ref| { - let output: Val = bevy::math::DVec2::as_i64vec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_ivec2", - |_self: Ref| { - let output: Val = bevy::math::DVec2::as_ivec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_u64vec2", - |_self: Ref| { - let output: Val = bevy::math::DVec2::as_u64vec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_uvec2", - |_self: Ref| { - let output: Val = bevy::math::DVec2::as_uvec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_vec2", - |_self: Ref| { - let output: Val = bevy::math::DVec2::as_vec2( - &_self, - ) - .into(); - output - }, - ) - .register( - "ceil", - |_self: Val| { - let output: Val = bevy::math::DVec2::ceil( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clamp", - | - _self: Val, - min: Val, - max: Val| - { - let output: Val = bevy::math::DVec2::clamp( - _self.into_inner(), - min.into_inner(), - max.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clamp_length", - |_self: Val, min: f64, max: f64| { - let output: Val = bevy::math::DVec2::clamp_length( - _self.into_inner(), - min, - max, - ) - .into(); - output - }, - ) - .register( - "clamp_length_max", - |_self: Val, max: f64| { - let output: Val = bevy::math::DVec2::clamp_length_max( - _self.into_inner(), - max, - ) - .into(); - output - }, - ) - .register( - "clamp_length_min", - |_self: Val, min: f64| { - let output: Val = bevy::math::DVec2::clamp_length_min( - _self.into_inner(), - min, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "cmpeq", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec2::cmpeq( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpge", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec2::cmpge( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpgt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec2::cmpgt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmple", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec2::cmple( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmplt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec2::cmplt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpne", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec2::cmpne( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "copysign", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec2::copysign( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "distance", - |_self: Val, rhs: Val| { - let output: f64 = bevy::math::DVec2::distance( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "distance_squared", - |_self: Val, rhs: Val| { - let output: f64 = bevy::math::DVec2::distance_squared( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Ref| { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Val| { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: f64| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "div_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec2::div_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot", - |_self: Val, rhs: Val| { - let output: f64 = bevy::math::DVec2::dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot_into_vec", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec2::dot_into_vec( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_product", - |_self: Val| { - let output: f64 = bevy::math::DVec2::element_product( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_sum", - |_self: Val| { - let output: f64 = bevy::math::DVec2::element_sum(_self.into_inner()) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "exp", - |_self: Val| { - let output: Val = bevy::math::DVec2::exp( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "extend", - |_self: Val, z: f64| { - let output: Val = bevy::math::DVec2::extend( - _self.into_inner(), - z, - ) - .into(); - output - }, - ) - .register( - "floor", - |_self: Val| { - let output: Val = bevy::math::DVec2::floor( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "fract", - |_self: Val| { - let output: Val = bevy::math::DVec2::fract( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "fract_gl", - |_self: Val| { - let output: Val = bevy::math::DVec2::fract_gl( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_angle", - |angle: f64| { - let output: Val = bevy::math::DVec2::from_angle( - angle, - ) - .into(); - output - }, - ) - .register( - "from_array", - |a: [f64; 2]| { - let output: Val = bevy::math::DVec2::from_array(a) - .into(); - output - }, - ) - .register( - "is_finite", - |_self: Val| { - let output: bool = bevy::math::DVec2::is_finite(_self.into_inner()) - .into(); - output - }, - ) - .register( - "is_finite_mask", - |_self: Val| { - let output: Val = bevy::math::DVec2::is_finite_mask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_nan", - |_self: Val| { - let output: bool = bevy::math::DVec2::is_nan(_self.into_inner()) - .into(); - output - }, - ) - .register( - "is_nan_mask", - |_self: Val| { - let output: Val = bevy::math::DVec2::is_nan_mask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_negative_bitmask", - |_self: Val| { - let output: u32 = bevy::math::DVec2::is_negative_bitmask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_normalized", - |_self: Val| { - let output: bool = bevy::math::DVec2::is_normalized( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "length", - |_self: Val| { - let output: f64 = bevy::math::DVec2::length(_self.into_inner()) - .into(); - output - }, - ) - .register( - "length_recip", - |_self: Val| { - let output: f64 = bevy::math::DVec2::length_recip(_self.into_inner()) - .into(); - output - }, - ) - .register( - "length_squared", - |_self: Val| { - let output: f64 = bevy::math::DVec2::length_squared( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "lerp", - |_self: Val, rhs: Val, s: f64| { - let output: Val = bevy::math::DVec2::lerp( - _self.into_inner(), - rhs.into_inner(), - s, - ) - .into(); - output - }, - ) - .register( - "max", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec2::max( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max_element", - |_self: Val| { - let output: f64 = bevy::math::DVec2::max_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "midpoint", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec2::midpoint( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec2::min( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min_element", - |_self: Val| { - let output: f64 = bevy::math::DVec2::min_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "move_towards", - |_self: Ref, rhs: Val, d: f64| { - let output: Val = bevy::math::DVec2::move_towards( - &_self, - rhs.into_inner(), - d, - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Ref| { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: f64| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "mul_add", - | - _self: Val, - a: Val, - b: Val| - { - let output: Val = bevy::math::DVec2::mul_add( - _self.into_inner(), - a.into_inner(), - b.into_inner(), - ) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |x: f64, y: f64| { - let output: Val = bevy::math::DVec2::new(x, y) - .into(); - output - }, - ) - .register( - "normalize", - |_self: Val| { - let output: Val = bevy::math::DVec2::normalize( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "normalize_or", - |_self: Val, fallback: Val| { - let output: Val = bevy::math::DVec2::normalize_or( - _self.into_inner(), - fallback.into_inner(), - ) - .into(); - output - }, - ) - .register( - "normalize_or_zero", - |_self: Val| { - let output: Val = bevy::math::DVec2::normalize_or_zero( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "perp", - |_self: Val| { - let output: Val = bevy::math::DVec2::perp( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "perp_dot", - |_self: Val, rhs: Val| { - let output: f64 = bevy::math::DVec2::perp_dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "powf", - |_self: Val, n: f64| { - let output: Val = bevy::math::DVec2::powf( - _self.into_inner(), - n, - ) - .into(); - output - }, - ) - .register( - "project_onto", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec2::project_onto( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "project_onto_normalized", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec2::project_onto_normalized( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "recip", - |_self: Val| { - let output: Val = bevy::math::DVec2::recip( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "reflect", - |_self: Val, normal: Val| { - let output: Val = bevy::math::DVec2::reflect( - _self.into_inner(), - normal.into_inner(), - ) - .into(); - output - }, - ) - .register( - "refract", - | - _self: Val, - normal: Val, - eta: f64| - { - let output: Val = bevy::math::DVec2::refract( - _self.into_inner(), - normal.into_inner(), - eta, - ) - .into(); - output - }, - ) - .register( - "reject_from", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec2::reject_from( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "reject_from_normalized", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec2::reject_from_normalized( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Ref| { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Val| { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: f64| { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "rem_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec2::rem_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rotate", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec2::rotate( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rotate_towards", - | - _self: Ref, - rhs: Val, - max_angle: f64| - { - let output: Val = bevy::math::DVec2::rotate_towards( - &_self, - rhs.into_inner(), - max_angle, - ) - .into(); - output - }, - ) - .register( - "round", - |_self: Val| { - let output: Val = bevy::math::DVec2::round( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "select", - | - mask: Val, - if_true: Val, - if_false: Val| - { - let output: Val = bevy::math::DVec2::select( - mask.into_inner(), - if_true.into_inner(), - if_false.into_inner(), - ) - .into(); - output - }, - ) - .register( - "signum", - |_self: Val| { - let output: Val = bevy::math::DVec2::signum( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "splat", - |v: f64| { - let output: Val = bevy::math::DVec2::splat(v) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Ref| { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: f64| { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "to_angle", - |_self: Val| { - let output: f64 = bevy::math::DVec2::to_angle(_self.into_inner()) - .into(); - output - }, - ) - .register( - "to_array", - |_self: Ref| { - let output: [f64; 2] = bevy::math::DVec2::to_array(&_self).into(); - output - }, - ) - .register( - "trunc", - |_self: Val| { - let output: Val = bevy::math::DVec2::trunc( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "with_x", - |_self: Val, x: f64| { - let output: Val = bevy::math::DVec2::with_x( - _self.into_inner(), - x, - ) - .into(); - output - }, - ) - .register( - "with_y", - |_self: Val, y: f64| { - let output: Val = bevy::math::DVec2::with_y( - _self.into_inner(), - y, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::DVec3>::new(world) - .register( - "abs", - |_self: Val| { - let output: Val = bevy::math::DVec3::abs( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "abs_diff_eq", - | - _self: Val, - rhs: Val, - max_abs_diff: f64| - { - let output: bool = bevy::math::DVec3::abs_diff_eq( - _self.into_inner(), - rhs.into_inner(), - max_abs_diff, - ) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Ref| { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: f64| { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "angle_between", - |_self: Val, rhs: Val| { - let output: f64 = bevy::math::DVec3::angle_between( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "any_orthogonal_vector", - |_self: Ref| { - let output: Val = bevy::math::DVec3::any_orthogonal_vector( - &_self, - ) - .into(); - output - }, - ) - .register( - "any_orthonormal_vector", - |_self: Ref| { - let output: Val = bevy::math::DVec3::any_orthonormal_vector( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_i64vec3", - |_self: Ref| { - let output: Val = bevy::math::DVec3::as_i64vec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_ivec3", - |_self: Ref| { - let output: Val = bevy::math::DVec3::as_ivec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_u64vec3", - |_self: Ref| { - let output: Val = bevy::math::DVec3::as_u64vec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_uvec3", - |_self: Ref| { - let output: Val = bevy::math::DVec3::as_uvec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_vec3", - |_self: Ref| { - let output: Val = bevy::math::DVec3::as_vec3( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_vec3a", - |_self: Ref| { - let output: Val = bevy::math::DVec3::as_vec3a( - &_self, - ) - .into(); - output - }, - ) - .register( - "ceil", - |_self: Val| { - let output: Val = bevy::math::DVec3::ceil( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clamp", - | - _self: Val, - min: Val, - max: Val| - { - let output: Val = bevy::math::DVec3::clamp( - _self.into_inner(), - min.into_inner(), - max.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clamp_length", - |_self: Val, min: f64, max: f64| { - let output: Val = bevy::math::DVec3::clamp_length( - _self.into_inner(), - min, - max, - ) - .into(); - output - }, - ) - .register( - "clamp_length_max", - |_self: Val, max: f64| { - let output: Val = bevy::math::DVec3::clamp_length_max( - _self.into_inner(), - max, - ) - .into(); - output - }, - ) - .register( - "clamp_length_min", - |_self: Val, min: f64| { - let output: Val = bevy::math::DVec3::clamp_length_min( - _self.into_inner(), - min, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "cmpeq", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec3::cmpeq( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpge", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec3::cmpge( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpgt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec3::cmpgt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmple", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec3::cmple( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmplt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec3::cmplt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpne", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec3::cmpne( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "copysign", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec3::copysign( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cross", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec3::cross( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "distance", - |_self: Val, rhs: Val| { - let output: f64 = bevy::math::DVec3::distance( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "distance_squared", - |_self: Val, rhs: Val| { - let output: f64 = bevy::math::DVec3::distance_squared( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Ref| { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Val| { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: f64| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "div_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec3::div_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot", - |_self: Val, rhs: Val| { - let output: f64 = bevy::math::DVec3::dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot_into_vec", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec3::dot_into_vec( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_product", - |_self: Val| { - let output: f64 = bevy::math::DVec3::element_product( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_sum", - |_self: Val| { - let output: f64 = bevy::math::DVec3::element_sum(_self.into_inner()) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "exp", - |_self: Val| { - let output: Val = bevy::math::DVec3::exp( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "extend", - |_self: Val, w: f64| { - let output: Val = bevy::math::DVec3::extend( - _self.into_inner(), - w, - ) - .into(); - output - }, - ) - .register( - "floor", - |_self: Val| { - let output: Val = bevy::math::DVec3::floor( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "fract", - |_self: Val| { - let output: Val = bevy::math::DVec3::fract( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "fract_gl", - |_self: Val| { - let output: Val = bevy::math::DVec3::fract_gl( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_array", - |a: [f64; 3]| { - let output: Val = bevy::math::DVec3::from_array(a) - .into(); - output - }, - ) - .register( - "is_finite", - |_self: Val| { - let output: bool = bevy::math::DVec3::is_finite(_self.into_inner()) - .into(); - output - }, - ) - .register( - "is_finite_mask", - |_self: Val| { - let output: Val = bevy::math::DVec3::is_finite_mask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_nan", - |_self: Val| { - let output: bool = bevy::math::DVec3::is_nan(_self.into_inner()) - .into(); - output - }, - ) - .register( - "is_nan_mask", - |_self: Val| { - let output: Val = bevy::math::DVec3::is_nan_mask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_negative_bitmask", - |_self: Val| { - let output: u32 = bevy::math::DVec3::is_negative_bitmask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_normalized", - |_self: Val| { - let output: bool = bevy::math::DVec3::is_normalized( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "length", - |_self: Val| { - let output: f64 = bevy::math::DVec3::length(_self.into_inner()) - .into(); - output - }, - ) - .register( - "length_recip", - |_self: Val| { - let output: f64 = bevy::math::DVec3::length_recip(_self.into_inner()) - .into(); - output - }, - ) - .register( - "length_squared", - |_self: Val| { - let output: f64 = bevy::math::DVec3::length_squared( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "lerp", - |_self: Val, rhs: Val, s: f64| { - let output: Val = bevy::math::DVec3::lerp( - _self.into_inner(), - rhs.into_inner(), - s, - ) - .into(); - output - }, - ) - .register( - "max", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec3::max( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max_element", - |_self: Val| { - let output: f64 = bevy::math::DVec3::max_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "midpoint", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec3::midpoint( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec3::min( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min_element", - |_self: Val| { - let output: f64 = bevy::math::DVec3::min_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "move_towards", - |_self: Ref, rhs: Val, d: f64| { - let output: Val = bevy::math::DVec3::move_towards( - &_self, - rhs.into_inner(), - d, - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Ref| { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: f64| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "mul_add", - | - _self: Val, - a: Val, - b: Val| - { - let output: Val = bevy::math::DVec3::mul_add( - _self.into_inner(), - a.into_inner(), - b.into_inner(), - ) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |x: f64, y: f64, z: f64| { - let output: Val = bevy::math::DVec3::new(x, y, z) - .into(); - output - }, - ) - .register( - "normalize", - |_self: Val| { - let output: Val = bevy::math::DVec3::normalize( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "normalize_or", - |_self: Val, fallback: Val| { - let output: Val = bevy::math::DVec3::normalize_or( - _self.into_inner(), - fallback.into_inner(), - ) - .into(); - output - }, - ) - .register( - "normalize_or_zero", - |_self: Val| { - let output: Val = bevy::math::DVec3::normalize_or_zero( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "powf", - |_self: Val, n: f64| { - let output: Val = bevy::math::DVec3::powf( - _self.into_inner(), - n, - ) - .into(); - output - }, - ) - .register( - "project_onto", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec3::project_onto( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "project_onto_normalized", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec3::project_onto_normalized( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "recip", - |_self: Val| { - let output: Val = bevy::math::DVec3::recip( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "reflect", - |_self: Val, normal: Val| { - let output: Val = bevy::math::DVec3::reflect( - _self.into_inner(), - normal.into_inner(), - ) - .into(); - output - }, - ) - .register( - "refract", - | - _self: Val, - normal: Val, - eta: f64| - { - let output: Val = bevy::math::DVec3::refract( - _self.into_inner(), - normal.into_inner(), - eta, - ) - .into(); - output - }, - ) - .register( - "reject_from", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec3::reject_from( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "reject_from_normalized", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec3::reject_from_normalized( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Ref| { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Val| { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: f64| { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "rem_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec3::rem_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "round", - |_self: Val| { - let output: Val = bevy::math::DVec3::round( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "select", - | - mask: Val, - if_true: Val, - if_false: Val| - { - let output: Val = bevy::math::DVec3::select( - mask.into_inner(), - if_true.into_inner(), - if_false.into_inner(), - ) - .into(); - output - }, - ) - .register( - "signum", - |_self: Val| { - let output: Val = bevy::math::DVec3::signum( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "splat", - |v: f64| { - let output: Val = bevy::math::DVec3::splat(v) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Ref| { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: f64| { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "to_array", - |_self: Ref| { - let output: [f64; 3] = bevy::math::DVec3::to_array(&_self).into(); - output - }, - ) - .register( - "trunc", - |_self: Val| { - let output: Val = bevy::math::DVec3::trunc( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "truncate", - |_self: Val| { - let output: Val = bevy::math::DVec3::truncate( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "with_x", - |_self: Val, x: f64| { - let output: Val = bevy::math::DVec3::with_x( - _self.into_inner(), - x, - ) - .into(); - output - }, - ) - .register( - "with_y", - |_self: Val, y: f64| { - let output: Val = bevy::math::DVec3::with_y( - _self.into_inner(), - y, - ) - .into(); - output - }, - ) - .register( - "with_z", - |_self: Val, z: f64| { - let output: Val = bevy::math::DVec3::with_z( - _self.into_inner(), - z, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::DVec4>::new(world) - .register( - "abs", - |_self: Val| { - let output: Val = bevy::math::DVec4::abs( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "abs_diff_eq", - | - _self: Val, - rhs: Val, - max_abs_diff: f64| - { - let output: bool = bevy::math::DVec4::abs_diff_eq( - _self.into_inner(), - rhs.into_inner(), - max_abs_diff, - ) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Ref| { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: f64| { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "as_i64vec4", - |_self: Ref| { - let output: Val = bevy::math::DVec4::as_i64vec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_ivec4", - |_self: Ref| { - let output: Val = bevy::math::DVec4::as_ivec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_u64vec4", - |_self: Ref| { - let output: Val = bevy::math::DVec4::as_u64vec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_uvec4", - |_self: Ref| { - let output: Val = bevy::math::DVec4::as_uvec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "as_vec4", - |_self: Ref| { - let output: Val = bevy::math::DVec4::as_vec4( - &_self, - ) - .into(); - output - }, - ) - .register( - "ceil", - |_self: Val| { - let output: Val = bevy::math::DVec4::ceil( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clamp", - | - _self: Val, - min: Val, - max: Val| - { - let output: Val = bevy::math::DVec4::clamp( - _self.into_inner(), - min.into_inner(), - max.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clamp_length", - |_self: Val, min: f64, max: f64| { - let output: Val = bevy::math::DVec4::clamp_length( - _self.into_inner(), - min, - max, - ) - .into(); - output - }, - ) - .register( - "clamp_length_max", - |_self: Val, max: f64| { - let output: Val = bevy::math::DVec4::clamp_length_max( - _self.into_inner(), - max, - ) - .into(); - output - }, - ) - .register( - "clamp_length_min", - |_self: Val, min: f64| { - let output: Val = bevy::math::DVec4::clamp_length_min( - _self.into_inner(), - min, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "cmpeq", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec4::cmpeq( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpge", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec4::cmpge( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpgt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec4::cmpgt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmple", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec4::cmple( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmplt", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec4::cmplt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "cmpne", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec4::cmpne( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "copysign", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec4::copysign( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "distance", - |_self: Val, rhs: Val| { - let output: f64 = bevy::math::DVec4::distance( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "distance_squared", - |_self: Val, rhs: Val| { - let output: f64 = bevy::math::DVec4::distance_squared( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Ref| { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: Val| { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: f64| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "div_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec4::div_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot", - |_self: Val, rhs: Val| { - let output: f64 = bevy::math::DVec4::dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "dot_into_vec", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec4::dot_into_vec( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_product", - |_self: Val| { - let output: f64 = bevy::math::DVec4::element_product( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "element_sum", - |_self: Val| { - let output: f64 = bevy::math::DVec4::element_sum(_self.into_inner()) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "exp", - |_self: Val| { - let output: Val = bevy::math::DVec4::exp( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "floor", - |_self: Val| { - let output: Val = bevy::math::DVec4::floor( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "fract", - |_self: Val| { - let output: Val = bevy::math::DVec4::fract( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "fract_gl", - |_self: Val| { - let output: Val = bevy::math::DVec4::fract_gl( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_array", - |a: [f64; 4]| { - let output: Val = bevy::math::DVec4::from_array(a) - .into(); - output - }, - ) - .register( - "is_finite", - |_self: Val| { - let output: bool = bevy::math::DVec4::is_finite(_self.into_inner()) - .into(); - output - }, - ) - .register( - "is_finite_mask", - |_self: Val| { - let output: Val = bevy::math::DVec4::is_finite_mask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_nan", - |_self: Val| { - let output: bool = bevy::math::DVec4::is_nan(_self.into_inner()) - .into(); - output - }, - ) - .register( - "is_nan_mask", - |_self: Val| { - let output: Val = bevy::math::DVec4::is_nan_mask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_negative_bitmask", - |_self: Val| { - let output: u32 = bevy::math::DVec4::is_negative_bitmask( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_normalized", - |_self: Val| { - let output: bool = bevy::math::DVec4::is_normalized( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "length", - |_self: Val| { - let output: f64 = bevy::math::DVec4::length(_self.into_inner()) - .into(); - output - }, - ) - .register( - "length_recip", - |_self: Val| { - let output: f64 = bevy::math::DVec4::length_recip(_self.into_inner()) - .into(); - output - }, - ) - .register( - "length_squared", - |_self: Val| { - let output: f64 = bevy::math::DVec4::length_squared( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "lerp", - |_self: Val, rhs: Val, s: f64| { - let output: Val = bevy::math::DVec4::lerp( - _self.into_inner(), - rhs.into_inner(), - s, - ) - .into(); - output - }, - ) - .register( - "max", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec4::max( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "max_element", - |_self: Val| { - let output: f64 = bevy::math::DVec4::max_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "midpoint", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec4::midpoint( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec4::min( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "min_element", - |_self: Val| { - let output: f64 = bevy::math::DVec4::min_element(_self.into_inner()) - .into(); - output - }, - ) - .register( - "move_towards", - |_self: Ref, rhs: Val, d: f64| { - let output: Val = bevy::math::DVec4::move_towards( - &_self, - rhs.into_inner(), - d, - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Ref| { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: f64| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "mul_add", - | - _self: Val, - a: Val, - b: Val| - { - let output: Val = bevy::math::DVec4::mul_add( - _self.into_inner(), - a.into_inner(), - b.into_inner(), - ) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "new", - |x: f64, y: f64, z: f64, w: f64| { - let output: Val = bevy::math::DVec4::new( - x, - y, - z, - w, - ) - .into(); - output - }, - ) - .register( - "normalize", - |_self: Val| { - let output: Val = bevy::math::DVec4::normalize( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "normalize_or", - |_self: Val, fallback: Val| { - let output: Val = bevy::math::DVec4::normalize_or( - _self.into_inner(), - fallback.into_inner(), - ) - .into(); - output - }, - ) - .register( - "normalize_or_zero", - |_self: Val| { - let output: Val = bevy::math::DVec4::normalize_or_zero( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "powf", - |_self: Val, n: f64| { - let output: Val = bevy::math::DVec4::powf( - _self.into_inner(), - n, - ) - .into(); - output - }, - ) - .register( - "project_onto", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec4::project_onto( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "project_onto_normalized", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec4::project_onto_normalized( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "recip", - |_self: Val| { - let output: Val = bevy::math::DVec4::recip( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "reflect", - |_self: Val, normal: Val| { - let output: Val = bevy::math::DVec4::reflect( - _self.into_inner(), - normal.into_inner(), - ) - .into(); - output - }, - ) - .register( - "refract", - | - _self: Val, - normal: Val, - eta: f64| - { - let output: Val = bevy::math::DVec4::refract( - _self.into_inner(), - normal.into_inner(), - eta, - ) - .into(); - output - }, - ) - .register( - "reject_from", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec4::reject_from( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "reject_from_normalized", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec4::reject_from_normalized( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Ref| { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: Val| { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "rem", - |_self: Val, rhs: f64| { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "rem_euclid", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DVec4::rem_euclid( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "round", - |_self: Val| { - let output: Val = bevy::math::DVec4::round( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "select", - | - mask: Val, - if_true: Val, - if_false: Val| - { - let output: Val = bevy::math::DVec4::select( - mask.into_inner(), - if_true.into_inner(), - if_false.into_inner(), - ) - .into(); - output - }, - ) - .register( - "signum", - |_self: Val| { - let output: Val = bevy::math::DVec4::signum( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "splat", - |v: f64| { - let output: Val = bevy::math::DVec4::splat(v) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Ref| { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: f64| { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "to_array", - |_self: Ref| { - let output: [f64; 4] = bevy::math::DVec4::to_array(&_self).into(); - output - }, - ) - .register( - "trunc", - |_self: Val| { - let output: Val = bevy::math::DVec4::trunc( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "truncate", - |_self: Val| { - let output: Val = bevy::math::DVec4::truncate( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "with_w", - |_self: Val, w: f64| { - let output: Val = bevy::math::DVec4::with_w( - _self.into_inner(), - w, - ) - .into(); - output - }, - ) - .register( - "with_x", - |_self: Val, x: f64| { - let output: Val = bevy::math::DVec4::with_x( - _self.into_inner(), - x, - ) - .into(); - output - }, - ) - .register( - "with_y", - |_self: Val, y: f64| { - let output: Val = bevy::math::DVec4::with_y( - _self.into_inner(), - y, - ) - .into(); - output - }, - ) - .register( - "with_z", - |_self: Val, z: f64| { - let output: Val = bevy::math::DVec4::with_z( - _self.into_inner(), - z, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::Mat2>::new(world) - .register( - "abs", - |_self: Ref| { - let output: Val = bevy::math::Mat2::abs(&_self) - .into(); - output - }, - ) - .register( - "abs_diff_eq", - | - _self: Ref, - rhs: Val, - max_abs_diff: f32| - { - let output: bool = bevy::math::Mat2::abs_diff_eq( - &_self, - rhs.into_inner(), - max_abs_diff, - ) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add_mat2", - |_self: Ref, rhs: Ref| { - let output: Val = bevy::math::Mat2::add_mat2( - &_self, - &rhs, - ) - .into(); - output - }, - ) - .register( - "as_dmat2", - |_self: Ref| { - let output: Val = bevy::math::Mat2::as_dmat2( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "col", - |_self: Ref, index: usize| { - let output: Val = bevy::math::Mat2::col( - &_self, - index, - ) - .into(); - output - }, - ) - .register( - "determinant", - |_self: Ref| { - let output: f32 = bevy::math::Mat2::determinant(&_self).into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: f32| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "div_scalar", - |_self: Ref, rhs: f32| { - let output: Val = bevy::math::Mat2::div_scalar( - &_self, - rhs, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, rhs: Ref| { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - }, - ) - .register( - "from_angle", - |angle: f32| { - let output: Val = bevy::math::Mat2::from_angle( - angle, - ) - .into(); - output - }, - ) - .register( - "from_cols", - |x_axis: Val, y_axis: Val| { - let output: Val = bevy::math::Mat2::from_cols( - x_axis.into_inner(), - y_axis.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_diagonal", - |diagonal: Val| { - let output: Val = bevy::math::Mat2::from_diagonal( - diagonal.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat3", - |m: Val| { - let output: Val = bevy::math::Mat2::from_mat3( - m.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat3_minor", - |m: Val, i: usize, j: usize| { - let output: Val = bevy::math::Mat2::from_mat3_minor( - m.into_inner(), - i, - j, - ) - .into(); - output - }, - ) - .register( - "from_mat3a", - |m: Val| { - let output: Val = bevy::math::Mat2::from_mat3a( - m.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat3a_minor", - |m: Val, i: usize, j: usize| { - let output: Val = bevy::math::Mat2::from_mat3a_minor( - m.into_inner(), - i, - j, - ) - .into(); - output - }, - ) - .register( - "from_scale_angle", - |scale: Val, angle: f32| { - let output: Val = bevy::math::Mat2::from_scale_angle( - scale.into_inner(), - angle, - ) - .into(); - output - }, - ) - .register( - "inverse", - |_self: Ref| { - let output: Val = bevy::math::Mat2::inverse(&_self) - .into(); - output - }, - ) - .register( - "is_finite", - |_self: Ref| { - let output: bool = bevy::math::Mat2::is_finite(&_self).into(); - output - }, - ) - .register( - "is_nan", - |_self: Ref| { - let output: bool = bevy::math::Mat2::is_nan(&_self).into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: f32| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "mul_mat2", - |_self: Ref, rhs: Ref| { - let output: Val = bevy::math::Mat2::mul_mat2( - &_self, - &rhs, - ) - .into(); - output - }, - ) - .register( - "mul_scalar", - |_self: Ref, rhs: f32| { - let output: Val = bevy::math::Mat2::mul_scalar( - &_self, - rhs, - ) - .into(); - output - }, - ) - .register( - "mul_vec2", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Mat2::mul_vec2( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "row", - |_self: Ref, index: usize| { - let output: Val = bevy::math::Mat2::row( - &_self, - index, - ) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub_mat2", - |_self: Ref, rhs: Ref| { - let output: Val = bevy::math::Mat2::sub_mat2( - &_self, - &rhs, - ) - .into(); - output - }, - ) - .register( - "to_cols_array", - |_self: Ref| { - let output: [f32; 4] = bevy::math::Mat2::to_cols_array(&_self) - .into(); - output - }, - ) - .register( - "to_cols_array_2d", - |_self: Ref| { - let output: [[f32; 2]; 2] = bevy::math::Mat2::to_cols_array_2d( - &_self, - ) - .into(); - output - }, - ) - .register( - "transpose", - |_self: Ref| { - let output: Val = bevy::math::Mat2::transpose( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::Mat3>::new(world) - .register( - "abs", - |_self: Ref| { - let output: Val = bevy::math::Mat3::abs(&_self) - .into(); - output - }, - ) - .register( - "abs_diff_eq", - | - _self: Ref, - rhs: Val, - max_abs_diff: f32| - { - let output: bool = bevy::math::Mat3::abs_diff_eq( - &_self, - rhs.into_inner(), - max_abs_diff, - ) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add_mat3", - |_self: Ref, rhs: Ref| { - let output: Val = bevy::math::Mat3::add_mat3( - &_self, - &rhs, - ) - .into(); - output - }, - ) - .register( - "as_dmat3", - |_self: Ref| { - let output: Val = bevy::math::Mat3::as_dmat3( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "col", - |_self: Ref, index: usize| { - let output: Val = bevy::math::Mat3::col( - &_self, - index, - ) - .into(); - output - }, - ) - .register( - "determinant", - |_self: Ref| { - let output: f32 = bevy::math::Mat3::determinant(&_self).into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: f32| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "div_scalar", - |_self: Ref, rhs: f32| { - let output: Val = bevy::math::Mat3::div_scalar( - &_self, - rhs, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, rhs: Ref| { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - }, - ) - .register( - "from_angle", - |angle: f32| { - let output: Val = bevy::math::Mat3::from_angle( - angle, - ) - .into(); - output - }, - ) - .register( - "from_axis_angle", - |axis: Val, angle: f32| { - let output: Val = bevy::math::Mat3::from_axis_angle( - axis.into_inner(), - angle, - ) - .into(); - output - }, - ) - .register( - "from_cols", - | - x_axis: Val, - y_axis: Val, - z_axis: Val| - { - let output: Val = bevy::math::Mat3::from_cols( - x_axis.into_inner(), - y_axis.into_inner(), - z_axis.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_diagonal", - |diagonal: Val| { - let output: Val = bevy::math::Mat3::from_diagonal( - diagonal.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_euler", - |order: Val, a: f32, b: f32, c: f32| { - let output: Val = bevy::math::Mat3::from_euler( - order.into_inner(), - a, - b, - c, - ) - .into(); - output - }, - ) - .register( - "from_mat2", - |m: Val| { - let output: Val = bevy::math::Mat3::from_mat2( - m.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat4", - |m: Val| { - let output: Val = bevy::math::Mat3::from_mat4( - m.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat4_minor", - |m: Val, i: usize, j: usize| { - let output: Val = bevy::math::Mat3::from_mat4_minor( - m.into_inner(), - i, - j, - ) - .into(); - output - }, - ) - .register( - "from_quat", - |rotation: Val| { - let output: Val = bevy::math::Mat3::from_quat( - rotation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_rotation_x", - |angle: f32| { - let output: Val = bevy::math::Mat3::from_rotation_x( - angle, - ) - .into(); - output - }, - ) - .register( - "from_rotation_y", - |angle: f32| { - let output: Val = bevy::math::Mat3::from_rotation_y( - angle, - ) - .into(); - output - }, - ) - .register( - "from_rotation_z", - |angle: f32| { - let output: Val = bevy::math::Mat3::from_rotation_z( - angle, - ) - .into(); - output - }, - ) - .register( - "from_scale", - |scale: Val| { - let output: Val = bevy::math::Mat3::from_scale( - scale.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_scale_angle_translation", - | - scale: Val, - angle: f32, - translation: Val| - { - let output: Val = bevy::math::Mat3::from_scale_angle_translation( - scale.into_inner(), - angle, - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_translation", - |translation: Val| { - let output: Val = bevy::math::Mat3::from_translation( - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "inverse", - |_self: Ref| { - let output: Val = bevy::math::Mat3::inverse(&_self) - .into(); - output - }, - ) - .register( - "is_finite", - |_self: Ref| { - let output: bool = bevy::math::Mat3::is_finite(&_self).into(); - output - }, - ) - .register( - "is_nan", - |_self: Ref| { - let output: bool = bevy::math::Mat3::is_nan(&_self).into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: f32| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "mul_mat3", - |_self: Ref, rhs: Ref| { - let output: Val = bevy::math::Mat3::mul_mat3( - &_self, - &rhs, - ) - .into(); - output - }, - ) - .register( - "mul_scalar", - |_self: Ref, rhs: f32| { - let output: Val = bevy::math::Mat3::mul_scalar( - &_self, - rhs, - ) - .into(); - output - }, - ) - .register( - "mul_vec3", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Mat3::mul_vec3( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "mul_vec3a", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Mat3::mul_vec3a( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "row", - |_self: Ref, index: usize| { - let output: Val = bevy::math::Mat3::row( - &_self, - index, - ) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub_mat3", - |_self: Ref, rhs: Ref| { - let output: Val = bevy::math::Mat3::sub_mat3( - &_self, - &rhs, - ) - .into(); - output - }, - ) - .register( - "to_cols_array", - |_self: Ref| { - let output: [f32; 9] = bevy::math::Mat3::to_cols_array(&_self) - .into(); - output - }, - ) - .register( - "to_cols_array_2d", - |_self: Ref| { - let output: [[f32; 3]; 3] = bevy::math::Mat3::to_cols_array_2d( - &_self, - ) - .into(); - output - }, - ) - .register( - "to_euler", - |_self: Ref, order: Val| { - let output: (f32, f32, f32) = bevy::math::Mat3::to_euler( - &_self, - order.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transform_point2", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Mat3::transform_point2( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transform_vector2", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Mat3::transform_vector2( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transpose", - |_self: Ref| { - let output: Val = bevy::math::Mat3::transpose( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::Mat3A>::new(world) - .register( - "abs", - |_self: Ref| { - let output: Val = bevy::math::Mat3A::abs(&_self) - .into(); - output - }, - ) - .register( - "abs_diff_eq", - | - _self: Ref, - rhs: Val, - max_abs_diff: f32| - { - let output: bool = bevy::math::Mat3A::abs_diff_eq( - &_self, - rhs.into_inner(), - max_abs_diff, - ) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add_mat3", - |_self: Ref, rhs: Ref| { - let output: Val = bevy::math::Mat3A::add_mat3( - &_self, - &rhs, - ) - .into(); - output - }, - ) - .register( - "as_dmat3", - |_self: Ref| { - let output: Val = bevy::math::Mat3A::as_dmat3( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "col", - |_self: Ref, index: usize| { - let output: Val = bevy::math::Mat3A::col( - &_self, - index, - ) - .into(); - output - }, - ) - .register( - "determinant", - |_self: Ref| { - let output: f32 = bevy::math::Mat3A::determinant(&_self).into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: f32| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "div_scalar", - |_self: Ref, rhs: f32| { - let output: Val = bevy::math::Mat3A::div_scalar( - &_self, - rhs, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, rhs: Ref| { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - }, - ) - .register( - "from_angle", - |angle: f32| { - let output: Val = bevy::math::Mat3A::from_angle( - angle, - ) - .into(); - output - }, - ) - .register( - "from_axis_angle", - |axis: Val, angle: f32| { - let output: Val = bevy::math::Mat3A::from_axis_angle( - axis.into_inner(), - angle, - ) - .into(); - output - }, - ) - .register( - "from_cols", - | - x_axis: Val, - y_axis: Val, - z_axis: Val| - { - let output: Val = bevy::math::Mat3A::from_cols( - x_axis.into_inner(), - y_axis.into_inner(), - z_axis.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_diagonal", - |diagonal: Val| { - let output: Val = bevy::math::Mat3A::from_diagonal( - diagonal.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_euler", - |order: Val, a: f32, b: f32, c: f32| { - let output: Val = bevy::math::Mat3A::from_euler( - order.into_inner(), - a, - b, - c, - ) - .into(); - output - }, - ) - .register( - "from_mat2", - |m: Val| { - let output: Val = bevy::math::Mat3A::from_mat2( - m.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat4", - |m: Val| { - let output: Val = bevy::math::Mat3A::from_mat4( - m.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat4_minor", - |m: Val, i: usize, j: usize| { - let output: Val = bevy::math::Mat3A::from_mat4_minor( - m.into_inner(), - i, - j, - ) - .into(); - output - }, - ) - .register( - "from_quat", - |rotation: Val| { - let output: Val = bevy::math::Mat3A::from_quat( - rotation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_rotation_x", - |angle: f32| { - let output: Val = bevy::math::Mat3A::from_rotation_x( - angle, - ) - .into(); - output - }, - ) - .register( - "from_rotation_y", - |angle: f32| { - let output: Val = bevy::math::Mat3A::from_rotation_y( - angle, - ) - .into(); - output - }, - ) - .register( - "from_rotation_z", - |angle: f32| { - let output: Val = bevy::math::Mat3A::from_rotation_z( - angle, - ) - .into(); - output - }, - ) - .register( - "from_scale", - |scale: Val| { - let output: Val = bevy::math::Mat3A::from_scale( - scale.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_scale_angle_translation", - | - scale: Val, - angle: f32, - translation: Val| - { - let output: Val = bevy::math::Mat3A::from_scale_angle_translation( - scale.into_inner(), - angle, - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_translation", - |translation: Val| { - let output: Val = bevy::math::Mat3A::from_translation( - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "inverse", - |_self: Ref| { - let output: Val = bevy::math::Mat3A::inverse( - &_self, - ) - .into(); - output - }, - ) - .register( - "is_finite", - |_self: Ref| { - let output: bool = bevy::math::Mat3A::is_finite(&_self).into(); - output - }, - ) - .register( - "is_nan", - |_self: Ref| { - let output: bool = bevy::math::Mat3A::is_nan(&_self).into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: f32| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "mul_mat3", - |_self: Ref, rhs: Ref| { - let output: Val = bevy::math::Mat3A::mul_mat3( - &_self, - &rhs, - ) - .into(); - output - }, - ) - .register( - "mul_scalar", - |_self: Ref, rhs: f32| { - let output: Val = bevy::math::Mat3A::mul_scalar( - &_self, - rhs, - ) - .into(); - output - }, - ) - .register( - "mul_vec3", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Mat3A::mul_vec3( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "mul_vec3a", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Mat3A::mul_vec3a( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "row", - |_self: Ref, index: usize| { - let output: Val = bevy::math::Mat3A::row( - &_self, - index, - ) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub_mat3", - |_self: Ref, rhs: Ref| { - let output: Val = bevy::math::Mat3A::sub_mat3( - &_self, - &rhs, - ) - .into(); - output - }, - ) - .register( - "to_cols_array", - |_self: Ref| { - let output: [f32; 9] = bevy::math::Mat3A::to_cols_array(&_self) - .into(); - output - }, - ) - .register( - "to_cols_array_2d", - |_self: Ref| { - let output: [[f32; 3]; 3] = bevy::math::Mat3A::to_cols_array_2d( - &_self, - ) - .into(); - output - }, - ) - .register( - "to_euler", - |_self: Ref, order: Val| { - let output: (f32, f32, f32) = bevy::math::Mat3A::to_euler( - &_self, - order.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transform_point2", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Mat3A::transform_point2( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transform_vector2", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Mat3A::transform_vector2( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transpose", - |_self: Ref| { - let output: Val = bevy::math::Mat3A::transpose( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::Mat4>::new(world) - .register( - "abs", - |_self: Ref| { - let output: Val = bevy::math::Mat4::abs(&_self) - .into(); - output - }, - ) - .register( - "abs_diff_eq", - | - _self: Ref, - rhs: Val, - max_abs_diff: f32| - { - let output: bool = bevy::math::Mat4::abs_diff_eq( - &_self, - rhs.into_inner(), - max_abs_diff, - ) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add_mat4", - |_self: Ref, rhs: Ref| { - let output: Val = bevy::math::Mat4::add_mat4( - &_self, - &rhs, - ) - .into(); - output - }, - ) - .register( - "as_dmat4", - |_self: Ref| { - let output: Val = bevy::math::Mat4::as_dmat4( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "col", - |_self: Ref, index: usize| { - let output: Val = bevy::math::Mat4::col( - &_self, - index, - ) - .into(); - output - }, - ) - .register( - "determinant", - |_self: Ref| { - let output: f32 = bevy::math::Mat4::determinant(&_self).into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: f32| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "div_scalar", - |_self: Ref, rhs: f32| { - let output: Val = bevy::math::Mat4::div_scalar( - &_self, - rhs, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, rhs: Ref| { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - }, - ) - .register( - "from_axis_angle", - |axis: Val, angle: f32| { - let output: Val = bevy::math::Mat4::from_axis_angle( - axis.into_inner(), - angle, - ) - .into(); - output - }, - ) - .register( - "from_cols", - | - x_axis: Val, - y_axis: Val, - z_axis: Val, - w_axis: Val| - { - let output: Val = bevy::math::Mat4::from_cols( - x_axis.into_inner(), - y_axis.into_inner(), - z_axis.into_inner(), - w_axis.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_diagonal", - |diagonal: Val| { - let output: Val = bevy::math::Mat4::from_diagonal( - diagonal.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_euler", - |order: Val, a: f32, b: f32, c: f32| { - let output: Val = bevy::math::Mat4::from_euler( - order.into_inner(), - a, - b, - c, - ) - .into(); - output - }, - ) - .register( - "from_mat3", - |m: Val| { - let output: Val = bevy::math::Mat4::from_mat3( - m.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat3a", - |m: Val| { - let output: Val = bevy::math::Mat4::from_mat3a( - m.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_quat", - |rotation: Val| { - let output: Val = bevy::math::Mat4::from_quat( - rotation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_rotation_translation", - |rotation: Val, translation: Val| { - let output: Val = bevy::math::Mat4::from_rotation_translation( - rotation.into_inner(), - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_rotation_x", - |angle: f32| { - let output: Val = bevy::math::Mat4::from_rotation_x( - angle, - ) - .into(); - output - }, - ) - .register( - "from_rotation_y", - |angle: f32| { - let output: Val = bevy::math::Mat4::from_rotation_y( - angle, - ) - .into(); - output - }, - ) - .register( - "from_rotation_z", - |angle: f32| { - let output: Val = bevy::math::Mat4::from_rotation_z( - angle, - ) - .into(); - output - }, - ) - .register( - "from_scale", - |scale: Val| { - let output: Val = bevy::math::Mat4::from_scale( - scale.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_scale_rotation_translation", - | - scale: Val, - rotation: Val, - translation: Val| - { - let output: Val = bevy::math::Mat4::from_scale_rotation_translation( - scale.into_inner(), - rotation.into_inner(), - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_translation", - |translation: Val| { - let output: Val = bevy::math::Mat4::from_translation( - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "inverse", - |_self: Ref| { - let output: Val = bevy::math::Mat4::inverse(&_self) - .into(); - output - }, - ) - .register( - "is_finite", - |_self: Ref| { - let output: bool = bevy::math::Mat4::is_finite(&_self).into(); - output - }, - ) - .register( - "is_nan", - |_self: Ref| { - let output: bool = bevy::math::Mat4::is_nan(&_self).into(); - output - }, - ) - .register( - "look_at_lh", - | - eye: Val, - center: Val, - up: Val| - { - let output: Val = bevy::math::Mat4::look_at_lh( - eye.into_inner(), - center.into_inner(), - up.into_inner(), - ) - .into(); - output - }, - ) - .register( - "look_at_rh", - | - eye: Val, - center: Val, - up: Val| - { - let output: Val = bevy::math::Mat4::look_at_rh( - eye.into_inner(), - center.into_inner(), - up.into_inner(), - ) - .into(); - output - }, - ) - .register( - "look_to_lh", - | - eye: Val, - dir: Val, - up: Val| - { - let output: Val = bevy::math::Mat4::look_to_lh( - eye.into_inner(), - dir.into_inner(), - up.into_inner(), - ) - .into(); - output - }, - ) - .register( - "look_to_rh", - | - eye: Val, - dir: Val, - up: Val| - { - let output: Val = bevy::math::Mat4::look_to_rh( - eye.into_inner(), - dir.into_inner(), - up.into_inner(), - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: f32| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "mul_mat4", - |_self: Ref, rhs: Ref| { - let output: Val = bevy::math::Mat4::mul_mat4( - &_self, - &rhs, - ) - .into(); - output - }, - ) - .register( - "mul_scalar", - |_self: Ref, rhs: f32| { - let output: Val = bevy::math::Mat4::mul_scalar( - &_self, - rhs, - ) - .into(); - output - }, - ) - .register( - "mul_vec4", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Mat4::mul_vec4( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "orthographic_lh", - |left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32| { - let output: Val = bevy::math::Mat4::orthographic_lh( - left, - right, - bottom, - top, - near, - far, - ) - .into(); - output - }, - ) - .register( - "orthographic_rh", - |left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32| { - let output: Val = bevy::math::Mat4::orthographic_rh( - left, - right, - bottom, - top, - near, - far, - ) - .into(); - output - }, - ) - .register( - "orthographic_rh_gl", - |left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32| { - let output: Val = bevy::math::Mat4::orthographic_rh_gl( - left, - right, - bottom, - top, - near, - far, - ) - .into(); - output - }, - ) - .register( - "perspective_infinite_lh", - |fov_y_radians: f32, aspect_ratio: f32, z_near: f32| { - let output: Val = bevy::math::Mat4::perspective_infinite_lh( - fov_y_radians, - aspect_ratio, - z_near, - ) - .into(); - output - }, - ) - .register( - "perspective_infinite_reverse_lh", - |fov_y_radians: f32, aspect_ratio: f32, z_near: f32| { - let output: Val = bevy::math::Mat4::perspective_infinite_reverse_lh( - fov_y_radians, - aspect_ratio, - z_near, - ) - .into(); - output - }, - ) - .register( - "perspective_infinite_reverse_rh", - |fov_y_radians: f32, aspect_ratio: f32, z_near: f32| { - let output: Val = bevy::math::Mat4::perspective_infinite_reverse_rh( - fov_y_radians, - aspect_ratio, - z_near, - ) - .into(); - output - }, - ) - .register( - "perspective_infinite_rh", - |fov_y_radians: f32, aspect_ratio: f32, z_near: f32| { - let output: Val = bevy::math::Mat4::perspective_infinite_rh( - fov_y_radians, - aspect_ratio, - z_near, - ) - .into(); - output - }, - ) - .register( - "perspective_lh", - |fov_y_radians: f32, aspect_ratio: f32, z_near: f32, z_far: f32| { - let output: Val = bevy::math::Mat4::perspective_lh( - fov_y_radians, - aspect_ratio, - z_near, - z_far, - ) - .into(); - output - }, - ) - .register( - "perspective_rh", - |fov_y_radians: f32, aspect_ratio: f32, z_near: f32, z_far: f32| { - let output: Val = bevy::math::Mat4::perspective_rh( - fov_y_radians, - aspect_ratio, - z_near, - z_far, - ) - .into(); - output - }, - ) - .register( - "perspective_rh_gl", - |fov_y_radians: f32, aspect_ratio: f32, z_near: f32, z_far: f32| { - let output: Val = bevy::math::Mat4::perspective_rh_gl( - fov_y_radians, - aspect_ratio, - z_near, - z_far, - ) - .into(); - output - }, - ) - .register( - "project_point3", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Mat4::project_point3( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "project_point3a", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Mat4::project_point3a( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "row", - |_self: Ref, index: usize| { - let output: Val = bevy::math::Mat4::row( - &_self, - index, - ) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub_mat4", - |_self: Ref, rhs: Ref| { - let output: Val = bevy::math::Mat4::sub_mat4( - &_self, - &rhs, - ) - .into(); - output - }, - ) - .register( - "to_cols_array", - |_self: Ref| { - let output: [f32; 16] = bevy::math::Mat4::to_cols_array(&_self) - .into(); - output - }, - ) - .register( - "to_cols_array_2d", - |_self: Ref| { - let output: [[f32; 4]; 4] = bevy::math::Mat4::to_cols_array_2d( - &_self, - ) - .into(); - output - }, - ) - .register( - "to_euler", - |_self: Ref, order: Val| { - let output: (f32, f32, f32) = bevy::math::Mat4::to_euler( - &_self, - order.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transform_point3", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Mat4::transform_point3( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transform_point3a", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Mat4::transform_point3a( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transform_vector3", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Mat4::transform_vector3( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transform_vector3a", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Mat4::transform_vector3a( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transpose", - |_self: Ref| { - let output: Val = bevy::math::Mat4::transpose( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::DMat2>::new(world) - .register( - "abs", - |_self: Ref| { - let output: Val = bevy::math::DMat2::abs(&_self) - .into(); - output - }, - ) - .register( - "abs_diff_eq", - | - _self: Ref, - rhs: Val, - max_abs_diff: f64| - { - let output: bool = bevy::math::DMat2::abs_diff_eq( - &_self, - rhs.into_inner(), - max_abs_diff, - ) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add_mat2", - |_self: Ref, rhs: Ref| { - let output: Val = bevy::math::DMat2::add_mat2( - &_self, - &rhs, - ) - .into(); - output - }, - ) - .register( - "as_mat2", - |_self: Ref| { - let output: Val = bevy::math::DMat2::as_mat2( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "col", - |_self: Ref, index: usize| { - let output: Val = bevy::math::DMat2::col( - &_self, - index, - ) - .into(); - output - }, - ) - .register( - "determinant", - |_self: Ref| { - let output: f64 = bevy::math::DMat2::determinant(&_self).into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: f64| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "div_scalar", - |_self: Ref, rhs: f64| { - let output: Val = bevy::math::DMat2::div_scalar( - &_self, - rhs, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, rhs: Ref| { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - }, - ) - .register( - "from_angle", - |angle: f64| { - let output: Val = bevy::math::DMat2::from_angle( - angle, - ) - .into(); - output - }, - ) - .register( - "from_cols", - |x_axis: Val, y_axis: Val| { - let output: Val = bevy::math::DMat2::from_cols( - x_axis.into_inner(), - y_axis.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_diagonal", - |diagonal: Val| { - let output: Val = bevy::math::DMat2::from_diagonal( - diagonal.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat3", - |m: Val| { - let output: Val = bevy::math::DMat2::from_mat3( - m.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat3_minor", - |m: Val, i: usize, j: usize| { - let output: Val = bevy::math::DMat2::from_mat3_minor( - m.into_inner(), - i, - j, - ) - .into(); - output - }, - ) - .register( - "from_scale_angle", - |scale: Val, angle: f64| { - let output: Val = bevy::math::DMat2::from_scale_angle( - scale.into_inner(), - angle, - ) - .into(); - output - }, - ) - .register( - "inverse", - |_self: Ref| { - let output: Val = bevy::math::DMat2::inverse( - &_self, - ) - .into(); - output - }, - ) - .register( - "is_finite", - |_self: Ref| { - let output: bool = bevy::math::DMat2::is_finite(&_self).into(); - output - }, - ) - .register( - "is_nan", - |_self: Ref| { - let output: bool = bevy::math::DMat2::is_nan(&_self).into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: f64| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "mul_mat2", - |_self: Ref, rhs: Ref| { - let output: Val = bevy::math::DMat2::mul_mat2( - &_self, - &rhs, - ) - .into(); - output - }, - ) - .register( - "mul_scalar", - |_self: Ref, rhs: f64| { - let output: Val = bevy::math::DMat2::mul_scalar( - &_self, - rhs, - ) - .into(); - output - }, - ) - .register( - "mul_vec2", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::DMat2::mul_vec2( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "row", - |_self: Ref, index: usize| { - let output: Val = bevy::math::DMat2::row( - &_self, - index, - ) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub_mat2", - |_self: Ref, rhs: Ref| { - let output: Val = bevy::math::DMat2::sub_mat2( - &_self, - &rhs, - ) - .into(); - output - }, - ) - .register( - "to_cols_array", - |_self: Ref| { - let output: [f64; 4] = bevy::math::DMat2::to_cols_array(&_self) - .into(); - output - }, - ) - .register( - "to_cols_array_2d", - |_self: Ref| { - let output: [[f64; 2]; 2] = bevy::math::DMat2::to_cols_array_2d( - &_self, - ) - .into(); - output - }, - ) - .register( - "transpose", - |_self: Ref| { - let output: Val = bevy::math::DMat2::transpose( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::DMat3>::new(world) - .register( - "abs", - |_self: Ref| { - let output: Val = bevy::math::DMat3::abs(&_self) - .into(); - output - }, - ) - .register( - "abs_diff_eq", - | - _self: Ref, - rhs: Val, - max_abs_diff: f64| - { - let output: bool = bevy::math::DMat3::abs_diff_eq( - &_self, - rhs.into_inner(), - max_abs_diff, - ) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add_mat3", - |_self: Ref, rhs: Ref| { - let output: Val = bevy::math::DMat3::add_mat3( - &_self, - &rhs, - ) - .into(); - output - }, - ) - .register( - "as_mat3", - |_self: Ref| { - let output: Val = bevy::math::DMat3::as_mat3( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "col", - |_self: Ref, index: usize| { - let output: Val = bevy::math::DMat3::col( - &_self, - index, - ) - .into(); - output - }, - ) - .register( - "determinant", - |_self: Ref| { - let output: f64 = bevy::math::DMat3::determinant(&_self).into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: f64| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "div_scalar", - |_self: Ref, rhs: f64| { - let output: Val = bevy::math::DMat3::div_scalar( - &_self, - rhs, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, rhs: Ref| { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - }, - ) - .register( - "from_angle", - |angle: f64| { - let output: Val = bevy::math::DMat3::from_angle( - angle, - ) - .into(); - output - }, - ) - .register( - "from_axis_angle", - |axis: Val, angle: f64| { - let output: Val = bevy::math::DMat3::from_axis_angle( - axis.into_inner(), - angle, - ) - .into(); - output - }, - ) - .register( - "from_cols", - | - x_axis: Val, - y_axis: Val, - z_axis: Val| - { - let output: Val = bevy::math::DMat3::from_cols( - x_axis.into_inner(), - y_axis.into_inner(), - z_axis.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_diagonal", - |diagonal: Val| { - let output: Val = bevy::math::DMat3::from_diagonal( - diagonal.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_euler", - |order: Val, a: f64, b: f64, c: f64| { - let output: Val = bevy::math::DMat3::from_euler( - order.into_inner(), - a, - b, - c, - ) - .into(); - output - }, - ) - .register( - "from_mat2", - |m: Val| { - let output: Val = bevy::math::DMat3::from_mat2( - m.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat4", - |m: Val| { - let output: Val = bevy::math::DMat3::from_mat4( - m.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat4_minor", - |m: Val, i: usize, j: usize| { - let output: Val = bevy::math::DMat3::from_mat4_minor( - m.into_inner(), - i, - j, - ) - .into(); - output - }, - ) - .register( - "from_quat", - |rotation: Val| { - let output: Val = bevy::math::DMat3::from_quat( - rotation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_rotation_x", - |angle: f64| { - let output: Val = bevy::math::DMat3::from_rotation_x( - angle, - ) - .into(); - output - }, - ) - .register( - "from_rotation_y", - |angle: f64| { - let output: Val = bevy::math::DMat3::from_rotation_y( - angle, - ) - .into(); - output - }, - ) - .register( - "from_rotation_z", - |angle: f64| { - let output: Val = bevy::math::DMat3::from_rotation_z( - angle, - ) - .into(); - output - }, - ) - .register( - "from_scale", - |scale: Val| { - let output: Val = bevy::math::DMat3::from_scale( - scale.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_scale_angle_translation", - | - scale: Val, - angle: f64, - translation: Val| - { - let output: Val = bevy::math::DMat3::from_scale_angle_translation( - scale.into_inner(), - angle, - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_translation", - |translation: Val| { - let output: Val = bevy::math::DMat3::from_translation( - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "inverse", - |_self: Ref| { - let output: Val = bevy::math::DMat3::inverse( - &_self, - ) - .into(); - output - }, - ) - .register( - "is_finite", - |_self: Ref| { - let output: bool = bevy::math::DMat3::is_finite(&_self).into(); - output - }, - ) - .register( - "is_nan", - |_self: Ref| { - let output: bool = bevy::math::DMat3::is_nan(&_self).into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: f64| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "mul_mat3", - |_self: Ref, rhs: Ref| { - let output: Val = bevy::math::DMat3::mul_mat3( - &_self, - &rhs, - ) - .into(); - output - }, - ) - .register( - "mul_scalar", - |_self: Ref, rhs: f64| { - let output: Val = bevy::math::DMat3::mul_scalar( - &_self, - rhs, - ) - .into(); - output - }, - ) - .register( - "mul_vec3", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::DMat3::mul_vec3( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "row", - |_self: Ref, index: usize| { - let output: Val = bevy::math::DMat3::row( - &_self, - index, - ) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub_mat3", - |_self: Ref, rhs: Ref| { - let output: Val = bevy::math::DMat3::sub_mat3( - &_self, - &rhs, - ) - .into(); - output - }, - ) - .register( - "to_cols_array", - |_self: Ref| { - let output: [f64; 9] = bevy::math::DMat3::to_cols_array(&_self) - .into(); - output - }, - ) - .register( - "to_cols_array_2d", - |_self: Ref| { - let output: [[f64; 3]; 3] = bevy::math::DMat3::to_cols_array_2d( - &_self, - ) - .into(); - output - }, - ) - .register( - "to_euler", - |_self: Ref, order: Val| { - let output: (f64, f64, f64) = bevy::math::DMat3::to_euler( - &_self, - order.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transform_point2", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::DMat3::transform_point2( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transform_vector2", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::DMat3::transform_vector2( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transpose", - |_self: Ref| { - let output: Val = bevy::math::DMat3::transpose( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::DMat4>::new(world) - .register( - "abs", - |_self: Ref| { - let output: Val = bevy::math::DMat4::abs(&_self) - .into(); - output - }, - ) - .register( - "abs_diff_eq", - | - _self: Ref, - rhs: Val, - max_abs_diff: f64| - { - let output: bool = bevy::math::DMat4::abs_diff_eq( - &_self, - rhs.into_inner(), - max_abs_diff, - ) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "add_mat4", - |_self: Ref, rhs: Ref| { - let output: Val = bevy::math::DMat4::add_mat4( - &_self, - &rhs, - ) - .into(); - output - }, - ) - .register( - "as_mat4", - |_self: Ref| { - let output: Val = bevy::math::DMat4::as_mat4( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "col", - |_self: Ref, index: usize| { - let output: Val = bevy::math::DMat4::col( - &_self, - index, - ) - .into(); - output - }, - ) - .register( - "determinant", - |_self: Ref| { - let output: f64 = bevy::math::DMat4::determinant(&_self).into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: f64| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "div_scalar", - |_self: Ref, rhs: f64| { - let output: Val = bevy::math::DMat4::div_scalar( - &_self, - rhs, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, rhs: Ref| { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - }, - ) - .register( - "from_axis_angle", - |axis: Val, angle: f64| { - let output: Val = bevy::math::DMat4::from_axis_angle( - axis.into_inner(), - angle, - ) - .into(); - output - }, - ) - .register( - "from_cols", - | - x_axis: Val, - y_axis: Val, - z_axis: Val, - w_axis: Val| - { - let output: Val = bevy::math::DMat4::from_cols( - x_axis.into_inner(), - y_axis.into_inner(), - z_axis.into_inner(), - w_axis.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_diagonal", - |diagonal: Val| { - let output: Val = bevy::math::DMat4::from_diagonal( - diagonal.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_euler", - |order: Val, a: f64, b: f64, c: f64| { - let output: Val = bevy::math::DMat4::from_euler( - order.into_inner(), - a, - b, - c, - ) - .into(); - output - }, - ) - .register( - "from_mat3", - |m: Val| { - let output: Val = bevy::math::DMat4::from_mat3( - m.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_quat", - |rotation: Val| { - let output: Val = bevy::math::DMat4::from_quat( - rotation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_rotation_translation", - |rotation: Val, translation: Val| { - let output: Val = bevy::math::DMat4::from_rotation_translation( - rotation.into_inner(), - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_rotation_x", - |angle: f64| { - let output: Val = bevy::math::DMat4::from_rotation_x( - angle, - ) - .into(); - output - }, - ) - .register( - "from_rotation_y", - |angle: f64| { - let output: Val = bevy::math::DMat4::from_rotation_y( - angle, - ) - .into(); - output - }, - ) - .register( - "from_rotation_z", - |angle: f64| { - let output: Val = bevy::math::DMat4::from_rotation_z( - angle, - ) - .into(); - output - }, - ) - .register( - "from_scale", - |scale: Val| { - let output: Val = bevy::math::DMat4::from_scale( - scale.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_scale_rotation_translation", - | - scale: Val, - rotation: Val, - translation: Val| - { - let output: Val = bevy::math::DMat4::from_scale_rotation_translation( - scale.into_inner(), - rotation.into_inner(), - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_translation", - |translation: Val| { - let output: Val = bevy::math::DMat4::from_translation( - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "inverse", - |_self: Ref| { - let output: Val = bevy::math::DMat4::inverse( - &_self, - ) - .into(); - output - }, - ) - .register( - "is_finite", - |_self: Ref| { - let output: bool = bevy::math::DMat4::is_finite(&_self).into(); - output - }, - ) - .register( - "is_nan", - |_self: Ref| { - let output: bool = bevy::math::DMat4::is_nan(&_self).into(); - output - }, - ) - .register( - "look_at_lh", - | - eye: Val, - center: Val, - up: Val| - { - let output: Val = bevy::math::DMat4::look_at_lh( - eye.into_inner(), - center.into_inner(), - up.into_inner(), - ) - .into(); - output - }, - ) - .register( - "look_at_rh", - | - eye: Val, - center: Val, - up: Val| - { - let output: Val = bevy::math::DMat4::look_at_rh( - eye.into_inner(), - center.into_inner(), - up.into_inner(), - ) - .into(); - output - }, - ) - .register( - "look_to_lh", - | - eye: Val, - dir: Val, - up: Val| - { - let output: Val = bevy::math::DMat4::look_to_lh( - eye.into_inner(), - dir.into_inner(), - up.into_inner(), - ) - .into(); - output - }, - ) - .register( - "look_to_rh", - | - eye: Val, - dir: Val, - up: Val| - { - let output: Val = bevy::math::DMat4::look_to_rh( - eye.into_inner(), - dir.into_inner(), - up.into_inner(), - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: f64| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "mul_mat4", - |_self: Ref, rhs: Ref| { - let output: Val = bevy::math::DMat4::mul_mat4( - &_self, - &rhs, - ) - .into(); - output - }, - ) - .register( - "mul_scalar", - |_self: Ref, rhs: f64| { - let output: Val = bevy::math::DMat4::mul_scalar( - &_self, - rhs, - ) - .into(); - output - }, - ) - .register( - "mul_vec4", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::DMat4::mul_vec4( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "orthographic_lh", - |left: f64, right: f64, bottom: f64, top: f64, near: f64, far: f64| { - let output: Val = bevy::math::DMat4::orthographic_lh( - left, - right, - bottom, - top, - near, - far, - ) - .into(); - output - }, - ) - .register( - "orthographic_rh", - |left: f64, right: f64, bottom: f64, top: f64, near: f64, far: f64| { - let output: Val = bevy::math::DMat4::orthographic_rh( - left, - right, - bottom, - top, - near, - far, - ) - .into(); - output - }, - ) - .register( - "orthographic_rh_gl", - |left: f64, right: f64, bottom: f64, top: f64, near: f64, far: f64| { - let output: Val = bevy::math::DMat4::orthographic_rh_gl( - left, - right, - bottom, - top, - near, - far, - ) - .into(); - output - }, - ) - .register( - "perspective_infinite_lh", - |fov_y_radians: f64, aspect_ratio: f64, z_near: f64| { - let output: Val = bevy::math::DMat4::perspective_infinite_lh( - fov_y_radians, - aspect_ratio, - z_near, - ) - .into(); - output - }, - ) - .register( - "perspective_infinite_reverse_lh", - |fov_y_radians: f64, aspect_ratio: f64, z_near: f64| { - let output: Val = bevy::math::DMat4::perspective_infinite_reverse_lh( - fov_y_radians, - aspect_ratio, - z_near, - ) - .into(); - output - }, - ) - .register( - "perspective_infinite_reverse_rh", - |fov_y_radians: f64, aspect_ratio: f64, z_near: f64| { - let output: Val = bevy::math::DMat4::perspective_infinite_reverse_rh( - fov_y_radians, - aspect_ratio, - z_near, - ) - .into(); - output - }, - ) - .register( - "perspective_infinite_rh", - |fov_y_radians: f64, aspect_ratio: f64, z_near: f64| { - let output: Val = bevy::math::DMat4::perspective_infinite_rh( - fov_y_radians, - aspect_ratio, - z_near, - ) - .into(); - output - }, - ) - .register( - "perspective_lh", - |fov_y_radians: f64, aspect_ratio: f64, z_near: f64, z_far: f64| { - let output: Val = bevy::math::DMat4::perspective_lh( - fov_y_radians, - aspect_ratio, - z_near, - z_far, - ) - .into(); - output - }, - ) - .register( - "perspective_rh", - |fov_y_radians: f64, aspect_ratio: f64, z_near: f64, z_far: f64| { - let output: Val = bevy::math::DMat4::perspective_rh( - fov_y_radians, - aspect_ratio, - z_near, - z_far, - ) - .into(); - output - }, - ) - .register( - "perspective_rh_gl", - |fov_y_radians: f64, aspect_ratio: f64, z_near: f64, z_far: f64| { - let output: Val = bevy::math::DMat4::perspective_rh_gl( - fov_y_radians, - aspect_ratio, - z_near, - z_far, - ) - .into(); - output - }, - ) - .register( - "project_point3", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::DMat4::project_point3( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "row", - |_self: Ref, index: usize| { - let output: Val = bevy::math::DMat4::row( - &_self, - index, - ) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "sub_mat4", - |_self: Ref, rhs: Ref| { - let output: Val = bevy::math::DMat4::sub_mat4( - &_self, - &rhs, - ) - .into(); - output - }, - ) - .register( - "to_cols_array", - |_self: Ref| { - let output: [f64; 16] = bevy::math::DMat4::to_cols_array(&_self) - .into(); - output - }, - ) - .register( - "to_cols_array_2d", - |_self: Ref| { - let output: [[f64; 4]; 4] = bevy::math::DMat4::to_cols_array_2d( - &_self, - ) - .into(); - output - }, - ) - .register( - "to_euler", - |_self: Ref, order: Val| { - let output: (f64, f64, f64) = bevy::math::DMat4::to_euler( - &_self, - order.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transform_point3", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::DMat4::transform_point3( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transform_vector3", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::DMat4::transform_vector3( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transpose", - |_self: Ref| { - let output: Val = bevy::math::DMat4::transpose( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::Affine2>::new(world) - .register( - "abs_diff_eq", - | - _self: Ref, - rhs: Val, - max_abs_diff: f32| - { - let output: bool = bevy::math::Affine2::abs_diff_eq( - &_self, - rhs.into_inner(), - max_abs_diff, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, rhs: Ref| { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - }, - ) - .register( - "from_angle", - |angle: f32| { - let output: Val = bevy::math::Affine2::from_angle( - angle, - ) - .into(); - output - }, - ) - .register( - "from_angle_translation", - |angle: f32, translation: Val| { - let output: Val = bevy::math::Affine2::from_angle_translation( - angle, - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_cols", - | - x_axis: Val, - y_axis: Val, - z_axis: Val| - { - let output: Val = bevy::math::Affine2::from_cols( - x_axis.into_inner(), - y_axis.into_inner(), - z_axis.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat2", - |matrix2: Val| { - let output: Val = bevy::math::Affine2::from_mat2( - matrix2.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat2_translation", - |matrix2: Val, translation: Val| { - let output: Val = bevy::math::Affine2::from_mat2_translation( - matrix2.into_inner(), - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat3", - |m: Val| { - let output: Val = bevy::math::Affine2::from_mat3( - m.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat3a", - |m: Val| { - let output: Val = bevy::math::Affine2::from_mat3a( - m.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_scale", - |scale: Val| { - let output: Val = bevy::math::Affine2::from_scale( - scale.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_scale_angle_translation", - | - scale: Val, - angle: f32, - translation: Val| - { - let output: Val = bevy::math::Affine2::from_scale_angle_translation( - scale.into_inner(), - angle, - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_translation", - |translation: Val| { - let output: Val = bevy::math::Affine2::from_translation( - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "inverse", - |_self: Ref| { - let output: Val = bevy::math::Affine2::inverse( - &_self, - ) - .into(); - output - }, - ) - .register( - "is_finite", - |_self: Ref| { - let output: bool = bevy::math::Affine2::is_finite(&_self).into(); - output - }, - ) - .register( - "is_nan", - |_self: Ref| { - let output: bool = bevy::math::Affine2::is_nan(&_self).into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "to_cols_array", - |_self: Ref| { - let output: [f32; 6] = bevy::math::Affine2::to_cols_array(&_self) - .into(); - output - }, - ) - .register( - "to_cols_array_2d", - |_self: Ref| { - let output: [[f32; 2]; 3] = bevy::math::Affine2::to_cols_array_2d( - &_self, - ) - .into(); - output - }, - ) - .register( - "transform_point2", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Affine2::transform_point2( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transform_vector2", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Affine2::transform_vector2( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::Affine3A>::new(world) - .register( - "abs_diff_eq", - | - _self: Ref, - rhs: Val, - max_abs_diff: f32| - { - let output: bool = bevy::math::Affine3A::abs_diff_eq( - &_self, - rhs.into_inner(), - max_abs_diff, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, rhs: Ref| { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - }, - ) - .register( - "from_axis_angle", - |axis: Val, angle: f32| { - let output: Val = bevy::math::Affine3A::from_axis_angle( - axis.into_inner(), - angle, - ) - .into(); - output - }, - ) - .register( - "from_cols", - | - x_axis: Val, - y_axis: Val, - z_axis: Val, - w_axis: Val| - { - let output: Val = bevy::math::Affine3A::from_cols( - x_axis.into_inner(), - y_axis.into_inner(), - z_axis.into_inner(), - w_axis.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat3", - |mat3: Val| { - let output: Val = bevy::math::Affine3A::from_mat3( - mat3.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat3_translation", - |mat3: Val, translation: Val| { - let output: Val = bevy::math::Affine3A::from_mat3_translation( - mat3.into_inner(), - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat4", - |m: Val| { - let output: Val = bevy::math::Affine3A::from_mat4( - m.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_quat", - |rotation: Val| { - let output: Val = bevy::math::Affine3A::from_quat( - rotation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_rotation_translation", - |rotation: Val, translation: Val| { - let output: Val = bevy::math::Affine3A::from_rotation_translation( - rotation.into_inner(), - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_rotation_x", - |angle: f32| { - let output: Val = bevy::math::Affine3A::from_rotation_x( - angle, - ) - .into(); - output - }, - ) - .register( - "from_rotation_y", - |angle: f32| { - let output: Val = bevy::math::Affine3A::from_rotation_y( - angle, - ) - .into(); - output - }, - ) - .register( - "from_rotation_z", - |angle: f32| { - let output: Val = bevy::math::Affine3A::from_rotation_z( - angle, - ) - .into(); - output - }, - ) - .register( - "from_scale", - |scale: Val| { - let output: Val = bevy::math::Affine3A::from_scale( - scale.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_scale_rotation_translation", - | - scale: Val, - rotation: Val, - translation: Val| - { - let output: Val = bevy::math::Affine3A::from_scale_rotation_translation( - scale.into_inner(), - rotation.into_inner(), - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_translation", - |translation: Val| { - let output: Val = bevy::math::Affine3A::from_translation( - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "inverse", - |_self: Ref| { - let output: Val = bevy::math::Affine3A::inverse( - &_self, - ) - .into(); - output - }, - ) - .register( - "is_finite", - |_self: Ref| { - let output: bool = bevy::math::Affine3A::is_finite(&_self).into(); - output - }, - ) - .register( - "is_nan", - |_self: Ref| { - let output: bool = bevy::math::Affine3A::is_nan(&_self).into(); - output - }, - ) - .register( - "look_at_lh", - | - eye: Val, - center: Val, - up: Val| - { - let output: Val = bevy::math::Affine3A::look_at_lh( - eye.into_inner(), - center.into_inner(), - up.into_inner(), - ) - .into(); - output - }, - ) - .register( - "look_at_rh", - | - eye: Val, - center: Val, - up: Val| - { - let output: Val = bevy::math::Affine3A::look_at_rh( - eye.into_inner(), - center.into_inner(), - up.into_inner(), - ) - .into(); - output - }, - ) - .register( - "look_to_lh", - | - eye: Val, - dir: Val, - up: Val| - { - let output: Val = bevy::math::Affine3A::look_to_lh( - eye.into_inner(), - dir.into_inner(), - up.into_inner(), - ) - .into(); - output - }, - ) - .register( - "look_to_rh", - | - eye: Val, - dir: Val, - up: Val| - { - let output: Val = bevy::math::Affine3A::look_to_rh( - eye.into_inner(), - dir.into_inner(), - up.into_inner(), - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "to_cols_array", - |_self: Ref| { - let output: [f32; 12] = bevy::math::Affine3A::to_cols_array(&_self) - .into(); - output - }, - ) - .register( - "to_cols_array_2d", - |_self: Ref| { - let output: [[f32; 3]; 4] = bevy::math::Affine3A::to_cols_array_2d( - &_self, - ) - .into(); - output - }, - ) - .register( - "transform_point3", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Affine3A::transform_point3( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transform_point3a", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Affine3A::transform_point3a( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transform_vector3", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Affine3A::transform_vector3( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transform_vector3a", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::Affine3A::transform_vector3a( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::DAffine2>::new(world) - .register( - "abs_diff_eq", - | - _self: Ref, - rhs: Val, - max_abs_diff: f64| - { - let output: bool = bevy::math::DAffine2::abs_diff_eq( - &_self, - rhs.into_inner(), - max_abs_diff, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, rhs: Ref| { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - }, - ) - .register( - "from_angle", - |angle: f64| { - let output: Val = bevy::math::DAffine2::from_angle( - angle, - ) - .into(); - output - }, - ) - .register( - "from_angle_translation", - |angle: f64, translation: Val| { - let output: Val = bevy::math::DAffine2::from_angle_translation( - angle, - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_cols", - | - x_axis: Val, - y_axis: Val, - z_axis: Val| - { - let output: Val = bevy::math::DAffine2::from_cols( - x_axis.into_inner(), - y_axis.into_inner(), - z_axis.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat2", - |matrix2: Val| { - let output: Val = bevy::math::DAffine2::from_mat2( - matrix2.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat2_translation", - |matrix2: Val, translation: Val| { - let output: Val = bevy::math::DAffine2::from_mat2_translation( - matrix2.into_inner(), - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat3", - |m: Val| { - let output: Val = bevy::math::DAffine2::from_mat3( - m.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_scale", - |scale: Val| { - let output: Val = bevy::math::DAffine2::from_scale( - scale.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_scale_angle_translation", - | - scale: Val, - angle: f64, - translation: Val| - { - let output: Val = bevy::math::DAffine2::from_scale_angle_translation( - scale.into_inner(), - angle, - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_translation", - |translation: Val| { - let output: Val = bevy::math::DAffine2::from_translation( - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "inverse", - |_self: Ref| { - let output: Val = bevy::math::DAffine2::inverse( - &_self, - ) - .into(); - output - }, - ) - .register( - "is_finite", - |_self: Ref| { - let output: bool = bevy::math::DAffine2::is_finite(&_self).into(); - output - }, - ) - .register( - "is_nan", - |_self: Ref| { - let output: bool = bevy::math::DAffine2::is_nan(&_self).into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "to_cols_array", - |_self: Ref| { - let output: [f64; 6] = bevy::math::DAffine2::to_cols_array(&_self) - .into(); - output - }, - ) - .register( - "to_cols_array_2d", - |_self: Ref| { - let output: [[f64; 2]; 3] = bevy::math::DAffine2::to_cols_array_2d( - &_self, - ) - .into(); - output - }, - ) - .register( - "transform_point2", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::DAffine2::transform_point2( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transform_vector2", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::DAffine2::transform_vector2( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::DAffine3>::new(world) - .register( - "abs_diff_eq", - | - _self: Ref, - rhs: Val, - max_abs_diff: f64| - { - let output: bool = bevy::math::DAffine3::abs_diff_eq( - &_self, - rhs.into_inner(), - max_abs_diff, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, rhs: Ref| { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - }, - ) - .register( - "from_axis_angle", - |axis: Val, angle: f64| { - let output: Val = bevy::math::DAffine3::from_axis_angle( - axis.into_inner(), - angle, - ) - .into(); - output - }, - ) - .register( - "from_cols", - | - x_axis: Val, - y_axis: Val, - z_axis: Val, - w_axis: Val| - { - let output: Val = bevy::math::DAffine3::from_cols( - x_axis.into_inner(), - y_axis.into_inner(), - z_axis.into_inner(), - w_axis.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat3", - |mat3: Val| { - let output: Val = bevy::math::DAffine3::from_mat3( - mat3.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat3_translation", - |mat3: Val, translation: Val| { - let output: Val = bevy::math::DAffine3::from_mat3_translation( - mat3.into_inner(), - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_mat4", - |m: Val| { - let output: Val = bevy::math::DAffine3::from_mat4( - m.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_quat", - |rotation: Val| { - let output: Val = bevy::math::DAffine3::from_quat( - rotation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_rotation_translation", - |rotation: Val, translation: Val| { - let output: Val = bevy::math::DAffine3::from_rotation_translation( - rotation.into_inner(), - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_rotation_x", - |angle: f64| { - let output: Val = bevy::math::DAffine3::from_rotation_x( - angle, - ) - .into(); - output - }, - ) - .register( - "from_rotation_y", - |angle: f64| { - let output: Val = bevy::math::DAffine3::from_rotation_y( - angle, - ) - .into(); - output - }, - ) - .register( - "from_rotation_z", - |angle: f64| { - let output: Val = bevy::math::DAffine3::from_rotation_z( - angle, - ) - .into(); - output - }, - ) - .register( - "from_scale", - |scale: Val| { - let output: Val = bevy::math::DAffine3::from_scale( - scale.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_scale_rotation_translation", - | - scale: Val, - rotation: Val, - translation: Val| - { - let output: Val = bevy::math::DAffine3::from_scale_rotation_translation( - scale.into_inner(), - rotation.into_inner(), - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_translation", - |translation: Val| { - let output: Val = bevy::math::DAffine3::from_translation( - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "inverse", - |_self: Ref| { - let output: Val = bevy::math::DAffine3::inverse( - &_self, - ) - .into(); - output - }, - ) - .register( - "is_finite", - |_self: Ref| { - let output: bool = bevy::math::DAffine3::is_finite(&_self).into(); - output - }, - ) - .register( - "is_nan", - |_self: Ref| { - let output: bool = bevy::math::DAffine3::is_nan(&_self).into(); - output - }, - ) - .register( - "look_at_lh", - | - eye: Val, - center: Val, - up: Val| - { - let output: Val = bevy::math::DAffine3::look_at_lh( - eye.into_inner(), - center.into_inner(), - up.into_inner(), - ) - .into(); - output - }, - ) - .register( - "look_at_rh", - | - eye: Val, - center: Val, - up: Val| - { - let output: Val = bevy::math::DAffine3::look_at_rh( - eye.into_inner(), - center.into_inner(), - up.into_inner(), - ) - .into(); - output - }, - ) - .register( - "look_to_lh", - | - eye: Val, - dir: Val, - up: Val| - { - let output: Val = bevy::math::DAffine3::look_to_lh( - eye.into_inner(), - dir.into_inner(), - up.into_inner(), - ) - .into(); - output - }, - ) - .register( - "look_to_rh", - | - eye: Val, - dir: Val, - up: Val| - { - let output: Val = bevy::math::DAffine3::look_to_rh( - eye.into_inner(), - dir.into_inner(), - up.into_inner(), - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "to_cols_array", - |_self: Ref| { - let output: [f64; 12] = bevy::math::DAffine3::to_cols_array(&_self) - .into(); - output - }, - ) - .register( - "to_cols_array_2d", - |_self: Ref| { - let output: [[f64; 3]; 4] = bevy::math::DAffine3::to_cols_array_2d( - &_self, - ) - .into(); - output - }, - ) - .register( - "transform_point3", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::DAffine3::transform_point3( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "transform_vector3", - |_self: Ref, rhs: Val| { - let output: Val = bevy::math::DAffine3::transform_vector3( - &_self, - rhs.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::DQuat>::new(world) - .register( - "abs_diff_eq", - | - _self: Val, - rhs: Val, - max_abs_diff: f64| - { - let output: bool = bevy::math::DQuat::abs_diff_eq( - _self.into_inner(), - rhs.into_inner(), - max_abs_diff, - ) - .into(); - output - }, - ) - .register( - "add", - |_self: Val, rhs: Val| { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "angle_between", - |_self: Val, rhs: Val| { - let output: f64 = bevy::math::DQuat::angle_between( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "as_quat", - |_self: Val| { - let output: Val = bevy::math::DQuat::as_quat( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "conjugate", - |_self: Val| { - let output: Val = bevy::math::DQuat::conjugate( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "div", - |_self: Val, rhs: f64| { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "dot", - |_self: Val, rhs: Val| { - let output: f64 = bevy::math::DQuat::dot( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, rhs: Ref| { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - }, - ) - .register( - "from_affine3", - |a: Ref| { - let output: Val = bevy::math::DQuat::from_affine3( - &a, - ) - .into(); - output - }, - ) - .register( - "from_array", - |a: [f64; 4]| { - let output: Val = bevy::math::DQuat::from_array(a) - .into(); - output - }, - ) - .register( - "from_axis_angle", - |axis: Val, angle: f64| { - let output: Val = bevy::math::DQuat::from_axis_angle( - axis.into_inner(), - angle, - ) - .into(); - output - }, - ) - .register( - "from_euler", - |euler: Val, a: f64, b: f64, c: f64| { - let output: Val = bevy::math::DQuat::from_euler( - euler.into_inner(), - a, - b, - c, - ) - .into(); - output - }, - ) - .register( - "from_mat3", - |mat: Ref| { - let output: Val = bevy::math::DQuat::from_mat3( - &mat, - ) - .into(); - output - }, - ) - .register( - "from_mat4", - |mat: Ref| { - let output: Val = bevy::math::DQuat::from_mat4( - &mat, - ) - .into(); - output - }, - ) - .register( - "from_rotation_arc", - |from: Val, to: Val| { - let output: Val = bevy::math::DQuat::from_rotation_arc( - from.into_inner(), - to.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_rotation_arc_2d", - |from: Val, to: Val| { - let output: Val = bevy::math::DQuat::from_rotation_arc_2d( - from.into_inner(), - to.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_rotation_arc_colinear", - |from: Val, to: Val| { - let output: Val = bevy::math::DQuat::from_rotation_arc_colinear( - from.into_inner(), - to.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_rotation_x", - |angle: f64| { - let output: Val = bevy::math::DQuat::from_rotation_x( - angle, - ) - .into(); - output - }, - ) - .register( - "from_rotation_y", - |angle: f64| { - let output: Val = bevy::math::DQuat::from_rotation_y( - angle, - ) - .into(); - output - }, - ) - .register( - "from_rotation_z", - |angle: f64| { - let output: Val = bevy::math::DQuat::from_rotation_z( - angle, - ) - .into(); - output - }, - ) - .register( - "from_scaled_axis", - |v: Val| { - let output: Val = bevy::math::DQuat::from_scaled_axis( - v.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_vec4", - |v: Val| { - let output: Val = bevy::math::DQuat::from_vec4( - v.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_xyzw", - |x: f64, y: f64, z: f64, w: f64| { - let output: Val = bevy::math::DQuat::from_xyzw( - x, - y, - z, - w, - ) - .into(); - output - }, - ) - .register( - "inverse", - |_self: Val| { - let output: Val = bevy::math::DQuat::inverse( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_finite", - |_self: Val| { - let output: bool = bevy::math::DQuat::is_finite(_self.into_inner()) - .into(); - output - }, - ) - .register( - "is_nan", - |_self: Val| { - let output: bool = bevy::math::DQuat::is_nan(_self.into_inner()) - .into(); - output - }, - ) - .register( - "is_near_identity", - |_self: Val| { - let output: bool = bevy::math::DQuat::is_near_identity( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "is_normalized", - |_self: Val| { - let output: bool = bevy::math::DQuat::is_normalized( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "length", - |_self: Val| { - let output: f64 = bevy::math::DQuat::length(_self.into_inner()) - .into(); - output - }, - ) - .register( - "length_recip", - |_self: Val| { - let output: f64 = bevy::math::DQuat::length_recip(_self.into_inner()) - .into(); - output - }, - ) - .register( - "length_squared", - |_self: Val| { - let output: f64 = bevy::math::DQuat::length_squared( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "lerp", - |_self: Val, end: Val, s: f64| { - let output: Val = bevy::math::DQuat::lerp( - _self.into_inner(), - end.into_inner(), - s, - ) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: Val| { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - |_self: Val, rhs: f64| { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - }, - ) - .register( - "mul_quat", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DQuat::mul_quat( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "mul_vec3", - |_self: Val, rhs: Val| { - let output: Val = bevy::math::DQuat::mul_vec3( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - }, - ) - .register( - "neg", - |_self: Val| { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "normalize", - |_self: Val| { - let output: Val = bevy::math::DQuat::normalize( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rotate_towards", - | - _self: Ref, - rhs: Val, - max_angle: f64| - { - let output: Val = bevy::math::DQuat::rotate_towards( - &_self, - rhs.into_inner(), - max_angle, - ) - .into(); - output - }, - ) - .register( - "slerp", - |_self: Val, end: Val, s: f64| { - let output: Val = bevy::math::DQuat::slerp( - _self.into_inner(), - end.into_inner(), - s, - ) - .into(); - output - }, - ) - .register( - "sub", - |_self: Val, rhs: Val| { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - }, - ) - .register( - "to_array", - |_self: Ref| { - let output: [f64; 4] = bevy::math::DQuat::to_array(&_self).into(); - output - }, - ) - .register( - "to_euler", - |_self: Val, order: Val| { - let output: (f64, f64, f64) = bevy::math::DQuat::to_euler( - _self.into_inner(), - order.into_inner(), - ) - .into(); - output - }, - ) - .register( - "to_scaled_axis", - |_self: Val| { - let output: Val = bevy::math::DQuat::to_scaled_axis( - _self.into_inner(), - ) - .into(); - output - }, - ) - .register( - "xyz", - |_self: Val| { - let output: Val = bevy::math::DQuat::xyz( - _self.into_inner(), - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::EulerRot>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::BVec3A>::new(world) - .register( - "all", - |_self: Val| { - let output: bool = bevy::math::BVec3A::all(_self.into_inner()) - .into(); - output - }, - ) - .register( - "any", - |_self: Val| { - let output: bool = bevy::math::BVec3A::any(_self.into_inner()) - .into(); - output - }, - ) - .register( - "bitmask", - |_self: Val| { - let output: u32 = bevy::math::BVec3A::bitmask(_self.into_inner()) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, rhs: Ref| { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - }, - ) - .register( - "from_array", - |a: [bool; 3]| { - let output: Val = bevy::math::BVec3A::from_array( - a, - ) - .into(); - output - }, - ) - .register( - "new", - |x: bool, y: bool, z: bool| { - let output: Val = bevy::math::BVec3A::new( - x, - y, - z, - ) - .into(); - output - }, - ) - .register( - "set", - |mut _self: Mut, index: usize, value: bool| { - let output: () = bevy::math::BVec3A::set(&mut _self, index, value) - .into(); - output - }, - ) - .register( - "splat", - |v: bool| { - let output: Val = bevy::math::BVec3A::splat(v) - .into(); - output - }, - ) - .register( - "test", - |_self: Ref, index: usize| { - let output: bool = bevy::math::BVec3A::test(&_self, index).into(); - output - }, - ); - NamespaceBuilder::<::bevy::math::BVec4A>::new(world) - .register( - "all", - |_self: Val| { - let output: bool = bevy::math::BVec4A::all(_self.into_inner()) - .into(); - output - }, - ) - .register( - "any", - |_self: Val| { - let output: bool = bevy::math::BVec4A::any(_self.into_inner()) - .into(); - output - }, - ) - .register( - "bitmask", - |_self: Val| { - let output: u32 = bevy::math::BVec4A::bitmask(_self.into_inner()) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, rhs: Ref| { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - }, - ) - .register( - "from_array", - |a: [bool; 4]| { - let output: Val = bevy::math::BVec4A::from_array( - a, - ) - .into(); - output - }, - ) - .register( - "new", - |x: bool, y: bool, z: bool, w: bool| { - let output: Val = bevy::math::BVec4A::new( - x, - y, - z, - w, - ) - .into(); - output - }, - ) - .register( - "set", - |mut _self: Mut, index: usize, value: bool| { - let output: () = bevy::math::BVec4A::set(&mut _self, index, value) - .into(); - output - }, - ) - .register( - "splat", - |v: bool| { - let output: Val = bevy::math::BVec4A::splat(v) - .into(); - output - }, - ) - .register( - "test", - |_self: Ref, index: usize| { - let output: bool = bevy::math::BVec4A::test(&_self, index).into(); - output - }, - ); - NamespaceBuilder::<::smol_str::SmolStr>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "is_empty", - |_self: Ref| { - let output: bool = smol_str::SmolStr::is_empty(&_self).into(); - output - }, - ) - .register( - "is_heap_allocated", - |_self: Ref| { - let output: bool = smol_str::SmolStr::is_heap_allocated(&_self) - .into(); - output - }, - ) - .register( - "len", - |_self: Ref| { - let output: usize = smol_str::SmolStr::len(&_self).into(); - output - }, - ) - .register( - "to_string", - |_self: Ref| { - let output: std::string::String = smol_str::SmolStr::to_string( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::uuid::Uuid>::new(world) - .register( - "as_u128", - |_self: Ref| { - let output: u128 = uuid::Uuid::as_u128(&_self).into(); - output - }, - ) - .register( - "as_u64_pair", - |_self: Ref| { - let output: (u64, u64) = uuid::Uuid::as_u64_pair(&_self).into(); - output - }, - ) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "encode_buffer", - || { - let output: [u8; 45] = uuid::Uuid::encode_buffer().into(); - output - }, - ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "from_bytes", - |bytes: [u8; 16]| { - let output: Val = uuid::Uuid::from_bytes(bytes).into(); - output - }, - ) - .register( - "from_bytes_le", - |b: [u8; 16]| { - let output: Val = uuid::Uuid::from_bytes_le(b).into(); - output - }, - ) - .register( - "from_u128", - |v: u128| { - let output: Val = uuid::Uuid::from_u128(v).into(); - output - }, - ) - .register( - "from_u128_le", - |v: u128| { - let output: Val = uuid::Uuid::from_u128_le(v).into(); - output - }, - ) - .register( - "from_u64_pair", - |high_bits: u64, low_bits: u64| { - let output: Val = uuid::Uuid::from_u64_pair( - high_bits, - low_bits, - ) - .into(); - output - }, - ) - .register( - "get_node_id", - |_self: Ref| { - let output: bevy::reflect::erased_serde::__private::serde::__private::Option< - [u8; 6], - > = uuid::Uuid::get_node_id(&_self).into(); - output - }, - ) - .register( - "get_version_num", - |_self: Ref| { - let output: usize = uuid::Uuid::get_version_num(&_self).into(); - output - }, - ) - .register( - "into_bytes", - |_self: Val| { - let output: [u8; 16] = uuid::Uuid::into_bytes(_self.into_inner()) - .into(); - output - }, - ) - .register( - "is_max", - |_self: Ref| { - let output: bool = uuid::Uuid::is_max(&_self).into(); - output - }, - ) - .register( - "is_nil", - |_self: Ref| { - let output: bool = uuid::Uuid::is_nil(&_self).into(); - output - }, - ) - .register( - "max", - || { - let output: Val = uuid::Uuid::max().into(); - output - }, - ) - .register( - "new_v4", - || { - let output: Val = uuid::Uuid::new_v4().into(); - output - }, - ) - .register( - "nil", - || { - let output: Val = uuid::Uuid::nil().into(); - output - }, - ) - .register( - "to_bytes_le", - |_self: Ref| { - let output: [u8; 16] = uuid::Uuid::to_bytes_le(&_self).into(); - output - }, - ) - .register( - "to_u128_le", - |_self: Ref| { - let output: u128 = uuid::Uuid::to_u128_le(&_self).into(); - output - }, - ); + register_atomic_bool(&mut world); + register_atomic_i_16(&mut world); + register_atomic_i_32(&mut world); + register_atomic_i_64(&mut world); + register_atomic_i_8(&mut world); + register_atomic_isize(&mut world); + register_atomic_u_16(&mut world); + register_atomic_u_32(&mut world); + register_atomic_u_64(&mut world); + register_atomic_u_8(&mut world); + register_atomic_usize(&mut world); + register_duration(&mut world); + register_instant(&mut world); + register_range_full(&mut world); + register_quat(&mut world); + register_vec_3(&mut world); + register_i_vec_2(&mut world); + register_i_vec_3(&mut world); + register_i_vec_4(&mut world); + register_i_64_vec_2(&mut world); + register_i_64_vec_3(&mut world); + register_i_64_vec_4(&mut world); + register_u_vec_2(&mut world); + register_u_vec_3(&mut world); + register_u_vec_4(&mut world); + register_u_64_vec_2(&mut world); + register_u_64_vec_3(&mut world); + register_u_64_vec_4(&mut world); + register_vec_2(&mut world); + register_vec_3_a(&mut world); + register_vec_4(&mut world); + register_b_vec_2(&mut world); + register_b_vec_3(&mut world); + register_b_vec_4(&mut world); + register_d_vec_2(&mut world); + register_d_vec_3(&mut world); + register_d_vec_4(&mut world); + register_mat_2(&mut world); + register_mat_3(&mut world); + register_mat_3_a(&mut world); + register_mat_4(&mut world); + register_d_mat_2(&mut world); + register_d_mat_3(&mut world); + register_d_mat_4(&mut world); + register_affine_2(&mut world); + register_affine_3_a(&mut world); + register_d_affine_2(&mut world); + register_d_affine_3(&mut world); + register_d_quat(&mut world); + register_euler_rot(&mut world); + register_b_vec_3_a(&mut world); + register_b_vec_4_a(&mut world); + register_smol_str(&mut world); + register_uuid(&mut world); } } diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_time.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_time.rs index 1118b34f0a..a3b69ec93c 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_time.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_time.rs @@ -9,425 +9,298 @@ use bevy_mod_scripting_core::bindings::{ namespace::NamespaceBuilder, }, }; +use bevy_mod_scripting_derive::script_bindings; use crate::*; pub struct BevyTimeScriptingPlugin; -impl ::bevy::app::Plugin for BevyTimeScriptingPlugin { - fn build(&self, app: &mut ::bevy::prelude::App) { - let mut world = app.world_mut(); - NamespaceBuilder::<::bevy::time::prelude::Fixed>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::time::prelude::Real>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::time::prelude::Timer>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "duration", - |_self: Ref| { - let output: Val = bevy::time::prelude::Timer::duration( - &_self, - ) - .into(); - output - }, - ) - .register( - "elapsed", - |_self: Ref| { - let output: Val = bevy::time::prelude::Timer::elapsed( - &_self, - ) - .into(); - output - }, - ) - .register( - "elapsed_secs", - |_self: Ref| { - let output: f32 = bevy::time::prelude::Timer::elapsed_secs(&_self) - .into(); - output - }, - ) - .register( - "elapsed_secs_f64", - |_self: Ref| { - let output: f64 = bevy::time::prelude::Timer::elapsed_secs_f64( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "finished", - |_self: Ref| { - let output: bool = bevy::time::prelude::Timer::finished(&_self) - .into(); - output - }, - ) - .register( - "fraction", - |_self: Ref| { - let output: f32 = bevy::time::prelude::Timer::fraction(&_self) - .into(); - output - }, - ) - .register( - "fraction_remaining", - |_self: Ref| { - let output: f32 = bevy::time::prelude::Timer::fraction_remaining( - &_self, - ) - .into(); - output - }, - ) - .register( - "from_seconds", - |duration: f32, mode: Val| { - let output: Val = bevy::time::prelude::Timer::from_seconds( - duration, - mode.into_inner(), - ) - .into(); - output - }, - ) - .register( - "just_finished", - |_self: Ref| { - let output: bool = bevy::time::prelude::Timer::just_finished(&_self) - .into(); - output - }, - ) - .register( - "mode", - |_self: Ref| { - let output: Val = bevy::time::prelude::Timer::mode( - &_self, - ) - .into(); - output - }, - ) - .register( - "new", - | - duration: Val, - mode: Val| - { - let output: Val = bevy::time::prelude::Timer::new( - duration.into_inner(), - mode.into_inner(), - ) - .into(); - output - }, - ) - .register( - "pause", - |mut _self: Mut| { - let output: () = bevy::time::prelude::Timer::pause(&mut _self) - .into(); - output - }, - ) - .register( - "paused", - |_self: Ref| { - let output: bool = bevy::time::prelude::Timer::paused(&_self).into(); - output - }, - ) - .register( - "remaining", - |_self: Ref| { - let output: Val = bevy::time::prelude::Timer::remaining( - &_self, - ) - .into(); - output - }, - ) - .register( - "remaining_secs", - |_self: Ref| { - let output: f32 = bevy::time::prelude::Timer::remaining_secs(&_self) - .into(); - output - }, - ) - .register( - "reset", - |mut _self: Mut| { - let output: () = bevy::time::prelude::Timer::reset(&mut _self) - .into(); - output - }, - ) - .register( - "set_duration", - | - mut _self: Mut, - duration: Val| - { - let output: () = bevy::time::prelude::Timer::set_duration( - &mut _self, - duration.into_inner(), - ) - .into(); - output - }, - ) - .register( - "set_elapsed", - | - mut _self: Mut, - time: Val| - { - let output: () = bevy::time::prelude::Timer::set_elapsed( - &mut _self, - time.into_inner(), - ) - .into(); - output - }, - ) - .register( - "set_mode", - | - mut _self: Mut, - mode: Val| - { - let output: () = bevy::time::prelude::Timer::set_mode( - &mut _self, - mode.into_inner(), - ) - .into(); - output - }, - ) - .register( - "times_finished_this_tick", - |_self: Ref| { - let output: u32 = bevy::time::prelude::Timer::times_finished_this_tick( - &_self, - ) - .into(); - output - }, - ) - .register( - "unpause", - |mut _self: Mut| { - let output: () = bevy::time::prelude::Timer::unpause(&mut _self) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::time::prelude::TimerMode>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::time::prelude::Virtual>::new(world) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::time::Stopwatch>::new(world) - .register( - "assert_receiver_is_total_eq", - |_self: Ref| { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "elapsed", - |_self: Ref| { - let output: Val = bevy::time::Stopwatch::elapsed( - &_self, - ) - .into(); - output - }, - ) - .register( - "elapsed_secs", - |_self: Ref| { - let output: f32 = bevy::time::Stopwatch::elapsed_secs(&_self).into(); - output - }, +#[script_bindings(remote, name = "fixed")] +impl bevy::time::prelude::Fixed { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "real")] +impl bevy::time::prelude::Real { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "timer")] +impl bevy::time::prelude::Timer { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, ) - .register( - "elapsed_secs_f64", - |_self: Ref| { - let output: f64 = bevy::time::Stopwatch::elapsed_secs_f64(&_self) - .into(); - output - }, + .into(); + output + } + fn duration(_self: Ref) { + let output: Val = bevy::time::prelude::Timer::duration( + &_self, ) - .register( - "eq", - |_self: Ref, other: Ref| { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, + .into(); + output + } + fn elapsed(_self: Ref) { + let output: Val = bevy::time::prelude::Timer::elapsed( + &_self, ) - .register( - "is_paused", - |_self: Ref| { - let output: bool = bevy::time::Stopwatch::is_paused(&_self).into(); - output - }, + .into(); + output + } + fn elapsed_secs(_self: Ref) { + let output: f32 = bevy::time::prelude::Timer::elapsed_secs(&_self).into(); + output + } + fn elapsed_secs_f64(_self: Ref) { + let output: f64 = bevy::time::prelude::Timer::elapsed_secs_f64(&_self).into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn finished(_self: Ref) { + let output: bool = bevy::time::prelude::Timer::finished(&_self).into(); + output + } + fn fraction(_self: Ref) { + let output: f32 = bevy::time::prelude::Timer::fraction(&_self).into(); + output + } + fn fraction_remaining(_self: Ref) { + let output: f32 = bevy::time::prelude::Timer::fraction_remaining(&_self).into(); + output + } + fn from_seconds(duration: f32, mode: Val) { + let output: Val = bevy::time::prelude::Timer::from_seconds( + duration, + mode.into_inner(), ) - .register( - "new", - || { - let output: Val = bevy::time::Stopwatch::new() - .into(); - output - }, + .into(); + output + } + fn just_finished(_self: Ref) { + let output: bool = bevy::time::prelude::Timer::just_finished(&_self).into(); + output + } + fn mode(_self: Ref) { + let output: Val = bevy::time::prelude::Timer::mode( + &_self, ) - .register( - "pause", - |mut _self: Mut| { - let output: () = bevy::time::Stopwatch::pause(&mut _self).into(); - output - }, + .into(); + output + } + fn new( + duration: Val, + mode: Val, + ) { + let output: Val = bevy::time::prelude::Timer::new( + duration.into_inner(), + mode.into_inner(), + ) + .into(); + output + } + fn pause(mut _self: Mut) { + let output: () = bevy::time::prelude::Timer::pause(&mut _self).into(); + output + } + fn paused(_self: Ref) { + let output: bool = bevy::time::prelude::Timer::paused(&_self).into(); + output + } + fn remaining(_self: Ref) { + let output: Val = bevy::time::prelude::Timer::remaining( + &_self, ) - .register( - "reset", - |mut _self: Mut| { - let output: () = bevy::time::Stopwatch::reset(&mut _self).into(); - output - }, + .into(); + output + } + fn remaining_secs(_self: Ref) { + let output: f32 = bevy::time::prelude::Timer::remaining_secs(&_self).into(); + output + } + fn reset(mut _self: Mut) { + let output: () = bevy::time::prelude::Timer::reset(&mut _self).into(); + output + } + fn set_duration( + mut _self: Mut, + duration: Val, + ) { + let output: () = bevy::time::prelude::Timer::set_duration( + &mut _self, + duration.into_inner(), + ) + .into(); + output + } + fn set_elapsed( + mut _self: Mut, + time: Val, + ) { + let output: () = bevy::time::prelude::Timer::set_elapsed( + &mut _self, + time.into_inner(), + ) + .into(); + output + } + fn set_mode( + mut _self: Mut, + mode: Val, + ) { + let output: () = bevy::time::prelude::Timer::set_mode( + &mut _self, + mode.into_inner(), + ) + .into(); + output + } + fn times_finished_this_tick(_self: Ref) { + let output: u32 = bevy::time::prelude::Timer::times_finished_this_tick(&_self) + .into(); + output + } + fn unpause(mut _self: Mut) { + let output: () = bevy::time::prelude::Timer::unpause(&mut _self).into(); + output + } +} +#[script_bindings(remote, name = "timer_mode")] +impl bevy::time::prelude::TimerMode { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, ) - .register( - "set_elapsed", - | - mut _self: Mut, - time: Val| - { - let output: () = bevy::time::Stopwatch::set_elapsed( - &mut _self, - time.into_inner(), - ) - .into(); - output - }, + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } +} +#[script_bindings(remote, name = "virtual")] +impl bevy::time::prelude::Virtual { + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "stopwatch")] +impl bevy::time::Stopwatch { + fn assert_receiver_is_total_eq(_self: Ref) { + let output: () = ::assert_receiver_is_total_eq( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, ) - .register( - "unpause", - |mut _self: Mut| { - let output: () = bevy::time::Stopwatch::unpause(&mut _self).into(); - output - }, - ); + .into(); + output + } + fn elapsed(_self: Ref) { + let output: Val = bevy::time::Stopwatch::elapsed(&_self) + .into(); + output + } + fn elapsed_secs(_self: Ref) { + let output: f32 = bevy::time::Stopwatch::elapsed_secs(&_self).into(); + output + } + fn elapsed_secs_f64(_self: Ref) { + let output: f64 = bevy::time::Stopwatch::elapsed_secs_f64(&_self).into(); + output + } + fn eq(_self: Ref, other: Ref) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn is_paused(_self: Ref) { + let output: bool = bevy::time::Stopwatch::is_paused(&_self).into(); + output + } + fn new() { + let output: Val = bevy::time::Stopwatch::new().into(); + output + } + fn pause(mut _self: Mut) { + let output: () = bevy::time::Stopwatch::pause(&mut _self).into(); + output + } + fn reset(mut _self: Mut) { + let output: () = bevy::time::Stopwatch::reset(&mut _self).into(); + output + } + fn set_elapsed( + mut _self: Mut, + time: Val, + ) { + let output: () = bevy::time::Stopwatch::set_elapsed( + &mut _self, + time.into_inner(), + ) + .into(); + output + } + fn unpause(mut _self: Mut) { + let output: () = bevy::time::Stopwatch::unpause(&mut _self).into(); + output + } +} +impl ::bevy::app::Plugin for BevyTimeScriptingPlugin { + fn build(&self, app: &mut ::bevy::prelude::App) { + let mut world = app.world_mut(); + register_fixed(&mut world); + register_real(&mut world); + register_timer(&mut world); + register_timer_mode(&mut world); + register_virtual(&mut world); + register_stopwatch(&mut world); } } diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_transform.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_transform.rs index c74b804a17..7513f0ae05 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_transform.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_transform.rs @@ -9,804 +9,611 @@ use bevy_mod_scripting_core::bindings::{ namespace::NamespaceBuilder, }, }; +use bevy_mod_scripting_derive::script_bindings; use crate::*; pub struct BevyTransformScriptingPlugin; +#[script_bindings(remote, name = "global_transform")] +impl bevy::transform::components::GlobalTransform { + fn affine(_self: Ref) { + let output: Val = bevy::transform::components::GlobalTransform::affine( + &_self, + ) + .into(); + output + } + fn back(_self: Ref) { + let output: Val = bevy::transform::components::GlobalTransform::back( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn compute_matrix(_self: Ref) { + let output: Val = bevy::transform::components::GlobalTransform::compute_matrix( + &_self, + ) + .into(); + output + } + fn compute_transform(_self: Ref) { + let output: Val = bevy::transform::components::GlobalTransform::compute_transform( + &_self, + ) + .into(); + output + } + fn down(_self: Ref) { + let output: Val = bevy::transform::components::GlobalTransform::down( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn forward(_self: Ref) { + let output: Val = bevy::transform::components::GlobalTransform::forward( + &_self, + ) + .into(); + output + } + fn from_isometry(iso: Val) { + let output: Val = bevy::transform::components::GlobalTransform::from_isometry( + iso.into_inner(), + ) + .into(); + output + } + fn from_rotation(rotation: Val) { + let output: Val = bevy::transform::components::GlobalTransform::from_rotation( + rotation.into_inner(), + ) + .into(); + output + } + fn from_scale(scale: Val) { + let output: Val = bevy::transform::components::GlobalTransform::from_scale( + scale.into_inner(), + ) + .into(); + output + } + fn from_translation(translation: Val) { + let output: Val = bevy::transform::components::GlobalTransform::from_translation( + translation.into_inner(), + ) + .into(); + output + } + fn from_xyz(x: f32, y: f32, z: f32) { + let output: Val = bevy::transform::components::GlobalTransform::from_xyz( + x, + y, + z, + ) + .into(); + output + } + fn left(_self: Ref) { + let output: Val = bevy::transform::components::GlobalTransform::left( + &_self, + ) + .into(); + output + } + fn mul( + _self: Val, + value: Val, + ) { + let output: Val = >::mul(_self.into_inner(), value.into_inner()) + .into(); + output + } + fn mul( + _self: Val, + global_transform: Val, + ) { + let output: Val = >::mul(_self.into_inner(), global_transform.into_inner()) + .into(); + output + } + fn mul( + _self: Val, + transform: Val, + ) { + let output: Val = >::mul(_self.into_inner(), transform.into_inner()) + .into(); + output + } + fn mul_transform( + _self: Ref, + transform: Val, + ) { + let output: Val = bevy::transform::components::GlobalTransform::mul_transform( + &_self, + transform.into_inner(), + ) + .into(); + output + } + fn radius_vec3a( + _self: Ref, + extents: Val, + ) { + let output: f32 = bevy::transform::components::GlobalTransform::radius_vec3a( + &_self, + extents.into_inner(), + ) + .into(); + output + } + fn reparented_to( + _self: Ref, + parent: Ref, + ) { + let output: Val = bevy::transform::components::GlobalTransform::reparented_to( + &_self, + &parent, + ) + .into(); + output + } + fn right(_self: Ref) { + let output: Val = bevy::transform::components::GlobalTransform::right( + &_self, + ) + .into(); + output + } + fn rotation(_self: Ref) { + let output: Val = bevy::transform::components::GlobalTransform::rotation( + &_self, + ) + .into(); + output + } + fn scale(_self: Ref) { + let output: Val = bevy::transform::components::GlobalTransform::scale( + &_self, + ) + .into(); + output + } + fn to_isometry(_self: Ref) { + let output: Val = bevy::transform::components::GlobalTransform::to_isometry( + &_self, + ) + .into(); + output + } + fn transform_point( + _self: Ref, + point: Val, + ) { + let output: Val = bevy::transform::components::GlobalTransform::transform_point( + &_self, + point.into_inner(), + ) + .into(); + output + } + fn translation(_self: Ref) { + let output: Val = bevy::transform::components::GlobalTransform::translation( + &_self, + ) + .into(); + output + } + fn translation_vec3a(_self: Ref) { + let output: Val = bevy::transform::components::GlobalTransform::translation_vec3a( + &_self, + ) + .into(); + output + } + fn up(_self: Ref) { + let output: Val = bevy::transform::components::GlobalTransform::up( + &_self, + ) + .into(); + output + } +} +#[script_bindings(remote, name = "transform")] +impl bevy::transform::components::Transform { + fn back(_self: Ref) { + let output: Val = bevy::transform::components::Transform::back( + &_self, + ) + .into(); + output + } + fn clone(_self: Ref) { + let output: Val = ::clone( + &_self, + ) + .into(); + output + } + fn compute_affine(_self: Ref) { + let output: Val = bevy::transform::components::Transform::compute_affine( + &_self, + ) + .into(); + output + } + fn compute_matrix(_self: Ref) { + let output: Val = bevy::transform::components::Transform::compute_matrix( + &_self, + ) + .into(); + output + } + fn down(_self: Ref) { + let output: Val = bevy::transform::components::Transform::down( + &_self, + ) + .into(); + output + } + fn eq( + _self: Ref, + other: Ref, + ) { + let output: bool = >::eq(&_self, &other) + .into(); + output + } + fn forward(_self: Ref) { + let output: Val = bevy::transform::components::Transform::forward( + &_self, + ) + .into(); + output + } + fn from_isometry(iso: Val) { + let output: Val = bevy::transform::components::Transform::from_isometry( + iso.into_inner(), + ) + .into(); + output + } + fn from_matrix(world_from_local: Val) { + let output: Val = bevy::transform::components::Transform::from_matrix( + world_from_local.into_inner(), + ) + .into(); + output + } + fn from_rotation(rotation: Val) { + let output: Val = bevy::transform::components::Transform::from_rotation( + rotation.into_inner(), + ) + .into(); + output + } + fn from_scale(scale: Val) { + let output: Val = bevy::transform::components::Transform::from_scale( + scale.into_inner(), + ) + .into(); + output + } + fn from_translation(translation: Val) { + let output: Val = bevy::transform::components::Transform::from_translation( + translation.into_inner(), + ) + .into(); + output + } + fn from_xyz(x: f32, y: f32, z: f32) { + let output: Val = bevy::transform::components::Transform::from_xyz( + x, + y, + z, + ) + .into(); + output + } + fn is_finite(_self: Ref) { + let output: bool = bevy::transform::components::Transform::is_finite(&_self) + .into(); + output + } + fn left(_self: Ref) { + let output: Val = bevy::transform::components::Transform::left( + &_self, + ) + .into(); + output + } + fn local_x(_self: Ref) { + let output: Val = bevy::transform::components::Transform::local_x( + &_self, + ) + .into(); + output + } + fn local_y(_self: Ref) { + let output: Val = bevy::transform::components::Transform::local_y( + &_self, + ) + .into(); + output + } + fn local_z(_self: Ref) { + let output: Val = bevy::transform::components::Transform::local_z( + &_self, + ) + .into(); + output + } + fn mul( + _self: Val, + value: Val, + ) { + let output: Val = >::mul(_self.into_inner(), value.into_inner()) + .into(); + output + } + fn mul( + _self: Val, + global_transform: Val, + ) { + let output: Val = >::mul(_self.into_inner(), global_transform.into_inner()) + .into(); + output + } + fn mul( + _self: Val, + transform: Val, + ) { + let output: Val = >::mul(_self.into_inner(), transform.into_inner()) + .into(); + output + } + fn mul_transform( + _self: Ref, + transform: Val, + ) { + let output: Val = bevy::transform::components::Transform::mul_transform( + &_self, + transform.into_inner(), + ) + .into(); + output + } + fn right(_self: Ref) { + let output: Val = bevy::transform::components::Transform::right( + &_self, + ) + .into(); + output + } + fn rotate( + mut _self: Mut, + rotation: Val, + ) { + let output: () = bevy::transform::components::Transform::rotate( + &mut _self, + rotation.into_inner(), + ) + .into(); + output + } + fn rotate_around( + mut _self: Mut, + point: Val, + rotation: Val, + ) { + let output: () = bevy::transform::components::Transform::rotate_around( + &mut _self, + point.into_inner(), + rotation.into_inner(), + ) + .into(); + output + } + fn rotate_axis( + mut _self: Mut, + axis: Val, + angle: f32, + ) { + let output: () = bevy::transform::components::Transform::rotate_axis( + &mut _self, + axis.into_inner(), + angle, + ) + .into(); + output + } + fn rotate_local( + mut _self: Mut, + rotation: Val, + ) { + let output: () = bevy::transform::components::Transform::rotate_local( + &mut _self, + rotation.into_inner(), + ) + .into(); + output + } + fn rotate_local_axis( + mut _self: Mut, + axis: Val, + angle: f32, + ) { + let output: () = bevy::transform::components::Transform::rotate_local_axis( + &mut _self, + axis.into_inner(), + angle, + ) + .into(); + output + } + fn rotate_local_x( + mut _self: Mut, + angle: f32, + ) { + let output: () = bevy::transform::components::Transform::rotate_local_x( + &mut _self, + angle, + ) + .into(); + output + } + fn rotate_local_y( + mut _self: Mut, + angle: f32, + ) { + let output: () = bevy::transform::components::Transform::rotate_local_y( + &mut _self, + angle, + ) + .into(); + output + } + fn rotate_local_z( + mut _self: Mut, + angle: f32, + ) { + let output: () = bevy::transform::components::Transform::rotate_local_z( + &mut _self, + angle, + ) + .into(); + output + } + fn rotate_x(mut _self: Mut, angle: f32) { + let output: () = bevy::transform::components::Transform::rotate_x( + &mut _self, + angle, + ) + .into(); + output + } + fn rotate_y(mut _self: Mut, angle: f32) { + let output: () = bevy::transform::components::Transform::rotate_y( + &mut _self, + angle, + ) + .into(); + output + } + fn rotate_z(mut _self: Mut, angle: f32) { + let output: () = bevy::transform::components::Transform::rotate_z( + &mut _self, + angle, + ) + .into(); + output + } + fn to_isometry(_self: Ref) { + let output: Val = bevy::transform::components::Transform::to_isometry( + &_self, + ) + .into(); + output + } + fn transform_point( + _self: Ref, + point: Val, + ) { + let output: Val = bevy::transform::components::Transform::transform_point( + &_self, + point.into_inner(), + ) + .into(); + output + } + fn translate_around( + mut _self: Mut, + point: Val, + rotation: Val, + ) { + let output: () = bevy::transform::components::Transform::translate_around( + &mut _self, + point.into_inner(), + rotation.into_inner(), + ) + .into(); + output + } + fn up(_self: Ref) { + let output: Val = bevy::transform::components::Transform::up( + &_self, + ) + .into(); + output + } + fn with_rotation( + _self: Val, + rotation: Val, + ) { + let output: Val = bevy::transform::components::Transform::with_rotation( + _self.into_inner(), + rotation.into_inner(), + ) + .into(); + output + } + fn with_scale( + _self: Val, + scale: Val, + ) { + let output: Val = bevy::transform::components::Transform::with_scale( + _self.into_inner(), + scale.into_inner(), + ) + .into(); + output + } + fn with_translation( + _self: Val, + translation: Val, + ) { + let output: Val = bevy::transform::components::Transform::with_translation( + _self.into_inner(), + translation.into_inner(), + ) + .into(); + output + } +} impl ::bevy::app::Plugin for BevyTransformScriptingPlugin { fn build(&self, app: &mut ::bevy::prelude::App) { let mut world = app.world_mut(); - NamespaceBuilder::<::bevy::transform::components::GlobalTransform>::new(world) - .register( - "affine", - |_self: Ref| { - let output: Val = bevy::transform::components::GlobalTransform::affine( - &_self, - ) - .into(); - output - }, - ) - .register( - "back", - |_self: Ref| { - let output: Val = bevy::transform::components::GlobalTransform::back( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "compute_matrix", - |_self: Ref| { - let output: Val = bevy::transform::components::GlobalTransform::compute_matrix( - &_self, - ) - .into(); - output - }, - ) - .register( - "compute_transform", - |_self: Ref| { - let output: Val = bevy::transform::components::GlobalTransform::compute_transform( - &_self, - ) - .into(); - output - }, - ) - .register( - "down", - |_self: Ref| { - let output: Val = bevy::transform::components::GlobalTransform::down( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "forward", - |_self: Ref| { - let output: Val = bevy::transform::components::GlobalTransform::forward( - &_self, - ) - .into(); - output - }, - ) - .register( - "from_isometry", - |iso: Val| { - let output: Val = bevy::transform::components::GlobalTransform::from_isometry( - iso.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_rotation", - |rotation: Val| { - let output: Val = bevy::transform::components::GlobalTransform::from_rotation( - rotation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_scale", - |scale: Val| { - let output: Val = bevy::transform::components::GlobalTransform::from_scale( - scale.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_translation", - |translation: Val| { - let output: Val = bevy::transform::components::GlobalTransform::from_translation( - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_xyz", - |x: f32, y: f32, z: f32| { - let output: Val = bevy::transform::components::GlobalTransform::from_xyz( - x, - y, - z, - ) - .into(); - output - }, - ) - .register( - "left", - |_self: Ref| { - let output: Val = bevy::transform::components::GlobalTransform::left( - &_self, - ) - .into(); - output - }, - ) - .register( - "mul", - | - _self: Val, - value: Val| - { - let output: Val = >::mul(_self.into_inner(), value.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - | - _self: Val, - global_transform: Val| - { - let output: Val = >::mul(_self.into_inner(), global_transform.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - | - _self: Val, - transform: Val| - { - let output: Val = >::mul(_self.into_inner(), transform.into_inner()) - .into(); - output - }, - ) - .register( - "mul_transform", - | - _self: Ref, - transform: Val| - { - let output: Val = bevy::transform::components::GlobalTransform::mul_transform( - &_self, - transform.into_inner(), - ) - .into(); - output - }, - ) - .register( - "radius_vec3a", - | - _self: Ref, - extents: Val| - { - let output: f32 = bevy::transform::components::GlobalTransform::radius_vec3a( - &_self, - extents.into_inner(), - ) - .into(); - output - }, - ) - .register( - "reparented_to", - | - _self: Ref, - parent: Ref| - { - let output: Val = bevy::transform::components::GlobalTransform::reparented_to( - &_self, - &parent, - ) - .into(); - output - }, - ) - .register( - "right", - |_self: Ref| { - let output: Val = bevy::transform::components::GlobalTransform::right( - &_self, - ) - .into(); - output - }, - ) - .register( - "rotation", - |_self: Ref| { - let output: Val = bevy::transform::components::GlobalTransform::rotation( - &_self, - ) - .into(); - output - }, - ) - .register( - "scale", - |_self: Ref| { - let output: Val = bevy::transform::components::GlobalTransform::scale( - &_self, - ) - .into(); - output - }, - ) - .register( - "to_isometry", - |_self: Ref| { - let output: Val = bevy::transform::components::GlobalTransform::to_isometry( - &_self, - ) - .into(); - output - }, - ) - .register( - "transform_point", - | - _self: Ref, - point: Val| - { - let output: Val = bevy::transform::components::GlobalTransform::transform_point( - &_self, - point.into_inner(), - ) - .into(); - output - }, - ) - .register( - "translation", - |_self: Ref| { - let output: Val = bevy::transform::components::GlobalTransform::translation( - &_self, - ) - .into(); - output - }, - ) - .register( - "translation_vec3a", - |_self: Ref| { - let output: Val = bevy::transform::components::GlobalTransform::translation_vec3a( - &_self, - ) - .into(); - output - }, - ) - .register( - "up", - |_self: Ref| { - let output: Val = bevy::transform::components::GlobalTransform::up( - &_self, - ) - .into(); - output - }, - ); - NamespaceBuilder::<::bevy::transform::components::Transform>::new(world) - .register( - "back", - |_self: Ref| { - let output: Val = bevy::transform::components::Transform::back( - &_self, - ) - .into(); - output - }, - ) - .register( - "clone", - |_self: Ref| { - let output: Val = ::clone( - &_self, - ) - .into(); - output - }, - ) - .register( - "compute_affine", - |_self: Ref| { - let output: Val = bevy::transform::components::Transform::compute_affine( - &_self, - ) - .into(); - output - }, - ) - .register( - "compute_matrix", - |_self: Ref| { - let output: Val = bevy::transform::components::Transform::compute_matrix( - &_self, - ) - .into(); - output - }, - ) - .register( - "down", - |_self: Ref| { - let output: Val = bevy::transform::components::Transform::down( - &_self, - ) - .into(); - output - }, - ) - .register( - "eq", - | - _self: Ref, - other: Ref| - { - let output: bool = >::eq(&_self, &other) - .into(); - output - }, - ) - .register( - "forward", - |_self: Ref| { - let output: Val = bevy::transform::components::Transform::forward( - &_self, - ) - .into(); - output - }, - ) - .register( - "from_isometry", - |iso: Val| { - let output: Val = bevy::transform::components::Transform::from_isometry( - iso.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_matrix", - |world_from_local: Val| { - let output: Val = bevy::transform::components::Transform::from_matrix( - world_from_local.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_rotation", - |rotation: Val| { - let output: Val = bevy::transform::components::Transform::from_rotation( - rotation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_scale", - |scale: Val| { - let output: Val = bevy::transform::components::Transform::from_scale( - scale.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_translation", - |translation: Val| { - let output: Val = bevy::transform::components::Transform::from_translation( - translation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "from_xyz", - |x: f32, y: f32, z: f32| { - let output: Val = bevy::transform::components::Transform::from_xyz( - x, - y, - z, - ) - .into(); - output - }, - ) - .register( - "is_finite", - |_self: Ref| { - let output: bool = bevy::transform::components::Transform::is_finite( - &_self, - ) - .into(); - output - }, - ) - .register( - "left", - |_self: Ref| { - let output: Val = bevy::transform::components::Transform::left( - &_self, - ) - .into(); - output - }, - ) - .register( - "local_x", - |_self: Ref| { - let output: Val = bevy::transform::components::Transform::local_x( - &_self, - ) - .into(); - output - }, - ) - .register( - "local_y", - |_self: Ref| { - let output: Val = bevy::transform::components::Transform::local_y( - &_self, - ) - .into(); - output - }, - ) - .register( - "local_z", - |_self: Ref| { - let output: Val = bevy::transform::components::Transform::local_z( - &_self, - ) - .into(); - output - }, - ) - .register( - "mul", - | - _self: Val, - value: Val| - { - let output: Val = >::mul(_self.into_inner(), value.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - | - _self: Val, - global_transform: Val| - { - let output: Val = >::mul(_self.into_inner(), global_transform.into_inner()) - .into(); - output - }, - ) - .register( - "mul", - | - _self: Val, - transform: Val| - { - let output: Val = >::mul(_self.into_inner(), transform.into_inner()) - .into(); - output - }, - ) - .register( - "mul_transform", - | - _self: Ref, - transform: Val| - { - let output: Val = bevy::transform::components::Transform::mul_transform( - &_self, - transform.into_inner(), - ) - .into(); - output - }, - ) - .register( - "right", - |_self: Ref| { - let output: Val = bevy::transform::components::Transform::right( - &_self, - ) - .into(); - output - }, - ) - .register( - "rotate", - | - mut _self: Mut, - rotation: Val| - { - let output: () = bevy::transform::components::Transform::rotate( - &mut _self, - rotation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rotate_around", - | - mut _self: Mut, - point: Val, - rotation: Val| - { - let output: () = bevy::transform::components::Transform::rotate_around( - &mut _self, - point.into_inner(), - rotation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rotate_axis", - | - mut _self: Mut, - axis: Val, - angle: f32| - { - let output: () = bevy::transform::components::Transform::rotate_axis( - &mut _self, - axis.into_inner(), - angle, - ) - .into(); - output - }, - ) - .register( - "rotate_local", - | - mut _self: Mut, - rotation: Val| - { - let output: () = bevy::transform::components::Transform::rotate_local( - &mut _self, - rotation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "rotate_local_axis", - | - mut _self: Mut, - axis: Val, - angle: f32| - { - let output: () = bevy::transform::components::Transform::rotate_local_axis( - &mut _self, - axis.into_inner(), - angle, - ) - .into(); - output - }, - ) - .register( - "rotate_local_x", - |mut _self: Mut, angle: f32| { - let output: () = bevy::transform::components::Transform::rotate_local_x( - &mut _self, - angle, - ) - .into(); - output - }, - ) - .register( - "rotate_local_y", - |mut _self: Mut, angle: f32| { - let output: () = bevy::transform::components::Transform::rotate_local_y( - &mut _self, - angle, - ) - .into(); - output - }, - ) - .register( - "rotate_local_z", - |mut _self: Mut, angle: f32| { - let output: () = bevy::transform::components::Transform::rotate_local_z( - &mut _self, - angle, - ) - .into(); - output - }, - ) - .register( - "rotate_x", - |mut _self: Mut, angle: f32| { - let output: () = bevy::transform::components::Transform::rotate_x( - &mut _self, - angle, - ) - .into(); - output - }, - ) - .register( - "rotate_y", - |mut _self: Mut, angle: f32| { - let output: () = bevy::transform::components::Transform::rotate_y( - &mut _self, - angle, - ) - .into(); - output - }, - ) - .register( - "rotate_z", - |mut _self: Mut, angle: f32| { - let output: () = bevy::transform::components::Transform::rotate_z( - &mut _self, - angle, - ) - .into(); - output - }, - ) - .register( - "to_isometry", - |_self: Ref| { - let output: Val = bevy::transform::components::Transform::to_isometry( - &_self, - ) - .into(); - output - }, - ) - .register( - "transform_point", - | - _self: Ref, - point: Val| - { - let output: Val = bevy::transform::components::Transform::transform_point( - &_self, - point.into_inner(), - ) - .into(); - output - }, - ) - .register( - "translate_around", - | - mut _self: Mut, - point: Val, - rotation: Val| - { - let output: () = bevy::transform::components::Transform::translate_around( - &mut _self, - point.into_inner(), - rotation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "up", - |_self: Ref| { - let output: Val = bevy::transform::components::Transform::up( - &_self, - ) - .into(); - output - }, - ) - .register( - "with_rotation", - | - _self: Val, - rotation: Val| - { - let output: Val = bevy::transform::components::Transform::with_rotation( - _self.into_inner(), - rotation.into_inner(), - ) - .into(); - output - }, - ) - .register( - "with_scale", - | - _self: Val, - scale: Val| - { - let output: Val = bevy::transform::components::Transform::with_scale( - _self.into_inner(), - scale.into_inner(), - ) - .into(); - output - }, - ) - .register( - "with_translation", - | - _self: Val, - translation: Val| - { - let output: Val = bevy::transform::components::Transform::with_translation( - _self.into_inner(), - translation.into_inner(), - ) - .into(); - output - }, - ); + register_global_transform(&mut world); + register_transform(&mut world); } } From 1958eb0b459017ec1e3468a6027ffc19b85a2255 Mon Sep 17 00:00:00 2001 From: makspll Date: Mon, 10 Feb 2025 13:38:39 +0000 Subject: [PATCH 04/13] add core path --- .github/workflows/bevy_mod_scripting.yml | 16 +++++----------- crates/bevy_api_gen/templates/footer.tera | 1 + 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/bevy_mod_scripting.yml b/.github/workflows/bevy_mod_scripting.yml index 888a815352..e4ddcc7c78 100644 --- a/.github/workflows/bevy_mod_scripting.yml +++ b/.github/workflows/bevy_mod_scripting.yml @@ -167,15 +167,9 @@ jobs: git add -A git commit -m "chore(codegen): update bevy bindings" git push -u origin ${{ env.CODEGEN_BRANCH_NAME }} --force - - uses: jwalton/gh-find-current-pr@master - if: steps.check_changes.outputs.changes - id: findPR - with: - state: all - - name: Create Or Update PR - if: steps.check_changes.outputs.changes && success() && steps.findPR.outputs.number + - name: Merge Changes + if: steps.check_changes.outputs.changes && github.ref != 'refs/heads/main' && github.ref != 'refs/heads/staging' run: | - gh pr list --base ${{ github.ref }} --search "chore(codegen): update bevy bindings" --json number > prs.json - if [ $(jq '. | length' prs.json) -eq 0 ]; then - gh pr create --title "chore(codegen): update bevy bindings" --body "This PR updates the bevy bindings for #${{ steps.findPR.outputs.number }}" --base ${{ github.ref }} --head ${{ env.CODEGEN_BRANCH_NAME }} || true - fi \ No newline at end of file + git checkout ${{ github.ref }} + git merge ${{ env.CODEGEN_BRANCH_NAME }} || echo "Merge conflict detected. Please resolve manually." + git push origin ${{ github.ref }} \ No newline at end of file diff --git a/crates/bevy_api_gen/templates/footer.tera b/crates/bevy_api_gen/templates/footer.tera index 9708fd61d3..8ceb84414b 100644 --- a/crates/bevy_api_gen/templates/footer.tera +++ b/crates/bevy_api_gen/templates/footer.tera @@ -11,6 +11,7 @@ pub struct {{ "ScriptingPlugin" | prefix_cratename | convert_case(case="upper_ca #[script_bindings( remote, name = "{{ item.ident | convert_case(case="snake") }}", + bms_core_path="bevy_mod_scripting_core" )] impl {{item.import_path}} { {% for function in item.functions %} From 7343c44c7b02a51a335149e4e25e109bf17ac19b Mon Sep 17 00:00:00 2001 From: makspll Date: Mon, 10 Feb 2025 13:50:59 +0000 Subject: [PATCH 05/13] update branch name --- .github/workflows/bevy_mod_scripting.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bevy_mod_scripting.yml b/.github/workflows/bevy_mod_scripting.yml index e4ddcc7c78..ad89029816 100644 --- a/.github/workflows/bevy_mod_scripting.yml +++ b/.github/workflows/bevy_mod_scripting.yml @@ -170,6 +170,6 @@ jobs: - name: Merge Changes if: steps.check_changes.outputs.changes && github.ref != 'refs/heads/main' && github.ref != 'refs/heads/staging' run: | - git checkout ${{ github.ref }} + git checkout ${{ github.head_ref || github.ref_name }} git merge ${{ env.CODEGEN_BRANCH_NAME }} || echo "Merge conflict detected. Please resolve manually." - git push origin ${{ github.ref }} \ No newline at end of file + git push origin ${{ github.head_ref || github.ref_name }} \ No newline at end of file From 5f169a2679ef7acf1b8638ab150c07dd76015fb3 Mon Sep 17 00:00:00 2001 From: makspll Date: Mon, 10 Feb 2025 14:00:52 +0000 Subject: [PATCH 06/13] simplify --- .github/workflows/bevy_mod_scripting.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bevy_mod_scripting.yml b/.github/workflows/bevy_mod_scripting.yml index ad89029816..dad48446f2 100644 --- a/.github/workflows/bevy_mod_scripting.yml +++ b/.github/workflows/bevy_mod_scripting.yml @@ -144,6 +144,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref || github.ref_name }} - name: Setup Bot GitHub Credentials run: | git config user.name "github-actions[bot]" @@ -163,13 +165,6 @@ jobs: - name: Commit Changes if: steps.check_changes.outputs.changes run: | - git checkout -b ${{ env.CODEGEN_BRANCH_NAME }} || git checkout ${{ env.CODEGEN_BRANCH_NAME }} git add -A git commit -m "chore(codegen): update bevy bindings" - git push -u origin ${{ env.CODEGEN_BRANCH_NAME }} --force - - name: Merge Changes - if: steps.check_changes.outputs.changes && github.ref != 'refs/heads/main' && github.ref != 'refs/heads/staging' - run: | - git checkout ${{ github.head_ref || github.ref_name }} - git merge ${{ env.CODEGEN_BRANCH_NAME }} || echo "Merge conflict detected. Please resolve manually." - git push origin ${{ github.head_ref || github.ref_name }} \ No newline at end of file + git push \ No newline at end of file From 88d16e0f519144d262b9b773d1de3b58460a0c51 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 14:09:12 +0000 Subject: [PATCH 07/13] chore(codegen): update bevy bindings --- .../src/bevy_bindings/bevy_core.rs | 2 +- .../src/bevy_bindings/bevy_ecs.rs | 52 +++- .../src/bevy_bindings/bevy_hierarchy.rs | 10 +- .../src/bevy_bindings/bevy_input.rs | 228 +++++++++++++++--- .../src/bevy_bindings/bevy_math.rs | 214 +++++++++++----- .../src/bevy_bindings/bevy_reflect.rs | 192 ++++++++++----- .../src/bevy_bindings/bevy_time.rs | 16 +- .../src/bevy_bindings/bevy_transform.rs | 8 +- 8 files changed, 549 insertions(+), 173 deletions(-) diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_core.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_core.rs index 082d27f5a9..7d9347168f 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_core.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_core.rs @@ -12,7 +12,7 @@ use bevy_mod_scripting_core::bindings::{ use bevy_mod_scripting_derive::script_bindings; use crate::*; pub struct BevyCoreScriptingPlugin; -#[script_bindings(remote, name = "name")] +#[script_bindings(remote, name = "name", bms_core_path = "bevy_mod_scripting_core")] impl bevy::core::prelude::Name { fn clone(_self: Ref) { let output: Val = ::clone( diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_ecs.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_ecs.rs index b87c5fe438..7051204fcb 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_ecs.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_ecs.rs @@ -12,7 +12,7 @@ use bevy_mod_scripting_core::bindings::{ use bevy_mod_scripting_derive::script_bindings; use crate::*; pub struct BevyEcsScriptingPlugin; -#[script_bindings(remote, name = "entity")] +#[script_bindings(remote, name = "entity", bms_core_path = "bevy_mod_scripting_core")] impl bevy::ecs::entity::Entity { fn clone(_self: Ref) { let output: Val = ::clone( @@ -56,15 +56,23 @@ impl bevy::ecs::entity::Entity { output } } -#[script_bindings(remote, name = "on_add")] +#[script_bindings(remote, name = "on_add", bms_core_path = "bevy_mod_scripting_core")] impl bevy::ecs::world::OnAdd {} -#[script_bindings(remote, name = "on_insert")] +#[script_bindings(remote, name = "on_insert", bms_core_path = "bevy_mod_scripting_core")] impl bevy::ecs::world::OnInsert {} -#[script_bindings(remote, name = "on_remove")] +#[script_bindings(remote, name = "on_remove", bms_core_path = "bevy_mod_scripting_core")] impl bevy::ecs::world::OnRemove {} -#[script_bindings(remote, name = "on_replace")] +#[script_bindings( + remote, + name = "on_replace", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::ecs::world::OnReplace {} -#[script_bindings(remote, name = "component_id")] +#[script_bindings( + remote, + name = "component_id", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::ecs::component::ComponentId { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -103,7 +111,7 @@ impl bevy::ecs::component::ComponentId { output } } -#[script_bindings(remote, name = "tick")] +#[script_bindings(remote, name = "tick", bms_core_path = "bevy_mod_scripting_core")] impl bevy::ecs::component::Tick { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -158,7 +166,11 @@ impl bevy::ecs::component::Tick { output } } -#[script_bindings(remote, name = "component_ticks")] +#[script_bindings( + remote, + name = "component_ticks", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::ecs::component::ComponentTicks { fn clone(_self: Ref) { let output: Val = ::clone( @@ -212,7 +224,11 @@ impl bevy::ecs::component::ComponentTicks { output } } -#[script_bindings(remote, name = "identifier")] +#[script_bindings( + remote, + name = "identifier", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::ecs::identifier::Identifier { fn clone(_self: Ref) { let output: Val = ::clone( @@ -256,7 +272,11 @@ impl bevy::ecs::identifier::Identifier { output } } -#[script_bindings(remote, name = "entity_hash")] +#[script_bindings( + remote, + name = "entity_hash", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::ecs::entity::EntityHash { fn clone(_self: Ref) { let output: Val = ::clone( @@ -266,7 +286,11 @@ impl bevy::ecs::entity::EntityHash { output } } -#[script_bindings(remote, name = "removed_component_entity")] +#[script_bindings( + remote, + name = "removed_component_entity", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::ecs::removal_detection::RemovedComponentEntity { fn clone(_self: Ref) { let output: Val = ::clone( @@ -276,7 +300,11 @@ impl bevy::ecs::removal_detection::RemovedComponentEntity { output } } -#[script_bindings(remote, name = "system_id_marker")] +#[script_bindings( + remote, + name = "system_id_marker", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::ecs::system::SystemIdMarker {} impl ::bevy::app::Plugin for BevyEcsScriptingPlugin { fn build(&self, app: &mut ::bevy::prelude::App) { diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_hierarchy.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_hierarchy.rs index 778559f8f3..ad15237b29 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_hierarchy.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_hierarchy.rs @@ -12,7 +12,7 @@ use bevy_mod_scripting_core::bindings::{ use bevy_mod_scripting_derive::script_bindings; use crate::*; pub struct BevyHierarchyScriptingPlugin; -#[script_bindings(remote, name = "children")] +#[script_bindings(remote, name = "children", bms_core_path = "bevy_mod_scripting_core")] impl bevy::hierarchy::prelude::Children { fn swap( mut _self: Mut, @@ -28,7 +28,7 @@ impl bevy::hierarchy::prelude::Children { output } } -#[script_bindings(remote, name = "parent")] +#[script_bindings(remote, name = "parent", bms_core_path = "bevy_mod_scripting_core")] impl bevy::hierarchy::prelude::Parent { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -55,7 +55,11 @@ impl bevy::hierarchy::prelude::Parent { output } } -#[script_bindings(remote, name = "hierarchy_event")] +#[script_bindings( + remote, + name = "hierarchy_event", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::hierarchy::HierarchyEvent { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_input.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_input.rs index f67a167e81..dee786efa6 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_input.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_input.rs @@ -12,7 +12,7 @@ use bevy_mod_scripting_core::bindings::{ use bevy_mod_scripting_derive::script_bindings; use crate::*; pub struct BevyInputScriptingPlugin; -#[script_bindings(remote, name = "gamepad")] +#[script_bindings(remote, name = "gamepad", bms_core_path = "bevy_mod_scripting_core")] impl bevy::input::gamepad::Gamepad { fn dpad(_self: Ref) { let output: Val = bevy::input::gamepad::Gamepad::dpad(&_self) @@ -81,7 +81,11 @@ impl bevy::input::gamepad::Gamepad { output } } -#[script_bindings(remote, name = "gamepad_axis")] +#[script_bindings( + remote, + name = "gamepad_axis", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::gamepad::GamepadAxis { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -108,7 +112,11 @@ impl bevy::input::gamepad::GamepadAxis { output } } -#[script_bindings(remote, name = "gamepad_button")] +#[script_bindings( + remote, + name = "gamepad_button", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::gamepad::GamepadButton { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -135,7 +143,11 @@ impl bevy::input::gamepad::GamepadButton { output } } -#[script_bindings(remote, name = "gamepad_settings")] +#[script_bindings( + remote, + name = "gamepad_settings", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::gamepad::GamepadSettings { fn clone(_self: Ref) { let output: Val = ::clone( @@ -145,7 +157,7 @@ impl bevy::input::gamepad::GamepadSettings { output } } -#[script_bindings(remote, name = "key_code")] +#[script_bindings(remote, name = "key_code", bms_core_path = "bevy_mod_scripting_core")] impl bevy::input::keyboard::KeyCode { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -172,7 +184,11 @@ impl bevy::input::keyboard::KeyCode { output } } -#[script_bindings(remote, name = "mouse_button")] +#[script_bindings( + remote, + name = "mouse_button", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::mouse::MouseButton { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -199,7 +215,11 @@ impl bevy::input::mouse::MouseButton { output } } -#[script_bindings(remote, name = "touch_input")] +#[script_bindings( + remote, + name = "touch_input", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::touch::TouchInput { fn clone(_self: Ref) { let output: Val = ::clone( @@ -219,7 +239,11 @@ impl bevy::input::touch::TouchInput { output } } -#[script_bindings(remote, name = "keyboard_focus_lost")] +#[script_bindings( + remote, + name = "keyboard_focus_lost", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::keyboard::KeyboardFocusLost { fn assert_receiver_is_total_eq( _self: Ref, @@ -248,7 +272,11 @@ impl bevy::input::keyboard::KeyboardFocusLost { output } } -#[script_bindings(remote, name = "keyboard_input")] +#[script_bindings( + remote, + name = "keyboard_input", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::keyboard::KeyboardInput { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -275,7 +303,11 @@ impl bevy::input::keyboard::KeyboardInput { output } } -#[script_bindings(remote, name = "accumulated_mouse_motion")] +#[script_bindings( + remote, + name = "accumulated_mouse_motion", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::mouse::AccumulatedMouseMotion { fn clone(_self: Ref) { let output: Val = ::clone( @@ -295,7 +327,11 @@ impl bevy::input::mouse::AccumulatedMouseMotion { output } } -#[script_bindings(remote, name = "accumulated_mouse_scroll")] +#[script_bindings( + remote, + name = "accumulated_mouse_scroll", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::mouse::AccumulatedMouseScroll { fn clone(_self: Ref) { let output: Val = ::clone( @@ -315,7 +351,11 @@ impl bevy::input::mouse::AccumulatedMouseScroll { output } } -#[script_bindings(remote, name = "mouse_button_input")] +#[script_bindings( + remote, + name = "mouse_button_input", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::mouse::MouseButtonInput { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -342,7 +382,11 @@ impl bevy::input::mouse::MouseButtonInput { output } } -#[script_bindings(remote, name = "mouse_motion")] +#[script_bindings( + remote, + name = "mouse_motion", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::mouse::MouseMotion { fn clone(_self: Ref) { let output: Val = ::clone( @@ -362,7 +406,11 @@ impl bevy::input::mouse::MouseMotion { output } } -#[script_bindings(remote, name = "mouse_wheel")] +#[script_bindings( + remote, + name = "mouse_wheel", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::mouse::MouseWheel { fn clone(_self: Ref) { let output: Val = ::clone( @@ -382,7 +430,11 @@ impl bevy::input::mouse::MouseWheel { output } } -#[script_bindings(remote, name = "gamepad_axis_changed_event")] +#[script_bindings( + remote, + name = "gamepad_axis_changed_event", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::gamepad::GamepadAxisChangedEvent { fn clone(_self: Ref) { let output: Val = ::clone( @@ -415,7 +467,11 @@ impl bevy::input::gamepad::GamepadAxisChangedEvent { output } } -#[script_bindings(remote, name = "gamepad_button_changed_event")] +#[script_bindings( + remote, + name = "gamepad_button_changed_event", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::gamepad::GamepadButtonChangedEvent { fn clone(_self: Ref) { let output: Val = ::clone( @@ -450,7 +506,11 @@ impl bevy::input::gamepad::GamepadButtonChangedEvent { output } } -#[script_bindings(remote, name = "gamepad_button_state_changed_event")] +#[script_bindings( + remote, + name = "gamepad_button_state_changed_event", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::gamepad::GamepadButtonStateChangedEvent { fn assert_receiver_is_total_eq( _self: Ref, @@ -492,7 +552,11 @@ impl bevy::input::gamepad::GamepadButtonStateChangedEvent { output } } -#[script_bindings(remote, name = "gamepad_connection")] +#[script_bindings( + remote, + name = "gamepad_connection", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::gamepad::GamepadConnection { fn clone(_self: Ref) { let output: Val = ::clone( @@ -512,7 +576,11 @@ impl bevy::input::gamepad::GamepadConnection { output } } -#[script_bindings(remote, name = "gamepad_connection_event")] +#[script_bindings( + remote, + name = "gamepad_connection_event", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::gamepad::GamepadConnectionEvent { fn clone(_self: Ref) { let output: Val = ::clone( @@ -557,7 +625,11 @@ impl bevy::input::gamepad::GamepadConnectionEvent { output } } -#[script_bindings(remote, name = "gamepad_event")] +#[script_bindings( + remote, + name = "gamepad_event", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::gamepad::GamepadEvent { fn clone(_self: Ref) { let output: Val = ::clone( @@ -577,7 +649,11 @@ impl bevy::input::gamepad::GamepadEvent { output } } -#[script_bindings(remote, name = "gamepad_input")] +#[script_bindings( + remote, + name = "gamepad_input", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::gamepad::GamepadInput { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -604,7 +680,11 @@ impl bevy::input::gamepad::GamepadInput { output } } -#[script_bindings(remote, name = "gamepad_rumble_request")] +#[script_bindings( + remote, + name = "gamepad_rumble_request", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::gamepad::GamepadRumbleRequest { fn clone(_self: Ref) { let output: Val = ::clone( @@ -621,7 +701,11 @@ impl bevy::input::gamepad::GamepadRumbleRequest { output } } -#[script_bindings(remote, name = "raw_gamepad_axis_changed_event")] +#[script_bindings( + remote, + name = "raw_gamepad_axis_changed_event", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::gamepad::RawGamepadAxisChangedEvent { fn clone(_self: Ref) { let output: Val = ::clone( @@ -654,7 +738,11 @@ impl bevy::input::gamepad::RawGamepadAxisChangedEvent { output } } -#[script_bindings(remote, name = "raw_gamepad_button_changed_event")] +#[script_bindings( + remote, + name = "raw_gamepad_button_changed_event", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::gamepad::RawGamepadButtonChangedEvent { fn clone(_self: Ref) { let output: Val = ::clone( @@ -687,7 +775,11 @@ impl bevy::input::gamepad::RawGamepadButtonChangedEvent { output } } -#[script_bindings(remote, name = "raw_gamepad_event")] +#[script_bindings( + remote, + name = "raw_gamepad_event", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::gamepad::RawGamepadEvent { fn clone(_self: Ref) { let output: Val = ::clone( @@ -707,7 +799,11 @@ impl bevy::input::gamepad::RawGamepadEvent { output } } -#[script_bindings(remote, name = "pinch_gesture")] +#[script_bindings( + remote, + name = "pinch_gesture", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::gestures::PinchGesture { fn clone(_self: Ref) { let output: Val = ::clone( @@ -727,7 +823,11 @@ impl bevy::input::gestures::PinchGesture { output } } -#[script_bindings(remote, name = "rotation_gesture")] +#[script_bindings( + remote, + name = "rotation_gesture", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::gestures::RotationGesture { fn clone(_self: Ref) { let output: Val = ::clone( @@ -747,7 +847,11 @@ impl bevy::input::gestures::RotationGesture { output } } -#[script_bindings(remote, name = "double_tap_gesture")] +#[script_bindings( + remote, + name = "double_tap_gesture", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::gestures::DoubleTapGesture { fn clone(_self: Ref) { let output: Val = ::clone( @@ -767,7 +871,11 @@ impl bevy::input::gestures::DoubleTapGesture { output } } -#[script_bindings(remote, name = "pan_gesture")] +#[script_bindings( + remote, + name = "pan_gesture", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::gestures::PanGesture { fn clone(_self: Ref) { let output: Val = ::clone( @@ -787,7 +895,11 @@ impl bevy::input::gestures::PanGesture { output } } -#[script_bindings(remote, name = "button_state")] +#[script_bindings( + remote, + name = "button_state", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::ButtonState { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -815,7 +927,11 @@ impl bevy::input::ButtonState { output } } -#[script_bindings(remote, name = "button_settings")] +#[script_bindings( + remote, + name = "button_settings", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::gamepad::ButtonSettings { fn clone(_self: Ref) { let output: Val = ::clone( @@ -883,7 +999,11 @@ impl bevy::input::gamepad::ButtonSettings { output } } -#[script_bindings(remote, name = "axis_settings")] +#[script_bindings( + remote, + name = "axis_settings", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::gamepad::AxisSettings { fn clamp(_self: Ref, new_value: f32) { let output: f32 = bevy::input::gamepad::AxisSettings::clamp(&_self, new_value) @@ -997,7 +1117,11 @@ impl bevy::input::gamepad::AxisSettings { output } } -#[script_bindings(remote, name = "button_axis_settings")] +#[script_bindings( + remote, + name = "button_axis_settings", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::gamepad::ButtonAxisSettings { fn clone(_self: Ref) { let output: Val = ::clone( @@ -1020,7 +1144,11 @@ impl bevy::input::gamepad::ButtonAxisSettings { output } } -#[script_bindings(remote, name = "gamepad_rumble_intensity")] +#[script_bindings( + remote, + name = "gamepad_rumble_intensity", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::gamepad::GamepadRumbleIntensity { fn clone(_self: Ref) { let output: Val = ::clone( @@ -1054,7 +1182,7 @@ impl bevy::input::gamepad::GamepadRumbleIntensity { output } } -#[script_bindings(remote, name = "key")] +#[script_bindings(remote, name = "key", bms_core_path = "bevy_mod_scripting_core")] impl bevy::input::keyboard::Key { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -1081,7 +1209,11 @@ impl bevy::input::keyboard::Key { output } } -#[script_bindings(remote, name = "native_key_code")] +#[script_bindings( + remote, + name = "native_key_code", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::keyboard::NativeKeyCode { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -1108,7 +1240,11 @@ impl bevy::input::keyboard::NativeKeyCode { output } } -#[script_bindings(remote, name = "native_key")] +#[script_bindings( + remote, + name = "native_key", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::keyboard::NativeKey { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -1135,7 +1271,11 @@ impl bevy::input::keyboard::NativeKey { output } } -#[script_bindings(remote, name = "mouse_scroll_unit")] +#[script_bindings( + remote, + name = "mouse_scroll_unit", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::mouse::MouseScrollUnit { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -1162,7 +1302,11 @@ impl bevy::input::mouse::MouseScrollUnit { output } } -#[script_bindings(remote, name = "touch_phase")] +#[script_bindings( + remote, + name = "touch_phase", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::touch::TouchPhase { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -1189,7 +1333,11 @@ impl bevy::input::touch::TouchPhase { output } } -#[script_bindings(remote, name = "force_touch")] +#[script_bindings( + remote, + name = "force_touch", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::touch::ForceTouch { fn clone(_self: Ref) { let output: Val = ::clone( diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_math.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_math.rs index 23c55f007a..60185382c2 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_math.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_math.rs @@ -12,7 +12,11 @@ use bevy_mod_scripting_core::bindings::{ use bevy_mod_scripting_derive::script_bindings; use crate::*; pub struct BevyMathScriptingPlugin; -#[script_bindings(remote, name = "aspect_ratio")] +#[script_bindings( + remote, + name = "aspect_ratio", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::AspectRatio { fn clone(_self: Ref) { let output: Val = ::clone( @@ -52,7 +56,11 @@ impl bevy::math::AspectRatio { output } } -#[script_bindings(remote, name = "compass_octant")] +#[script_bindings( + remote, + name = "compass_octant", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::CompassOctant { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -76,7 +84,11 @@ impl bevy::math::CompassOctant { output } } -#[script_bindings(remote, name = "compass_quadrant")] +#[script_bindings( + remote, + name = "compass_quadrant", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::CompassQuadrant { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -103,7 +115,11 @@ impl bevy::math::CompassQuadrant { output } } -#[script_bindings(remote, name = "isometry_2_d")] +#[script_bindings( + remote, + name = "isometry_2_d", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::Isometry2d { fn clone(_self: Ref) { let output: Val = ::clone( @@ -209,7 +225,11 @@ impl bevy::math::Isometry2d { output } } -#[script_bindings(remote, name = "isometry_3_d")] +#[script_bindings( + remote, + name = "isometry_3_d", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::Isometry3d { fn clone(_self: Ref) { let output: Val = ::clone( @@ -286,7 +306,7 @@ impl bevy::math::Isometry3d { output } } -#[script_bindings(remote, name = "ray_2_d")] +#[script_bindings(remote, name = "ray_2_d", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::Ray2d { fn clone(_self: Ref) { let output: Val = ::clone( @@ -335,7 +355,7 @@ impl bevy::math::Ray2d { output } } -#[script_bindings(remote, name = "ray_3_d")] +#[script_bindings(remote, name = "ray_3_d", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::Ray3d { fn clone(_self: Ref) { let output: Val = ::clone( @@ -384,7 +404,7 @@ impl bevy::math::Ray3d { output } } -#[script_bindings(remote, name = "rot_2")] +#[script_bindings(remote, name = "rot_2", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::Rot2 { fn angle_between(_self: Val, other: Val) { let output: f32 = bevy::math::Rot2::angle_between( @@ -537,7 +557,7 @@ impl bevy::math::Rot2 { output } } -#[script_bindings(remote, name = "dir_2")] +#[script_bindings(remote, name = "dir_2", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::prelude::Dir2 { fn as_vec2(_self: Ref) { let output: Val = bevy::math::prelude::Dir2::as_vec2( @@ -660,7 +680,7 @@ impl bevy::math::prelude::Dir2 { output } } -#[script_bindings(remote, name = "dir_3")] +#[script_bindings(remote, name = "dir_3", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::prelude::Dir3 { fn as_vec3(_self: Ref) { let output: Val = bevy::math::prelude::Dir3::as_vec3( @@ -734,7 +754,7 @@ impl bevy::math::prelude::Dir3 { output } } -#[script_bindings(remote, name = "dir_3_a")] +#[script_bindings(remote, name = "dir_3_a", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::prelude::Dir3A { fn as_vec3a(_self: Ref) { let output: Val = bevy::math::prelude::Dir3A::as_vec3a(&_self) @@ -809,7 +829,7 @@ impl bevy::math::prelude::Dir3A { output } } -#[script_bindings(remote, name = "i_rect")] +#[script_bindings(remote, name = "i_rect", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::prelude::IRect { fn as_rect(_self: Ref) { let output: Val = bevy::math::prelude::IRect::as_rect( @@ -978,7 +998,7 @@ impl bevy::math::prelude::IRect { output } } -#[script_bindings(remote, name = "rect")] +#[script_bindings(remote, name = "rect", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::prelude::Rect { fn as_irect(_self: Ref) { let output: Val = bevy::math::prelude::Rect::as_irect( @@ -1148,7 +1168,7 @@ impl bevy::math::prelude::Rect { output } } -#[script_bindings(remote, name = "u_rect")] +#[script_bindings(remote, name = "u_rect", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::prelude::URect { fn as_irect(_self: Ref) { let output: Val = bevy::math::prelude::URect::as_irect( @@ -1317,9 +1337,9 @@ impl bevy::math::prelude::URect { output } } -#[script_bindings(remote, name = "affine_3")] +#[script_bindings(remote, name = "affine_3", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::Affine3 {} -#[script_bindings(remote, name = "aabb_2_d")] +#[script_bindings(remote, name = "aabb_2_d", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::bounding::Aabb2d { fn bounding_circle(_self: Ref) { let output: Val = bevy::math::bounding::Aabb2d::bounding_circle( @@ -1358,7 +1378,11 @@ impl bevy::math::bounding::Aabb2d { output } } -#[script_bindings(remote, name = "bounding_circle")] +#[script_bindings( + remote, + name = "bounding_circle", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::bounding::BoundingCircle { fn aabb_2d(_self: Ref) { let output: Val = bevy::math::bounding::BoundingCircle::aabb_2d( @@ -1398,7 +1422,7 @@ impl bevy::math::bounding::BoundingCircle { output } } -#[script_bindings(remote, name = "circle")] +#[script_bindings(remote, name = "circle", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::primitives::Circle { fn clone(_self: Ref) { let output: Val = ::clone( @@ -1440,7 +1464,7 @@ impl bevy::math::primitives::Circle { output } } -#[script_bindings(remote, name = "annulus")] +#[script_bindings(remote, name = "annulus", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::primitives::Annulus { fn clone(_self: Ref) { let output: Val = ::clone( @@ -1487,7 +1511,7 @@ impl bevy::math::primitives::Annulus { output } } -#[script_bindings(remote, name = "arc_2_d")] +#[script_bindings(remote, name = "arc_2_d", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::primitives::Arc2d { fn angle(_self: Ref) { let output: f32 = bevy::math::primitives::Arc2d::angle(&_self).into(); @@ -1600,7 +1624,11 @@ impl bevy::math::primitives::Arc2d { output } } -#[script_bindings(remote, name = "capsule_2_d")] +#[script_bindings( + remote, + name = "capsule_2_d", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::Capsule2d { fn clone(_self: Ref) { let output: Val = ::clone( @@ -1635,7 +1663,11 @@ impl bevy::math::primitives::Capsule2d { output } } -#[script_bindings(remote, name = "circular_sector")] +#[script_bindings( + remote, + name = "circular_sector", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::CircularSector { fn angle(_self: Ref) { let output: f32 = bevy::math::primitives::CircularSector::angle(&_self).into(); @@ -1732,7 +1764,11 @@ impl bevy::math::primitives::CircularSector { output } } -#[script_bindings(remote, name = "circular_segment")] +#[script_bindings( + remote, + name = "circular_segment", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::CircularSegment { fn angle(_self: Ref) { let output: f32 = bevy::math::primitives::CircularSegment::angle(&_self).into(); @@ -1831,7 +1867,7 @@ impl bevy::math::primitives::CircularSegment { output } } -#[script_bindings(remote, name = "ellipse")] +#[script_bindings(remote, name = "ellipse", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::primitives::Ellipse { fn clone(_self: Ref) { let output: Val = ::clone( @@ -1882,7 +1918,7 @@ impl bevy::math::primitives::Ellipse { output } } -#[script_bindings(remote, name = "line_2_d")] +#[script_bindings(remote, name = "line_2_d", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::primitives::Line2d { fn clone(_self: Ref) { let output: Val = ::clone( @@ -1902,7 +1938,7 @@ impl bevy::math::primitives::Line2d { output } } -#[script_bindings(remote, name = "plane_2_d")] +#[script_bindings(remote, name = "plane_2_d", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::primitives::Plane2d { fn clone(_self: Ref) { let output: Val = ::clone( @@ -1929,7 +1965,7 @@ impl bevy::math::primitives::Plane2d { output } } -#[script_bindings(remote, name = "rectangle")] +#[script_bindings(remote, name = "rectangle", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::primitives::Rectangle { fn clone(_self: Ref) { let output: Val = ::clone( @@ -2000,7 +2036,11 @@ impl bevy::math::primitives::Rectangle { output } } -#[script_bindings(remote, name = "regular_polygon")] +#[script_bindings( + remote, + name = "regular_polygon", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::RegularPolygon { fn circumradius(_self: Ref) { let output: f32 = bevy::math::primitives::RegularPolygon::circumradius(&_self) @@ -2071,7 +2111,7 @@ impl bevy::math::primitives::RegularPolygon { output } } -#[script_bindings(remote, name = "rhombus")] +#[script_bindings(remote, name = "rhombus", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::primitives::Rhombus { fn circumradius(_self: Ref) { let output: f32 = bevy::math::primitives::Rhombus::circumradius(&_self).into(); @@ -2136,7 +2176,11 @@ impl bevy::math::primitives::Rhombus { output } } -#[script_bindings(remote, name = "segment_2_d")] +#[script_bindings( + remote, + name = "segment_2_d", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::Segment2d { fn clone(_self: Ref) { let output: Val = ::clone( @@ -2178,7 +2222,11 @@ impl bevy::math::primitives::Segment2d { output } } -#[script_bindings(remote, name = "triangle_2_d")] +#[script_bindings( + remote, + name = "triangle_2_d", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::Triangle2d { fn clone(_self: Ref) { let output: Val = ::clone( @@ -2235,7 +2283,7 @@ impl bevy::math::primitives::Triangle2d { output } } -#[script_bindings(remote, name = "aabb_3_d")] +#[script_bindings(remote, name = "aabb_3_d", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::bounding::Aabb3d { fn bounding_sphere(_self: Ref) { let output: Val = bevy::math::bounding::Aabb3d::bounding_sphere( @@ -2252,7 +2300,11 @@ impl bevy::math::bounding::Aabb3d { output } } -#[script_bindings(remote, name = "bounding_sphere")] +#[script_bindings( + remote, + name = "bounding_sphere", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::bounding::BoundingSphere { fn aabb_3d(_self: Ref) { let output: Val = bevy::math::bounding::BoundingSphere::aabb_3d( @@ -2273,7 +2325,7 @@ impl bevy::math::bounding::BoundingSphere { output } } -#[script_bindings(remote, name = "sphere")] +#[script_bindings(remote, name = "sphere", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::primitives::Sphere { fn clone(_self: Ref) { let output: Val = ::clone( @@ -2315,7 +2367,7 @@ impl bevy::math::primitives::Sphere { output } } -#[script_bindings(remote, name = "cuboid")] +#[script_bindings(remote, name = "cuboid", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::primitives::Cuboid { fn clone(_self: Ref) { let output: Val = ::clone( @@ -2387,7 +2439,7 @@ impl bevy::math::primitives::Cuboid { output } } -#[script_bindings(remote, name = "cylinder")] +#[script_bindings(remote, name = "cylinder", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::primitives::Cylinder { fn base(_self: Ref) { let output: Val = bevy::math::primitives::Cylinder::base( @@ -2430,7 +2482,11 @@ impl bevy::math::primitives::Cylinder { output } } -#[script_bindings(remote, name = "capsule_3_d")] +#[script_bindings( + remote, + name = "capsule_3_d", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::Capsule3d { fn clone(_self: Ref) { let output: Val = ::clone( @@ -2465,7 +2521,7 @@ impl bevy::math::primitives::Capsule3d { output } } -#[script_bindings(remote, name = "cone")] +#[script_bindings(remote, name = "cone", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::primitives::Cone { fn base(_self: Ref) { let output: Val = bevy::math::primitives::Cone::base( @@ -2512,7 +2568,11 @@ impl bevy::math::primitives::Cone { output } } -#[script_bindings(remote, name = "conical_frustum")] +#[script_bindings( + remote, + name = "conical_frustum", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::ConicalFrustum { fn clone(_self: Ref) { let output: Val = ::clone( @@ -2532,7 +2592,11 @@ impl bevy::math::primitives::ConicalFrustum { output } } -#[script_bindings(remote, name = "infinite_plane_3_d")] +#[script_bindings( + remote, + name = "infinite_plane_3_d", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::InfinitePlane3d { fn clone(_self: Ref) { let output: Val = ::clone( @@ -2574,7 +2638,7 @@ impl bevy::math::primitives::InfinitePlane3d { output } } -#[script_bindings(remote, name = "line_3_d")] +#[script_bindings(remote, name = "line_3_d", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::primitives::Line3d { fn clone(_self: Ref) { let output: Val = ::clone( @@ -2594,7 +2658,11 @@ impl bevy::math::primitives::Line3d { output } } -#[script_bindings(remote, name = "segment_3_d")] +#[script_bindings( + remote, + name = "segment_3_d", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::Segment3d { fn clone(_self: Ref) { let output: Val = ::clone( @@ -2636,7 +2704,7 @@ impl bevy::math::primitives::Segment3d { output } } -#[script_bindings(remote, name = "torus")] +#[script_bindings(remote, name = "torus", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::primitives::Torus { fn clone(_self: Ref) { let output: Val = ::clone( @@ -2672,7 +2740,11 @@ impl bevy::math::primitives::Torus { output } } -#[script_bindings(remote, name = "triangle_3_d")] +#[script_bindings( + remote, + name = "triangle_3_d", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::Triangle3d { fn centroid(_self: Ref) { let output: Val = bevy::math::primitives::Triangle3d::centroid( @@ -2743,7 +2815,11 @@ impl bevy::math::primitives::Triangle3d { output } } -#[script_bindings(remote, name = "ray_cast_2_d")] +#[script_bindings( + remote, + name = "ray_cast_2_d", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::bounding::RayCast2d { fn aabb_intersection_at( _self: Ref, @@ -2803,7 +2879,11 @@ impl bevy::math::bounding::RayCast2d { output } } -#[script_bindings(remote, name = "aabb_cast_2_d")] +#[script_bindings( + remote, + name = "aabb_cast_2_d", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::bounding::AabbCast2d { fn aabb_collision_at( _self: Ref, @@ -2852,7 +2932,11 @@ impl bevy::math::bounding::AabbCast2d { output } } -#[script_bindings(remote, name = "bounding_circle_cast")] +#[script_bindings( + remote, + name = "bounding_circle_cast", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::bounding::BoundingCircleCast { fn circle_collision_at( _self: Ref, @@ -2901,7 +2985,11 @@ impl bevy::math::bounding::BoundingCircleCast { output } } -#[script_bindings(remote, name = "ray_cast_3_d")] +#[script_bindings( + remote, + name = "ray_cast_3_d", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::bounding::RayCast3d { fn aabb_intersection_at( _self: Ref, @@ -2948,7 +3036,11 @@ impl bevy::math::bounding::RayCast3d { output } } -#[script_bindings(remote, name = "aabb_cast_3_d")] +#[script_bindings( + remote, + name = "aabb_cast_3_d", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::bounding::AabbCast3d { fn aabb_collision_at( _self: Ref, @@ -2982,7 +3074,11 @@ impl bevy::math::bounding::AabbCast3d { output } } -#[script_bindings(remote, name = "bounding_sphere_cast")] +#[script_bindings( + remote, + name = "bounding_sphere_cast", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::bounding::BoundingSphereCast { fn clone(_self: Ref) { let output: Val = ::clone( @@ -3016,7 +3112,7 @@ impl bevy::math::bounding::BoundingSphereCast { output } } -#[script_bindings(remote, name = "interval")] +#[script_bindings(remote, name = "interval", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::curve::interval::Interval { fn clamp(_self: Val, value: f32) { let output: f32 = bevy::math::curve::interval::Interval::clamp( @@ -3103,7 +3199,7 @@ impl bevy::math::curve::interval::Interval { output } } -#[script_bindings(remote, name = "float_ord")] +#[script_bindings(remote, name = "float_ord", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::FloatOrd { fn clone(_self: Ref) { let output: Val = ::clone( @@ -3155,7 +3251,7 @@ impl bevy::math::FloatOrd { output } } -#[script_bindings(remote, name = "plane_3_d")] +#[script_bindings(remote, name = "plane_3_d", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::primitives::Plane3d { fn clone(_self: Ref) { let output: Val = ::clone( @@ -3186,7 +3282,11 @@ impl bevy::math::primitives::Plane3d { output } } -#[script_bindings(remote, name = "tetrahedron")] +#[script_bindings( + remote, + name = "tetrahedron", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::Tetrahedron { fn centroid(_self: Ref) { let output: Val = bevy::math::primitives::Tetrahedron::centroid( @@ -3233,7 +3333,11 @@ impl bevy::math::primitives::Tetrahedron { output } } -#[script_bindings(remote, name = "ease_function")] +#[script_bindings( + remote, + name = "ease_function", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::curve::easing::EaseFunction { fn clone(_self: Ref) { let output: Val = ::clone( diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_reflect.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_reflect.rs index 6d72171c8d..6054f74516 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_reflect.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_reflect.rs @@ -12,7 +12,11 @@ use bevy_mod_scripting_core::bindings::{ use bevy_mod_scripting_derive::script_bindings; use crate::*; pub struct BevyReflectScriptingPlugin; -#[script_bindings(remote, name = "atomic_bool")] +#[script_bindings( + remote, + name = "atomic_bool", + bms_core_path = "bevy_mod_scripting_core" +)] impl std::sync::atomic::AtomicBool { fn into_inner(_self: Val) { let output: bool = std::sync::atomic::AtomicBool::into_inner(_self.into_inner()) @@ -27,7 +31,11 @@ impl std::sync::atomic::AtomicBool { output } } -#[script_bindings(remote, name = "atomic_i_16")] +#[script_bindings( + remote, + name = "atomic_i_16", + bms_core_path = "bevy_mod_scripting_core" +)] impl std::sync::atomic::AtomicI16 { fn into_inner(_self: Val) { let output: i16 = std::sync::atomic::AtomicI16::into_inner(_self.into_inner()) @@ -42,7 +50,11 @@ impl std::sync::atomic::AtomicI16 { output } } -#[script_bindings(remote, name = "atomic_i_32")] +#[script_bindings( + remote, + name = "atomic_i_32", + bms_core_path = "bevy_mod_scripting_core" +)] impl std::sync::atomic::AtomicI32 { fn into_inner(_self: Val) { let output: i32 = std::sync::atomic::AtomicI32::into_inner(_self.into_inner()) @@ -57,7 +69,11 @@ impl std::sync::atomic::AtomicI32 { output } } -#[script_bindings(remote, name = "atomic_i_64")] +#[script_bindings( + remote, + name = "atomic_i_64", + bms_core_path = "bevy_mod_scripting_core" +)] impl std::sync::atomic::AtomicI64 { fn into_inner(_self: Val) { let output: i64 = std::sync::atomic::AtomicI64::into_inner(_self.into_inner()) @@ -72,7 +88,11 @@ impl std::sync::atomic::AtomicI64 { output } } -#[script_bindings(remote, name = "atomic_i_8")] +#[script_bindings( + remote, + name = "atomic_i_8", + bms_core_path = "bevy_mod_scripting_core" +)] impl std::sync::atomic::AtomicI8 { fn into_inner(_self: Val) { let output: i8 = std::sync::atomic::AtomicI8::into_inner(_self.into_inner()) @@ -87,7 +107,11 @@ impl std::sync::atomic::AtomicI8 { output } } -#[script_bindings(remote, name = "atomic_isize")] +#[script_bindings( + remote, + name = "atomic_isize", + bms_core_path = "bevy_mod_scripting_core" +)] impl std::sync::atomic::AtomicIsize { fn into_inner(_self: Val) { let output: isize = std::sync::atomic::AtomicIsize::into_inner( @@ -104,7 +128,11 @@ impl std::sync::atomic::AtomicIsize { output } } -#[script_bindings(remote, name = "atomic_u_16")] +#[script_bindings( + remote, + name = "atomic_u_16", + bms_core_path = "bevy_mod_scripting_core" +)] impl std::sync::atomic::AtomicU16 { fn into_inner(_self: Val) { let output: u16 = std::sync::atomic::AtomicU16::into_inner(_self.into_inner()) @@ -119,7 +147,11 @@ impl std::sync::atomic::AtomicU16 { output } } -#[script_bindings(remote, name = "atomic_u_32")] +#[script_bindings( + remote, + name = "atomic_u_32", + bms_core_path = "bevy_mod_scripting_core" +)] impl std::sync::atomic::AtomicU32 { fn into_inner(_self: Val) { let output: u32 = std::sync::atomic::AtomicU32::into_inner(_self.into_inner()) @@ -134,7 +166,11 @@ impl std::sync::atomic::AtomicU32 { output } } -#[script_bindings(remote, name = "atomic_u_64")] +#[script_bindings( + remote, + name = "atomic_u_64", + bms_core_path = "bevy_mod_scripting_core" +)] impl std::sync::atomic::AtomicU64 { fn into_inner(_self: Val) { let output: u64 = std::sync::atomic::AtomicU64::into_inner(_self.into_inner()) @@ -149,7 +185,11 @@ impl std::sync::atomic::AtomicU64 { output } } -#[script_bindings(remote, name = "atomic_u_8")] +#[script_bindings( + remote, + name = "atomic_u_8", + bms_core_path = "bevy_mod_scripting_core" +)] impl std::sync::atomic::AtomicU8 { fn into_inner(_self: Val) { let output: u8 = std::sync::atomic::AtomicU8::into_inner(_self.into_inner()) @@ -164,7 +204,11 @@ impl std::sync::atomic::AtomicU8 { output } } -#[script_bindings(remote, name = "atomic_usize")] +#[script_bindings( + remote, + name = "atomic_usize", + bms_core_path = "bevy_mod_scripting_core" +)] impl std::sync::atomic::AtomicUsize { fn into_inner(_self: Val) { let output: usize = std::sync::atomic::AtomicUsize::into_inner( @@ -181,7 +225,7 @@ impl std::sync::atomic::AtomicUsize { output } } -#[script_bindings(remote, name = "duration")] +#[script_bindings(remote, name = "duration", bms_core_path = "bevy_mod_scripting_core")] impl bevy::utils::Duration { fn abs_diff(_self: Val, other: Val) { let output: Val = bevy::utils::Duration::abs_diff( @@ -408,7 +452,7 @@ impl bevy::utils::Duration { output } } -#[script_bindings(remote, name = "instant")] +#[script_bindings(remote, name = "instant", bms_core_path = "bevy_mod_scripting_core")] impl bevy::utils::Instant { fn add(_self: Val, other: Val) { let output: Val = ) { let output: () = ::assert_receiver_is_total_eq( @@ -508,7 +556,7 @@ impl std::ops::RangeFull { output } } -#[script_bindings(remote, name = "quat")] +#[script_bindings(remote, name = "quat", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::Quat { fn abs_diff_eq( _self: Val, @@ -837,7 +885,7 @@ impl bevy::math::Quat { output } } -#[script_bindings(remote, name = "vec_3")] +#[script_bindings(remote, name = "vec_3", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::Vec3 { fn abs(_self: Val) { let output: Val = bevy::math::Vec3::abs(_self.into_inner()) @@ -1483,7 +1531,7 @@ impl bevy::math::Vec3 { output } } -#[script_bindings(remote, name = "i_vec_2")] +#[script_bindings(remote, name = "i_vec_2", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::IVec2 { fn abs(_self: Val) { let output: Val = bevy::math::IVec2::abs(_self.into_inner()) @@ -1974,7 +2022,7 @@ impl bevy::math::IVec2 { output } } -#[script_bindings(remote, name = "i_vec_3")] +#[script_bindings(remote, name = "i_vec_3", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::IVec3 { fn abs(_self: Val) { let output: Val = bevy::math::IVec3::abs(_self.into_inner()) @@ -2471,7 +2519,7 @@ impl bevy::math::IVec3 { output } } -#[script_bindings(remote, name = "i_vec_4")] +#[script_bindings(remote, name = "i_vec_4", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::IVec4 { fn abs(_self: Val) { let output: Val = bevy::math::IVec4::abs(_self.into_inner()) @@ -2956,7 +3004,11 @@ impl bevy::math::IVec4 { output } } -#[script_bindings(remote, name = "i_64_vec_2")] +#[script_bindings( + remote, + name = "i_64_vec_2", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::I64Vec2 { fn abs(_self: Val) { let output: Val = bevy::math::I64Vec2::abs( @@ -3454,7 +3506,11 @@ impl bevy::math::I64Vec2 { output } } -#[script_bindings(remote, name = "i_64_vec_3")] +#[script_bindings( + remote, + name = "i_64_vec_3", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::I64Vec3 { fn abs(_self: Val) { let output: Val = bevy::math::I64Vec3::abs( @@ -3957,7 +4013,11 @@ impl bevy::math::I64Vec3 { output } } -#[script_bindings(remote, name = "i_64_vec_4")] +#[script_bindings( + remote, + name = "i_64_vec_4", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::I64Vec4 { fn abs(_self: Val) { let output: Val = bevy::math::I64Vec4::abs( @@ -4448,7 +4508,7 @@ impl bevy::math::I64Vec4 { output } } -#[script_bindings(remote, name = "u_vec_2")] +#[script_bindings(remote, name = "u_vec_2", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::UVec2 { fn add(_self: Val, rhs: Ref) { let output: Val = , rhs: Ref) { let output: Val = , rhs: Ref) { let output: Val = , rhs: Ref) { let output: Val = , rhs: Ref) { let output: Val = , rhs: Ref) { let output: Val = ) { let output: Val = bevy::math::Vec2::abs(_self.into_inner()) @@ -7593,7 +7665,7 @@ impl bevy::math::Vec2 { output } } -#[script_bindings(remote, name = "vec_3_a")] +#[script_bindings(remote, name = "vec_3_a", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::Vec3A { fn abs(_self: Val) { let output: Val = bevy::math::Vec3A::abs(_self.into_inner()) @@ -8252,7 +8324,7 @@ impl bevy::math::Vec3A { output } } -#[script_bindings(remote, name = "vec_4")] +#[script_bindings(remote, name = "vec_4", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::Vec4 { fn abs(_self: Val) { let output: Val = bevy::math::Vec4::abs(_self.into_inner()) @@ -8868,7 +8940,7 @@ impl bevy::math::Vec4 { output } } -#[script_bindings(remote, name = "b_vec_2")] +#[script_bindings(remote, name = "b_vec_2", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::BVec2 { fn all(_self: Val) { let output: bool = bevy::math::BVec2::all(_self.into_inner()).into(); @@ -8924,7 +8996,7 @@ impl bevy::math::BVec2 { output } } -#[script_bindings(remote, name = "b_vec_3")] +#[script_bindings(remote, name = "b_vec_3", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::BVec3 { fn all(_self: Val) { let output: bool = bevy::math::BVec3::all(_self.into_inner()).into(); @@ -8980,7 +9052,7 @@ impl bevy::math::BVec3 { output } } -#[script_bindings(remote, name = "b_vec_4")] +#[script_bindings(remote, name = "b_vec_4", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::BVec4 { fn all(_self: Val) { let output: bool = bevy::math::BVec4::all(_self.into_inner()).into(); @@ -9036,7 +9108,7 @@ impl bevy::math::BVec4 { output } } -#[script_bindings(remote, name = "d_vec_2")] +#[script_bindings(remote, name = "d_vec_2", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::DVec2 { fn abs(_self: Val) { let output: Val = bevy::math::DVec2::abs(_self.into_inner()) @@ -9703,7 +9775,7 @@ impl bevy::math::DVec2 { output } } -#[script_bindings(remote, name = "d_vec_3")] +#[script_bindings(remote, name = "d_vec_3", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::DVec3 { fn abs(_self: Val) { let output: Val = bevy::math::DVec3::abs(_self.into_inner()) @@ -10361,7 +10433,7 @@ impl bevy::math::DVec3 { output } } -#[script_bindings(remote, name = "d_vec_4")] +#[script_bindings(remote, name = "d_vec_4", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::DVec4 { fn abs(_self: Val) { let output: Val = bevy::math::DVec4::abs(_self.into_inner()) @@ -10985,7 +11057,7 @@ impl bevy::math::DVec4 { output } } -#[script_bindings(remote, name = "mat_2")] +#[script_bindings(remote, name = "mat_2", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::Mat2 { fn abs(_self: Ref) { let output: Val = bevy::math::Mat2::abs(&_self).into(); @@ -11196,7 +11268,7 @@ impl bevy::math::Mat2 { output } } -#[script_bindings(remote, name = "mat_3")] +#[script_bindings(remote, name = "mat_3", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::Mat3 { fn abs(_self: Ref) { let output: Val = bevy::math::Mat3::abs(&_self).into(); @@ -11508,7 +11580,7 @@ impl bevy::math::Mat3 { output } } -#[script_bindings(remote, name = "mat_3_a")] +#[script_bindings(remote, name = "mat_3_a", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::Mat3A { fn abs(_self: Ref) { let output: Val = bevy::math::Mat3A::abs(&_self).into(); @@ -11822,7 +11894,7 @@ impl bevy::math::Mat3A { output } } -#[script_bindings(remote, name = "mat_4")] +#[script_bindings(remote, name = "mat_4", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::Mat4 { fn abs(_self: Ref) { let output: Val = bevy::math::Mat4::abs(&_self).into(); @@ -12339,7 +12411,7 @@ impl bevy::math::Mat4 { output } } -#[script_bindings(remote, name = "d_mat_2")] +#[script_bindings(remote, name = "d_mat_2", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::DMat2 { fn abs(_self: Ref) { let output: Val = bevy::math::DMat2::abs(&_self).into(); @@ -12538,7 +12610,7 @@ impl bevy::math::DMat2 { output } } -#[script_bindings(remote, name = "d_mat_3")] +#[script_bindings(remote, name = "d_mat_3", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::DMat3 { fn abs(_self: Ref) { let output: Val = bevy::math::DMat3::abs(&_self).into(); @@ -12837,7 +12909,7 @@ impl bevy::math::DMat3 { output } } -#[script_bindings(remote, name = "d_mat_4")] +#[script_bindings(remote, name = "d_mat_4", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::DMat4 { fn abs(_self: Ref) { let output: Val = bevy::math::DMat4::abs(&_self).into(); @@ -13327,7 +13399,7 @@ impl bevy::math::DMat4 { output } } -#[script_bindings(remote, name = "affine_2")] +#[script_bindings(remote, name = "affine_2", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::Affine2 { fn abs_diff_eq( _self: Ref, @@ -13500,7 +13572,11 @@ impl bevy::math::Affine2 { output } } -#[script_bindings(remote, name = "affine_3_a")] +#[script_bindings( + remote, + name = "affine_3_a", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::Affine3A { fn abs_diff_eq( _self: Ref, @@ -13767,7 +13843,11 @@ impl bevy::math::Affine3A { output } } -#[script_bindings(remote, name = "d_affine_2")] +#[script_bindings( + remote, + name = "d_affine_2", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::DAffine2 { fn abs_diff_eq( _self: Ref, @@ -13927,7 +14007,11 @@ impl bevy::math::DAffine2 { output } } -#[script_bindings(remote, name = "d_affine_3")] +#[script_bindings( + remote, + name = "d_affine_3", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::DAffine3 { fn abs_diff_eq( _self: Ref, @@ -14175,7 +14259,7 @@ impl bevy::math::DAffine3 { output } } -#[script_bindings(remote, name = "d_quat")] +#[script_bindings(remote, name = "d_quat", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::DQuat { fn abs_diff_eq( _self: Val, @@ -14488,7 +14572,7 @@ impl bevy::math::DQuat { output } } -#[script_bindings(remote, name = "euler_rot")] +#[script_bindings(remote, name = "euler_rot", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::EulerRot { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -14512,7 +14596,7 @@ impl bevy::math::EulerRot { output } } -#[script_bindings(remote, name = "b_vec_3_a")] +#[script_bindings(remote, name = "b_vec_3_a", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::BVec3A { fn all(_self: Val) { let output: bool = bevy::math::BVec3A::all(_self.into_inner()).into(); @@ -14561,7 +14645,7 @@ impl bevy::math::BVec3A { output } } -#[script_bindings(remote, name = "b_vec_4_a")] +#[script_bindings(remote, name = "b_vec_4_a", bms_core_path = "bevy_mod_scripting_core")] impl bevy::math::BVec4A { fn all(_self: Val) { let output: bool = bevy::math::BVec4A::all(_self.into_inner()).into(); @@ -14610,7 +14694,7 @@ impl bevy::math::BVec4A { output } } -#[script_bindings(remote, name = "smol_str")] +#[script_bindings(remote, name = "smol_str", bms_core_path = "bevy_mod_scripting_core")] impl smol_str::SmolStr { fn clone(_self: Ref) { let output: Val = ::clone( @@ -14643,7 +14727,7 @@ impl smol_str::SmolStr { output } } -#[script_bindings(remote, name = "uuid")] +#[script_bindings(remote, name = "uuid", bms_core_path = "bevy_mod_scripting_core")] impl uuid::Uuid { fn as_u128(_self: Ref) { let output: u128 = uuid::Uuid::as_u128(&_self).into(); diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_time.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_time.rs index a3b69ec93c..83e4739a9b 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_time.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_time.rs @@ -12,7 +12,7 @@ use bevy_mod_scripting_core::bindings::{ use bevy_mod_scripting_derive::script_bindings; use crate::*; pub struct BevyTimeScriptingPlugin; -#[script_bindings(remote, name = "fixed")] +#[script_bindings(remote, name = "fixed", bms_core_path = "bevy_mod_scripting_core")] impl bevy::time::prelude::Fixed { fn clone(_self: Ref) { let output: Val = ::clone( @@ -22,7 +22,7 @@ impl bevy::time::prelude::Fixed { output } } -#[script_bindings(remote, name = "real")] +#[script_bindings(remote, name = "real", bms_core_path = "bevy_mod_scripting_core")] impl bevy::time::prelude::Real { fn clone(_self: Ref) { let output: Val = ::clone( @@ -32,7 +32,7 @@ impl bevy::time::prelude::Real { output } } -#[script_bindings(remote, name = "timer")] +#[script_bindings(remote, name = "timer", bms_core_path = "bevy_mod_scripting_core")] impl bevy::time::prelude::Timer { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -188,7 +188,11 @@ impl bevy::time::prelude::Timer { output } } -#[script_bindings(remote, name = "timer_mode")] +#[script_bindings( + remote, + name = "timer_mode", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::time::prelude::TimerMode { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -215,7 +219,7 @@ impl bevy::time::prelude::TimerMode { output } } -#[script_bindings(remote, name = "virtual")] +#[script_bindings(remote, name = "virtual", bms_core_path = "bevy_mod_scripting_core")] impl bevy::time::prelude::Virtual { fn clone(_self: Ref) { let output: Val = ::clone( @@ -225,7 +229,7 @@ impl bevy::time::prelude::Virtual { output } } -#[script_bindings(remote, name = "stopwatch")] +#[script_bindings(remote, name = "stopwatch", bms_core_path = "bevy_mod_scripting_core")] impl bevy::time::Stopwatch { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_transform.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_transform.rs index 7513f0ae05..187eb3334f 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_transform.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_transform.rs @@ -12,7 +12,11 @@ use bevy_mod_scripting_core::bindings::{ use bevy_mod_scripting_derive::script_bindings; use crate::*; pub struct BevyTransformScriptingPlugin; -#[script_bindings(remote, name = "global_transform")] +#[script_bindings( + remote, + name = "global_transform", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::transform::components::GlobalTransform { fn affine(_self: Ref) { let output: Val = bevy::transform::components::GlobalTransform::affine( @@ -241,7 +245,7 @@ impl bevy::transform::components::GlobalTransform { output } } -#[script_bindings(remote, name = "transform")] +#[script_bindings(remote, name = "transform", bms_core_path = "bevy_mod_scripting_core")] impl bevy::transform::components::Transform { fn back(_self: Ref) { let output: Val = bevy::transform::components::Transform::back( From a63f3663b7399e0f5720ab632916498037d1fd0c Mon Sep 17 00:00:00 2001 From: makspll Date: Mon, 10 Feb 2025 14:35:23 +0000 Subject: [PATCH 08/13] add _functions postfix --- crates/bevy_api_gen/templates/footer.tera | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bevy_api_gen/templates/footer.tera b/crates/bevy_api_gen/templates/footer.tera index 8ceb84414b..2c2ffd7d52 100644 --- a/crates/bevy_api_gen/templates/footer.tera +++ b/crates/bevy_api_gen/templates/footer.tera @@ -10,7 +10,7 @@ pub struct {{ "ScriptingPlugin" | prefix_cratename | convert_case(case="upper_ca {% for item in items %} #[script_bindings( remote, - name = "{{ item.ident | convert_case(case="snake") }}", + name = "{{ item.ident | convert_case(case="snake") }}_functions", bms_core_path="bevy_mod_scripting_core" )] impl {{item.import_path}} { @@ -52,7 +52,7 @@ impl ::bevy::app::Plugin for {{ "ScriptingPlugin" | prefix_cratename | convert_c let mut world = app.world_mut(); {% for item in items %} - register_{{ item.ident | convert_case(case="snake") }}(&mut world); + register_{{ item.ident | convert_case(case="snake") }}_functions(&mut world); {% endfor %} } } \ No newline at end of file From caaedc7b732865d7052ea69dfa95e87af5d2c19e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 14:43:53 +0000 Subject: [PATCH 09/13] chore(codegen): update bevy bindings --- .../src/bevy_bindings/bevy_core.rs | 8 +- .../src/bevy_bindings/bevy_ecs.rs | 68 ++-- .../src/bevy_bindings/bevy_hierarchy.rs | 20 +- .../src/bevy_bindings/bevy_input.rs | 172 +++++---- .../src/bevy_bindings/bevy_math.rs | 336 +++++++++++------ .../src/bevy_bindings/bevy_reflect.rs | 348 ++++++++++++------ .../src/bevy_bindings/bevy_time.rs | 44 ++- .../src/bevy_bindings/bevy_transform.rs | 12 +- 8 files changed, 662 insertions(+), 346 deletions(-) diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_core.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_core.rs index 7d9347168f..4d3c247bc7 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_core.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_core.rs @@ -12,7 +12,11 @@ use bevy_mod_scripting_core::bindings::{ use bevy_mod_scripting_derive::script_bindings; use crate::*; pub struct BevyCoreScriptingPlugin; -#[script_bindings(remote, name = "name", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "name_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::core::prelude::Name { fn clone(_self: Ref) { let output: Val = ::clone( @@ -32,6 +36,6 @@ impl bevy::core::prelude::Name { impl ::bevy::app::Plugin for BevyCoreScriptingPlugin { fn build(&self, app: &mut ::bevy::prelude::App) { let mut world = app.world_mut(); - register_name(&mut world); + register_name_functions(&mut world); } } diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_ecs.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_ecs.rs index 7051204fcb..530b46e675 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_ecs.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_ecs.rs @@ -12,7 +12,11 @@ use bevy_mod_scripting_core::bindings::{ use bevy_mod_scripting_derive::script_bindings; use crate::*; pub struct BevyEcsScriptingPlugin; -#[script_bindings(remote, name = "entity", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "entity_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::ecs::entity::Entity { fn clone(_self: Ref) { let output: Val = ::clone( @@ -56,21 +60,33 @@ impl bevy::ecs::entity::Entity { output } } -#[script_bindings(remote, name = "on_add", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "on_add_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::ecs::world::OnAdd {} -#[script_bindings(remote, name = "on_insert", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "on_insert_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::ecs::world::OnInsert {} -#[script_bindings(remote, name = "on_remove", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "on_remove_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::ecs::world::OnRemove {} #[script_bindings( remote, - name = "on_replace", + name = "on_replace_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::ecs::world::OnReplace {} #[script_bindings( remote, - name = "component_id", + name = "component_id_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::ecs::component::ComponentId { @@ -111,7 +127,11 @@ impl bevy::ecs::component::ComponentId { output } } -#[script_bindings(remote, name = "tick", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "tick_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::ecs::component::Tick { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -168,7 +188,7 @@ impl bevy::ecs::component::Tick { } #[script_bindings( remote, - name = "component_ticks", + name = "component_ticks_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::ecs::component::ComponentTicks { @@ -226,7 +246,7 @@ impl bevy::ecs::component::ComponentTicks { } #[script_bindings( remote, - name = "identifier", + name = "identifier_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::ecs::identifier::Identifier { @@ -274,7 +294,7 @@ impl bevy::ecs::identifier::Identifier { } #[script_bindings( remote, - name = "entity_hash", + name = "entity_hash_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::ecs::entity::EntityHash { @@ -288,7 +308,7 @@ impl bevy::ecs::entity::EntityHash { } #[script_bindings( remote, - name = "removed_component_entity", + name = "removed_component_entity_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::ecs::removal_detection::RemovedComponentEntity { @@ -302,24 +322,24 @@ impl bevy::ecs::removal_detection::RemovedComponentEntity { } #[script_bindings( remote, - name = "system_id_marker", + name = "system_id_marker_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::ecs::system::SystemIdMarker {} impl ::bevy::app::Plugin for BevyEcsScriptingPlugin { fn build(&self, app: &mut ::bevy::prelude::App) { let mut world = app.world_mut(); - register_entity(&mut world); - register_on_add(&mut world); - register_on_insert(&mut world); - register_on_remove(&mut world); - register_on_replace(&mut world); - register_component_id(&mut world); - register_tick(&mut world); - register_component_ticks(&mut world); - register_identifier(&mut world); - register_entity_hash(&mut world); - register_removed_component_entity(&mut world); - register_system_id_marker(&mut world); + register_entity_functions(&mut world); + register_on_add_functions(&mut world); + register_on_insert_functions(&mut world); + register_on_remove_functions(&mut world); + register_on_replace_functions(&mut world); + register_component_id_functions(&mut world); + register_tick_functions(&mut world); + register_component_ticks_functions(&mut world); + register_identifier_functions(&mut world); + register_entity_hash_functions(&mut world); + register_removed_component_entity_functions(&mut world); + register_system_id_marker_functions(&mut world); } } diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_hierarchy.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_hierarchy.rs index ad15237b29..ca330db19a 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_hierarchy.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_hierarchy.rs @@ -12,7 +12,11 @@ use bevy_mod_scripting_core::bindings::{ use bevy_mod_scripting_derive::script_bindings; use crate::*; pub struct BevyHierarchyScriptingPlugin; -#[script_bindings(remote, name = "children", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "children_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::hierarchy::prelude::Children { fn swap( mut _self: Mut, @@ -28,7 +32,11 @@ impl bevy::hierarchy::prelude::Children { output } } -#[script_bindings(remote, name = "parent", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "parent_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::hierarchy::prelude::Parent { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -57,7 +65,7 @@ impl bevy::hierarchy::prelude::Parent { } #[script_bindings( remote, - name = "hierarchy_event", + name = "hierarchy_event_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::hierarchy::HierarchyEvent { @@ -89,8 +97,8 @@ impl bevy::hierarchy::HierarchyEvent { impl ::bevy::app::Plugin for BevyHierarchyScriptingPlugin { fn build(&self, app: &mut ::bevy::prelude::App) { let mut world = app.world_mut(); - register_children(&mut world); - register_parent(&mut world); - register_hierarchy_event(&mut world); + register_children_functions(&mut world); + register_parent_functions(&mut world); + register_hierarchy_event_functions(&mut world); } } diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_input.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_input.rs index dee786efa6..231964012b 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_input.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_input.rs @@ -12,7 +12,11 @@ use bevy_mod_scripting_core::bindings::{ use bevy_mod_scripting_derive::script_bindings; use crate::*; pub struct BevyInputScriptingPlugin; -#[script_bindings(remote, name = "gamepad", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "gamepad_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::gamepad::Gamepad { fn dpad(_self: Ref) { let output: Val = bevy::input::gamepad::Gamepad::dpad(&_self) @@ -83,7 +87,7 @@ impl bevy::input::gamepad::Gamepad { } #[script_bindings( remote, - name = "gamepad_axis", + name = "gamepad_axis_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::GamepadAxis { @@ -114,7 +118,7 @@ impl bevy::input::gamepad::GamepadAxis { } #[script_bindings( remote, - name = "gamepad_button", + name = "gamepad_button_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::GamepadButton { @@ -145,7 +149,7 @@ impl bevy::input::gamepad::GamepadButton { } #[script_bindings( remote, - name = "gamepad_settings", + name = "gamepad_settings_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::GamepadSettings { @@ -157,7 +161,11 @@ impl bevy::input::gamepad::GamepadSettings { output } } -#[script_bindings(remote, name = "key_code", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "key_code_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::keyboard::KeyCode { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -186,7 +194,7 @@ impl bevy::input::keyboard::KeyCode { } #[script_bindings( remote, - name = "mouse_button", + name = "mouse_button_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::mouse::MouseButton { @@ -217,7 +225,7 @@ impl bevy::input::mouse::MouseButton { } #[script_bindings( remote, - name = "touch_input", + name = "touch_input_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::touch::TouchInput { @@ -241,7 +249,7 @@ impl bevy::input::touch::TouchInput { } #[script_bindings( remote, - name = "keyboard_focus_lost", + name = "keyboard_focus_lost_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::keyboard::KeyboardFocusLost { @@ -274,7 +282,7 @@ impl bevy::input::keyboard::KeyboardFocusLost { } #[script_bindings( remote, - name = "keyboard_input", + name = "keyboard_input_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::keyboard::KeyboardInput { @@ -305,7 +313,7 @@ impl bevy::input::keyboard::KeyboardInput { } #[script_bindings( remote, - name = "accumulated_mouse_motion", + name = "accumulated_mouse_motion_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::mouse::AccumulatedMouseMotion { @@ -329,7 +337,7 @@ impl bevy::input::mouse::AccumulatedMouseMotion { } #[script_bindings( remote, - name = "accumulated_mouse_scroll", + name = "accumulated_mouse_scroll_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::mouse::AccumulatedMouseScroll { @@ -353,7 +361,7 @@ impl bevy::input::mouse::AccumulatedMouseScroll { } #[script_bindings( remote, - name = "mouse_button_input", + name = "mouse_button_input_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::mouse::MouseButtonInput { @@ -384,7 +392,7 @@ impl bevy::input::mouse::MouseButtonInput { } #[script_bindings( remote, - name = "mouse_motion", + name = "mouse_motion_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::mouse::MouseMotion { @@ -408,7 +416,7 @@ impl bevy::input::mouse::MouseMotion { } #[script_bindings( remote, - name = "mouse_wheel", + name = "mouse_wheel_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::mouse::MouseWheel { @@ -432,7 +440,7 @@ impl bevy::input::mouse::MouseWheel { } #[script_bindings( remote, - name = "gamepad_axis_changed_event", + name = "gamepad_axis_changed_event_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::GamepadAxisChangedEvent { @@ -469,7 +477,7 @@ impl bevy::input::gamepad::GamepadAxisChangedEvent { } #[script_bindings( remote, - name = "gamepad_button_changed_event", + name = "gamepad_button_changed_event_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::GamepadButtonChangedEvent { @@ -508,7 +516,7 @@ impl bevy::input::gamepad::GamepadButtonChangedEvent { } #[script_bindings( remote, - name = "gamepad_button_state_changed_event", + name = "gamepad_button_state_changed_event_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::GamepadButtonStateChangedEvent { @@ -554,7 +562,7 @@ impl bevy::input::gamepad::GamepadButtonStateChangedEvent { } #[script_bindings( remote, - name = "gamepad_connection", + name = "gamepad_connection_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::GamepadConnection { @@ -578,7 +586,7 @@ impl bevy::input::gamepad::GamepadConnection { } #[script_bindings( remote, - name = "gamepad_connection_event", + name = "gamepad_connection_event_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::GamepadConnectionEvent { @@ -627,7 +635,7 @@ impl bevy::input::gamepad::GamepadConnectionEvent { } #[script_bindings( remote, - name = "gamepad_event", + name = "gamepad_event_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::GamepadEvent { @@ -651,7 +659,7 @@ impl bevy::input::gamepad::GamepadEvent { } #[script_bindings( remote, - name = "gamepad_input", + name = "gamepad_input_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::GamepadInput { @@ -682,7 +690,7 @@ impl bevy::input::gamepad::GamepadInput { } #[script_bindings( remote, - name = "gamepad_rumble_request", + name = "gamepad_rumble_request_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::GamepadRumbleRequest { @@ -703,7 +711,7 @@ impl bevy::input::gamepad::GamepadRumbleRequest { } #[script_bindings( remote, - name = "raw_gamepad_axis_changed_event", + name = "raw_gamepad_axis_changed_event_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::RawGamepadAxisChangedEvent { @@ -740,7 +748,7 @@ impl bevy::input::gamepad::RawGamepadAxisChangedEvent { } #[script_bindings( remote, - name = "raw_gamepad_button_changed_event", + name = "raw_gamepad_button_changed_event_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::RawGamepadButtonChangedEvent { @@ -777,7 +785,7 @@ impl bevy::input::gamepad::RawGamepadButtonChangedEvent { } #[script_bindings( remote, - name = "raw_gamepad_event", + name = "raw_gamepad_event_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::RawGamepadEvent { @@ -801,7 +809,7 @@ impl bevy::input::gamepad::RawGamepadEvent { } #[script_bindings( remote, - name = "pinch_gesture", + name = "pinch_gesture_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gestures::PinchGesture { @@ -825,7 +833,7 @@ impl bevy::input::gestures::PinchGesture { } #[script_bindings( remote, - name = "rotation_gesture", + name = "rotation_gesture_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gestures::RotationGesture { @@ -849,7 +857,7 @@ impl bevy::input::gestures::RotationGesture { } #[script_bindings( remote, - name = "double_tap_gesture", + name = "double_tap_gesture_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gestures::DoubleTapGesture { @@ -873,7 +881,7 @@ impl bevy::input::gestures::DoubleTapGesture { } #[script_bindings( remote, - name = "pan_gesture", + name = "pan_gesture_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gestures::PanGesture { @@ -897,7 +905,7 @@ impl bevy::input::gestures::PanGesture { } #[script_bindings( remote, - name = "button_state", + name = "button_state_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::ButtonState { @@ -929,7 +937,7 @@ impl bevy::input::ButtonState { } #[script_bindings( remote, - name = "button_settings", + name = "button_settings_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::ButtonSettings { @@ -1001,7 +1009,7 @@ impl bevy::input::gamepad::ButtonSettings { } #[script_bindings( remote, - name = "axis_settings", + name = "axis_settings_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::AxisSettings { @@ -1119,7 +1127,7 @@ impl bevy::input::gamepad::AxisSettings { } #[script_bindings( remote, - name = "button_axis_settings", + name = "button_axis_settings_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::ButtonAxisSettings { @@ -1146,7 +1154,7 @@ impl bevy::input::gamepad::ButtonAxisSettings { } #[script_bindings( remote, - name = "gamepad_rumble_intensity", + name = "gamepad_rumble_intensity_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::GamepadRumbleIntensity { @@ -1182,7 +1190,11 @@ impl bevy::input::gamepad::GamepadRumbleIntensity { output } } -#[script_bindings(remote, name = "key", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "key_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::input::keyboard::Key { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -1211,7 +1223,7 @@ impl bevy::input::keyboard::Key { } #[script_bindings( remote, - name = "native_key_code", + name = "native_key_code_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::keyboard::NativeKeyCode { @@ -1242,7 +1254,7 @@ impl bevy::input::keyboard::NativeKeyCode { } #[script_bindings( remote, - name = "native_key", + name = "native_key_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::keyboard::NativeKey { @@ -1273,7 +1285,7 @@ impl bevy::input::keyboard::NativeKey { } #[script_bindings( remote, - name = "mouse_scroll_unit", + name = "mouse_scroll_unit_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::mouse::MouseScrollUnit { @@ -1304,7 +1316,7 @@ impl bevy::input::mouse::MouseScrollUnit { } #[script_bindings( remote, - name = "touch_phase", + name = "touch_phase_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::touch::TouchPhase { @@ -1335,7 +1347,7 @@ impl bevy::input::touch::TouchPhase { } #[script_bindings( remote, - name = "force_touch", + name = "force_touch_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::touch::ForceTouch { @@ -1360,45 +1372,45 @@ impl bevy::input::touch::ForceTouch { impl ::bevy::app::Plugin for BevyInputScriptingPlugin { fn build(&self, app: &mut ::bevy::prelude::App) { let mut world = app.world_mut(); - register_gamepad(&mut world); - register_gamepad_axis(&mut world); - register_gamepad_button(&mut world); - register_gamepad_settings(&mut world); - register_key_code(&mut world); - register_mouse_button(&mut world); - register_touch_input(&mut world); - register_keyboard_focus_lost(&mut world); - register_keyboard_input(&mut world); - register_accumulated_mouse_motion(&mut world); - register_accumulated_mouse_scroll(&mut world); - register_mouse_button_input(&mut world); - register_mouse_motion(&mut world); - register_mouse_wheel(&mut world); - register_gamepad_axis_changed_event(&mut world); - register_gamepad_button_changed_event(&mut world); - register_gamepad_button_state_changed_event(&mut world); - register_gamepad_connection(&mut world); - register_gamepad_connection_event(&mut world); - register_gamepad_event(&mut world); - register_gamepad_input(&mut world); - register_gamepad_rumble_request(&mut world); - register_raw_gamepad_axis_changed_event(&mut world); - register_raw_gamepad_button_changed_event(&mut world); - register_raw_gamepad_event(&mut world); - register_pinch_gesture(&mut world); - register_rotation_gesture(&mut world); - register_double_tap_gesture(&mut world); - register_pan_gesture(&mut world); - register_button_state(&mut world); - register_button_settings(&mut world); - register_axis_settings(&mut world); - register_button_axis_settings(&mut world); - register_gamepad_rumble_intensity(&mut world); - register_key(&mut world); - register_native_key_code(&mut world); - register_native_key(&mut world); - register_mouse_scroll_unit(&mut world); - register_touch_phase(&mut world); - register_force_touch(&mut world); + register_gamepad_functions(&mut world); + register_gamepad_axis_functions(&mut world); + register_gamepad_button_functions(&mut world); + register_gamepad_settings_functions(&mut world); + register_key_code_functions(&mut world); + register_mouse_button_functions(&mut world); + register_touch_input_functions(&mut world); + register_keyboard_focus_lost_functions(&mut world); + register_keyboard_input_functions(&mut world); + register_accumulated_mouse_motion_functions(&mut world); + register_accumulated_mouse_scroll_functions(&mut world); + register_mouse_button_input_functions(&mut world); + register_mouse_motion_functions(&mut world); + register_mouse_wheel_functions(&mut world); + register_gamepad_axis_changed_event_functions(&mut world); + register_gamepad_button_changed_event_functions(&mut world); + register_gamepad_button_state_changed_event_functions(&mut world); + register_gamepad_connection_functions(&mut world); + register_gamepad_connection_event_functions(&mut world); + register_gamepad_event_functions(&mut world); + register_gamepad_input_functions(&mut world); + register_gamepad_rumble_request_functions(&mut world); + register_raw_gamepad_axis_changed_event_functions(&mut world); + register_raw_gamepad_button_changed_event_functions(&mut world); + register_raw_gamepad_event_functions(&mut world); + register_pinch_gesture_functions(&mut world); + register_rotation_gesture_functions(&mut world); + register_double_tap_gesture_functions(&mut world); + register_pan_gesture_functions(&mut world); + register_button_state_functions(&mut world); + register_button_settings_functions(&mut world); + register_axis_settings_functions(&mut world); + register_button_axis_settings_functions(&mut world); + register_gamepad_rumble_intensity_functions(&mut world); + register_key_functions(&mut world); + register_native_key_code_functions(&mut world); + register_native_key_functions(&mut world); + register_mouse_scroll_unit_functions(&mut world); + register_touch_phase_functions(&mut world); + register_force_touch_functions(&mut world); } } diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_math.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_math.rs index 60185382c2..4a2a76eac5 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_math.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_math.rs @@ -14,7 +14,7 @@ use crate::*; pub struct BevyMathScriptingPlugin; #[script_bindings( remote, - name = "aspect_ratio", + name = "aspect_ratio_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::AspectRatio { @@ -58,7 +58,7 @@ impl bevy::math::AspectRatio { } #[script_bindings( remote, - name = "compass_octant", + name = "compass_octant_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::CompassOctant { @@ -86,7 +86,7 @@ impl bevy::math::CompassOctant { } #[script_bindings( remote, - name = "compass_quadrant", + name = "compass_quadrant_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::CompassQuadrant { @@ -117,7 +117,7 @@ impl bevy::math::CompassQuadrant { } #[script_bindings( remote, - name = "isometry_2_d", + name = "isometry_2_d_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::Isometry2d { @@ -227,7 +227,7 @@ impl bevy::math::Isometry2d { } #[script_bindings( remote, - name = "isometry_3_d", + name = "isometry_3_d_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::Isometry3d { @@ -306,7 +306,11 @@ impl bevy::math::Isometry3d { output } } -#[script_bindings(remote, name = "ray_2_d", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "ray_2_d_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::Ray2d { fn clone(_self: Ref) { let output: Val = ::clone( @@ -355,7 +359,11 @@ impl bevy::math::Ray2d { output } } -#[script_bindings(remote, name = "ray_3_d", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "ray_3_d_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::Ray3d { fn clone(_self: Ref) { let output: Val = ::clone( @@ -404,7 +412,11 @@ impl bevy::math::Ray3d { output } } -#[script_bindings(remote, name = "rot_2", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "rot_2_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::Rot2 { fn angle_between(_self: Val, other: Val) { let output: f32 = bevy::math::Rot2::angle_between( @@ -557,7 +569,11 @@ impl bevy::math::Rot2 { output } } -#[script_bindings(remote, name = "dir_2", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "dir_2_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::prelude::Dir2 { fn as_vec2(_self: Ref) { let output: Val = bevy::math::prelude::Dir2::as_vec2( @@ -680,7 +696,11 @@ impl bevy::math::prelude::Dir2 { output } } -#[script_bindings(remote, name = "dir_3", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "dir_3_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::prelude::Dir3 { fn as_vec3(_self: Ref) { let output: Val = bevy::math::prelude::Dir3::as_vec3( @@ -754,7 +774,11 @@ impl bevy::math::prelude::Dir3 { output } } -#[script_bindings(remote, name = "dir_3_a", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "dir_3_a_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::prelude::Dir3A { fn as_vec3a(_self: Ref) { let output: Val = bevy::math::prelude::Dir3A::as_vec3a(&_self) @@ -829,7 +853,11 @@ impl bevy::math::prelude::Dir3A { output } } -#[script_bindings(remote, name = "i_rect", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "i_rect_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::prelude::IRect { fn as_rect(_self: Ref) { let output: Val = bevy::math::prelude::IRect::as_rect( @@ -998,7 +1026,11 @@ impl bevy::math::prelude::IRect { output } } -#[script_bindings(remote, name = "rect", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "rect_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::prelude::Rect { fn as_irect(_self: Ref) { let output: Val = bevy::math::prelude::Rect::as_irect( @@ -1168,7 +1200,11 @@ impl bevy::math::prelude::Rect { output } } -#[script_bindings(remote, name = "u_rect", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "u_rect_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::prelude::URect { fn as_irect(_self: Ref) { let output: Val = bevy::math::prelude::URect::as_irect( @@ -1337,9 +1373,17 @@ impl bevy::math::prelude::URect { output } } -#[script_bindings(remote, name = "affine_3", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "affine_3_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::Affine3 {} -#[script_bindings(remote, name = "aabb_2_d", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "aabb_2_d_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::bounding::Aabb2d { fn bounding_circle(_self: Ref) { let output: Val = bevy::math::bounding::Aabb2d::bounding_circle( @@ -1380,7 +1424,7 @@ impl bevy::math::bounding::Aabb2d { } #[script_bindings( remote, - name = "bounding_circle", + name = "bounding_circle_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::bounding::BoundingCircle { @@ -1422,7 +1466,11 @@ impl bevy::math::bounding::BoundingCircle { output } } -#[script_bindings(remote, name = "circle", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "circle_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::Circle { fn clone(_self: Ref) { let output: Val = ::clone( @@ -1464,7 +1512,11 @@ impl bevy::math::primitives::Circle { output } } -#[script_bindings(remote, name = "annulus", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "annulus_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::Annulus { fn clone(_self: Ref) { let output: Val = ::clone( @@ -1511,7 +1563,11 @@ impl bevy::math::primitives::Annulus { output } } -#[script_bindings(remote, name = "arc_2_d", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "arc_2_d_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::Arc2d { fn angle(_self: Ref) { let output: f32 = bevy::math::primitives::Arc2d::angle(&_self).into(); @@ -1626,7 +1682,7 @@ impl bevy::math::primitives::Arc2d { } #[script_bindings( remote, - name = "capsule_2_d", + name = "capsule_2_d_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Capsule2d { @@ -1665,7 +1721,7 @@ impl bevy::math::primitives::Capsule2d { } #[script_bindings( remote, - name = "circular_sector", + name = "circular_sector_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::CircularSector { @@ -1766,7 +1822,7 @@ impl bevy::math::primitives::CircularSector { } #[script_bindings( remote, - name = "circular_segment", + name = "circular_segment_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::CircularSegment { @@ -1867,7 +1923,11 @@ impl bevy::math::primitives::CircularSegment { output } } -#[script_bindings(remote, name = "ellipse", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "ellipse_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::Ellipse { fn clone(_self: Ref) { let output: Val = ::clone( @@ -1918,7 +1978,11 @@ impl bevy::math::primitives::Ellipse { output } } -#[script_bindings(remote, name = "line_2_d", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "line_2_d_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::Line2d { fn clone(_self: Ref) { let output: Val = ::clone( @@ -1938,7 +2002,11 @@ impl bevy::math::primitives::Line2d { output } } -#[script_bindings(remote, name = "plane_2_d", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "plane_2_d_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::Plane2d { fn clone(_self: Ref) { let output: Val = ::clone( @@ -1965,7 +2033,11 @@ impl bevy::math::primitives::Plane2d { output } } -#[script_bindings(remote, name = "rectangle", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "rectangle_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::Rectangle { fn clone(_self: Ref) { let output: Val = ::clone( @@ -2038,7 +2110,7 @@ impl bevy::math::primitives::Rectangle { } #[script_bindings( remote, - name = "regular_polygon", + name = "regular_polygon_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::RegularPolygon { @@ -2111,7 +2183,11 @@ impl bevy::math::primitives::RegularPolygon { output } } -#[script_bindings(remote, name = "rhombus", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "rhombus_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::Rhombus { fn circumradius(_self: Ref) { let output: f32 = bevy::math::primitives::Rhombus::circumradius(&_self).into(); @@ -2178,7 +2254,7 @@ impl bevy::math::primitives::Rhombus { } #[script_bindings( remote, - name = "segment_2_d", + name = "segment_2_d_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Segment2d { @@ -2224,7 +2300,7 @@ impl bevy::math::primitives::Segment2d { } #[script_bindings( remote, - name = "triangle_2_d", + name = "triangle_2_d_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Triangle2d { @@ -2283,7 +2359,11 @@ impl bevy::math::primitives::Triangle2d { output } } -#[script_bindings(remote, name = "aabb_3_d", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "aabb_3_d_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::bounding::Aabb3d { fn bounding_sphere(_self: Ref) { let output: Val = bevy::math::bounding::Aabb3d::bounding_sphere( @@ -2302,7 +2382,7 @@ impl bevy::math::bounding::Aabb3d { } #[script_bindings( remote, - name = "bounding_sphere", + name = "bounding_sphere_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::bounding::BoundingSphere { @@ -2325,7 +2405,11 @@ impl bevy::math::bounding::BoundingSphere { output } } -#[script_bindings(remote, name = "sphere", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "sphere_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::Sphere { fn clone(_self: Ref) { let output: Val = ::clone( @@ -2367,7 +2451,11 @@ impl bevy::math::primitives::Sphere { output } } -#[script_bindings(remote, name = "cuboid", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "cuboid_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::Cuboid { fn clone(_self: Ref) { let output: Val = ::clone( @@ -2439,7 +2527,11 @@ impl bevy::math::primitives::Cuboid { output } } -#[script_bindings(remote, name = "cylinder", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "cylinder_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::Cylinder { fn base(_self: Ref) { let output: Val = bevy::math::primitives::Cylinder::base( @@ -2484,7 +2576,7 @@ impl bevy::math::primitives::Cylinder { } #[script_bindings( remote, - name = "capsule_3_d", + name = "capsule_3_d_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Capsule3d { @@ -2521,7 +2613,11 @@ impl bevy::math::primitives::Capsule3d { output } } -#[script_bindings(remote, name = "cone", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "cone_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::Cone { fn base(_self: Ref) { let output: Val = bevy::math::primitives::Cone::base( @@ -2570,7 +2666,7 @@ impl bevy::math::primitives::Cone { } #[script_bindings( remote, - name = "conical_frustum", + name = "conical_frustum_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::ConicalFrustum { @@ -2594,7 +2690,7 @@ impl bevy::math::primitives::ConicalFrustum { } #[script_bindings( remote, - name = "infinite_plane_3_d", + name = "infinite_plane_3_d_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::InfinitePlane3d { @@ -2638,7 +2734,11 @@ impl bevy::math::primitives::InfinitePlane3d { output } } -#[script_bindings(remote, name = "line_3_d", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "line_3_d_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::Line3d { fn clone(_self: Ref) { let output: Val = ::clone( @@ -2660,7 +2760,7 @@ impl bevy::math::primitives::Line3d { } #[script_bindings( remote, - name = "segment_3_d", + name = "segment_3_d_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Segment3d { @@ -2704,7 +2804,11 @@ impl bevy::math::primitives::Segment3d { output } } -#[script_bindings(remote, name = "torus", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "torus_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::Torus { fn clone(_self: Ref) { let output: Val = ::clone( @@ -2742,7 +2846,7 @@ impl bevy::math::primitives::Torus { } #[script_bindings( remote, - name = "triangle_3_d", + name = "triangle_3_d_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Triangle3d { @@ -2817,7 +2921,7 @@ impl bevy::math::primitives::Triangle3d { } #[script_bindings( remote, - name = "ray_cast_2_d", + name = "ray_cast_2_d_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::bounding::RayCast2d { @@ -2881,7 +2985,7 @@ impl bevy::math::bounding::RayCast2d { } #[script_bindings( remote, - name = "aabb_cast_2_d", + name = "aabb_cast_2_d_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::bounding::AabbCast2d { @@ -2934,7 +3038,7 @@ impl bevy::math::bounding::AabbCast2d { } #[script_bindings( remote, - name = "bounding_circle_cast", + name = "bounding_circle_cast_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::bounding::BoundingCircleCast { @@ -2987,7 +3091,7 @@ impl bevy::math::bounding::BoundingCircleCast { } #[script_bindings( remote, - name = "ray_cast_3_d", + name = "ray_cast_3_d_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::bounding::RayCast3d { @@ -3038,7 +3142,7 @@ impl bevy::math::bounding::RayCast3d { } #[script_bindings( remote, - name = "aabb_cast_3_d", + name = "aabb_cast_3_d_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::bounding::AabbCast3d { @@ -3076,7 +3180,7 @@ impl bevy::math::bounding::AabbCast3d { } #[script_bindings( remote, - name = "bounding_sphere_cast", + name = "bounding_sphere_cast_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::bounding::BoundingSphereCast { @@ -3112,7 +3216,11 @@ impl bevy::math::bounding::BoundingSphereCast { output } } -#[script_bindings(remote, name = "interval", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "interval_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::curve::interval::Interval { fn clamp(_self: Val, value: f32) { let output: f32 = bevy::math::curve::interval::Interval::clamp( @@ -3199,7 +3307,11 @@ impl bevy::math::curve::interval::Interval { output } } -#[script_bindings(remote, name = "float_ord", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "float_ord_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::FloatOrd { fn clone(_self: Ref) { let output: Val = ::clone( @@ -3251,7 +3363,11 @@ impl bevy::math::FloatOrd { output } } -#[script_bindings(remote, name = "plane_3_d", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "plane_3_d_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::primitives::Plane3d { fn clone(_self: Ref) { let output: Val = ::clone( @@ -3284,7 +3400,7 @@ impl bevy::math::primitives::Plane3d { } #[script_bindings( remote, - name = "tetrahedron", + name = "tetrahedron_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Tetrahedron { @@ -3335,7 +3451,7 @@ impl bevy::math::primitives::Tetrahedron { } #[script_bindings( remote, - name = "ease_function", + name = "ease_function_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::curve::easing::EaseFunction { @@ -3360,60 +3476,60 @@ impl bevy::math::curve::easing::EaseFunction { impl ::bevy::app::Plugin for BevyMathScriptingPlugin { fn build(&self, app: &mut ::bevy::prelude::App) { let mut world = app.world_mut(); - register_aspect_ratio(&mut world); - register_compass_octant(&mut world); - register_compass_quadrant(&mut world); - register_isometry_2_d(&mut world); - register_isometry_3_d(&mut world); - register_ray_2_d(&mut world); - register_ray_3_d(&mut world); - register_rot_2(&mut world); - register_dir_2(&mut world); - register_dir_3(&mut world); - register_dir_3_a(&mut world); - register_i_rect(&mut world); - register_rect(&mut world); - register_u_rect(&mut world); - register_affine_3(&mut world); - register_aabb_2_d(&mut world); - register_bounding_circle(&mut world); - register_circle(&mut world); - register_annulus(&mut world); - register_arc_2_d(&mut world); - register_capsule_2_d(&mut world); - register_circular_sector(&mut world); - register_circular_segment(&mut world); - register_ellipse(&mut world); - register_line_2_d(&mut world); - register_plane_2_d(&mut world); - register_rectangle(&mut world); - register_regular_polygon(&mut world); - register_rhombus(&mut world); - register_segment_2_d(&mut world); - register_triangle_2_d(&mut world); - register_aabb_3_d(&mut world); - register_bounding_sphere(&mut world); - register_sphere(&mut world); - register_cuboid(&mut world); - register_cylinder(&mut world); - register_capsule_3_d(&mut world); - register_cone(&mut world); - register_conical_frustum(&mut world); - register_infinite_plane_3_d(&mut world); - register_line_3_d(&mut world); - register_segment_3_d(&mut world); - register_torus(&mut world); - register_triangle_3_d(&mut world); - register_ray_cast_2_d(&mut world); - register_aabb_cast_2_d(&mut world); - register_bounding_circle_cast(&mut world); - register_ray_cast_3_d(&mut world); - register_aabb_cast_3_d(&mut world); - register_bounding_sphere_cast(&mut world); - register_interval(&mut world); - register_float_ord(&mut world); - register_plane_3_d(&mut world); - register_tetrahedron(&mut world); - register_ease_function(&mut world); + register_aspect_ratio_functions(&mut world); + register_compass_octant_functions(&mut world); + register_compass_quadrant_functions(&mut world); + register_isometry_2_d_functions(&mut world); + register_isometry_3_d_functions(&mut world); + register_ray_2_d_functions(&mut world); + register_ray_3_d_functions(&mut world); + register_rot_2_functions(&mut world); + register_dir_2_functions(&mut world); + register_dir_3_functions(&mut world); + register_dir_3_a_functions(&mut world); + register_i_rect_functions(&mut world); + register_rect_functions(&mut world); + register_u_rect_functions(&mut world); + register_affine_3_functions(&mut world); + register_aabb_2_d_functions(&mut world); + register_bounding_circle_functions(&mut world); + register_circle_functions(&mut world); + register_annulus_functions(&mut world); + register_arc_2_d_functions(&mut world); + register_capsule_2_d_functions(&mut world); + register_circular_sector_functions(&mut world); + register_circular_segment_functions(&mut world); + register_ellipse_functions(&mut world); + register_line_2_d_functions(&mut world); + register_plane_2_d_functions(&mut world); + register_rectangle_functions(&mut world); + register_regular_polygon_functions(&mut world); + register_rhombus_functions(&mut world); + register_segment_2_d_functions(&mut world); + register_triangle_2_d_functions(&mut world); + register_aabb_3_d_functions(&mut world); + register_bounding_sphere_functions(&mut world); + register_sphere_functions(&mut world); + register_cuboid_functions(&mut world); + register_cylinder_functions(&mut world); + register_capsule_3_d_functions(&mut world); + register_cone_functions(&mut world); + register_conical_frustum_functions(&mut world); + register_infinite_plane_3_d_functions(&mut world); + register_line_3_d_functions(&mut world); + register_segment_3_d_functions(&mut world); + register_torus_functions(&mut world); + register_triangle_3_d_functions(&mut world); + register_ray_cast_2_d_functions(&mut world); + register_aabb_cast_2_d_functions(&mut world); + register_bounding_circle_cast_functions(&mut world); + register_ray_cast_3_d_functions(&mut world); + register_aabb_cast_3_d_functions(&mut world); + register_bounding_sphere_cast_functions(&mut world); + register_interval_functions(&mut world); + register_float_ord_functions(&mut world); + register_plane_3_d_functions(&mut world); + register_tetrahedron_functions(&mut world); + register_ease_function_functions(&mut world); } } diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_reflect.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_reflect.rs index 6054f74516..172b81a9e2 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_reflect.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_reflect.rs @@ -14,7 +14,7 @@ use crate::*; pub struct BevyReflectScriptingPlugin; #[script_bindings( remote, - name = "atomic_bool", + name = "atomic_bool_functions", bms_core_path = "bevy_mod_scripting_core" )] impl std::sync::atomic::AtomicBool { @@ -33,7 +33,7 @@ impl std::sync::atomic::AtomicBool { } #[script_bindings( remote, - name = "atomic_i_16", + name = "atomic_i_16_functions", bms_core_path = "bevy_mod_scripting_core" )] impl std::sync::atomic::AtomicI16 { @@ -52,7 +52,7 @@ impl std::sync::atomic::AtomicI16 { } #[script_bindings( remote, - name = "atomic_i_32", + name = "atomic_i_32_functions", bms_core_path = "bevy_mod_scripting_core" )] impl std::sync::atomic::AtomicI32 { @@ -71,7 +71,7 @@ impl std::sync::atomic::AtomicI32 { } #[script_bindings( remote, - name = "atomic_i_64", + name = "atomic_i_64_functions", bms_core_path = "bevy_mod_scripting_core" )] impl std::sync::atomic::AtomicI64 { @@ -90,7 +90,7 @@ impl std::sync::atomic::AtomicI64 { } #[script_bindings( remote, - name = "atomic_i_8", + name = "atomic_i_8_functions", bms_core_path = "bevy_mod_scripting_core" )] impl std::sync::atomic::AtomicI8 { @@ -109,7 +109,7 @@ impl std::sync::atomic::AtomicI8 { } #[script_bindings( remote, - name = "atomic_isize", + name = "atomic_isize_functions", bms_core_path = "bevy_mod_scripting_core" )] impl std::sync::atomic::AtomicIsize { @@ -130,7 +130,7 @@ impl std::sync::atomic::AtomicIsize { } #[script_bindings( remote, - name = "atomic_u_16", + name = "atomic_u_16_functions", bms_core_path = "bevy_mod_scripting_core" )] impl std::sync::atomic::AtomicU16 { @@ -149,7 +149,7 @@ impl std::sync::atomic::AtomicU16 { } #[script_bindings( remote, - name = "atomic_u_32", + name = "atomic_u_32_functions", bms_core_path = "bevy_mod_scripting_core" )] impl std::sync::atomic::AtomicU32 { @@ -168,7 +168,7 @@ impl std::sync::atomic::AtomicU32 { } #[script_bindings( remote, - name = "atomic_u_64", + name = "atomic_u_64_functions", bms_core_path = "bevy_mod_scripting_core" )] impl std::sync::atomic::AtomicU64 { @@ -187,7 +187,7 @@ impl std::sync::atomic::AtomicU64 { } #[script_bindings( remote, - name = "atomic_u_8", + name = "atomic_u_8_functions", bms_core_path = "bevy_mod_scripting_core" )] impl std::sync::atomic::AtomicU8 { @@ -206,7 +206,7 @@ impl std::sync::atomic::AtomicU8 { } #[script_bindings( remote, - name = "atomic_usize", + name = "atomic_usize_functions", bms_core_path = "bevy_mod_scripting_core" )] impl std::sync::atomic::AtomicUsize { @@ -225,7 +225,11 @@ impl std::sync::atomic::AtomicUsize { output } } -#[script_bindings(remote, name = "duration", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "duration_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::utils::Duration { fn abs_diff(_self: Val, other: Val) { let output: Val = bevy::utils::Duration::abs_diff( @@ -452,7 +456,11 @@ impl bevy::utils::Duration { output } } -#[script_bindings(remote, name = "instant", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "instant_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::utils::Instant { fn add(_self: Val, other: Val) { let output: Val = , @@ -885,7 +897,11 @@ impl bevy::math::Quat { output } } -#[script_bindings(remote, name = "vec_3", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "vec_3_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::Vec3 { fn abs(_self: Val) { let output: Val = bevy::math::Vec3::abs(_self.into_inner()) @@ -1531,7 +1547,11 @@ impl bevy::math::Vec3 { output } } -#[script_bindings(remote, name = "i_vec_2", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "i_vec_2_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::IVec2 { fn abs(_self: Val) { let output: Val = bevy::math::IVec2::abs(_self.into_inner()) @@ -2022,7 +2042,11 @@ impl bevy::math::IVec2 { output } } -#[script_bindings(remote, name = "i_vec_3", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "i_vec_3_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::IVec3 { fn abs(_self: Val) { let output: Val = bevy::math::IVec3::abs(_self.into_inner()) @@ -2519,7 +2543,11 @@ impl bevy::math::IVec3 { output } } -#[script_bindings(remote, name = "i_vec_4", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "i_vec_4_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::IVec4 { fn abs(_self: Val) { let output: Val = bevy::math::IVec4::abs(_self.into_inner()) @@ -3006,7 +3034,7 @@ impl bevy::math::IVec4 { } #[script_bindings( remote, - name = "i_64_vec_2", + name = "i_64_vec_2_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::I64Vec2 { @@ -3508,7 +3536,7 @@ impl bevy::math::I64Vec2 { } #[script_bindings( remote, - name = "i_64_vec_3", + name = "i_64_vec_3_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::I64Vec3 { @@ -4015,7 +4043,7 @@ impl bevy::math::I64Vec3 { } #[script_bindings( remote, - name = "i_64_vec_4", + name = "i_64_vec_4_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::I64Vec4 { @@ -4508,7 +4536,11 @@ impl bevy::math::I64Vec4 { output } } -#[script_bindings(remote, name = "u_vec_2", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "u_vec_2_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::UVec2 { fn add(_self: Val, rhs: Ref) { let output: Val = , rhs: Ref) { let output: Val = , rhs: Ref) { let output: Val = ) { let output: Val = bevy::math::Vec2::abs(_self.into_inner()) @@ -7665,7 +7709,11 @@ impl bevy::math::Vec2 { output } } -#[script_bindings(remote, name = "vec_3_a", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "vec_3_a_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::Vec3A { fn abs(_self: Val) { let output: Val = bevy::math::Vec3A::abs(_self.into_inner()) @@ -8324,7 +8372,11 @@ impl bevy::math::Vec3A { output } } -#[script_bindings(remote, name = "vec_4", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "vec_4_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::Vec4 { fn abs(_self: Val) { let output: Val = bevy::math::Vec4::abs(_self.into_inner()) @@ -8940,7 +8992,11 @@ impl bevy::math::Vec4 { output } } -#[script_bindings(remote, name = "b_vec_2", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "b_vec_2_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::BVec2 { fn all(_self: Val) { let output: bool = bevy::math::BVec2::all(_self.into_inner()).into(); @@ -8996,7 +9052,11 @@ impl bevy::math::BVec2 { output } } -#[script_bindings(remote, name = "b_vec_3", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "b_vec_3_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::BVec3 { fn all(_self: Val) { let output: bool = bevy::math::BVec3::all(_self.into_inner()).into(); @@ -9052,7 +9112,11 @@ impl bevy::math::BVec3 { output } } -#[script_bindings(remote, name = "b_vec_4", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "b_vec_4_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::BVec4 { fn all(_self: Val) { let output: bool = bevy::math::BVec4::all(_self.into_inner()).into(); @@ -9108,7 +9172,11 @@ impl bevy::math::BVec4 { output } } -#[script_bindings(remote, name = "d_vec_2", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "d_vec_2_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::DVec2 { fn abs(_self: Val) { let output: Val = bevy::math::DVec2::abs(_self.into_inner()) @@ -9775,7 +9843,11 @@ impl bevy::math::DVec2 { output } } -#[script_bindings(remote, name = "d_vec_3", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "d_vec_3_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::DVec3 { fn abs(_self: Val) { let output: Val = bevy::math::DVec3::abs(_self.into_inner()) @@ -10433,7 +10505,11 @@ impl bevy::math::DVec3 { output } } -#[script_bindings(remote, name = "d_vec_4", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "d_vec_4_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::DVec4 { fn abs(_self: Val) { let output: Val = bevy::math::DVec4::abs(_self.into_inner()) @@ -11057,7 +11133,11 @@ impl bevy::math::DVec4 { output } } -#[script_bindings(remote, name = "mat_2", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "mat_2_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::Mat2 { fn abs(_self: Ref) { let output: Val = bevy::math::Mat2::abs(&_self).into(); @@ -11268,7 +11348,11 @@ impl bevy::math::Mat2 { output } } -#[script_bindings(remote, name = "mat_3", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "mat_3_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::Mat3 { fn abs(_self: Ref) { let output: Val = bevy::math::Mat3::abs(&_self).into(); @@ -11580,7 +11664,11 @@ impl bevy::math::Mat3 { output } } -#[script_bindings(remote, name = "mat_3_a", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "mat_3_a_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::Mat3A { fn abs(_self: Ref) { let output: Val = bevy::math::Mat3A::abs(&_self).into(); @@ -11894,7 +11982,11 @@ impl bevy::math::Mat3A { output } } -#[script_bindings(remote, name = "mat_4", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "mat_4_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::Mat4 { fn abs(_self: Ref) { let output: Val = bevy::math::Mat4::abs(&_self).into(); @@ -12411,7 +12503,11 @@ impl bevy::math::Mat4 { output } } -#[script_bindings(remote, name = "d_mat_2", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "d_mat_2_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::DMat2 { fn abs(_self: Ref) { let output: Val = bevy::math::DMat2::abs(&_self).into(); @@ -12610,7 +12706,11 @@ impl bevy::math::DMat2 { output } } -#[script_bindings(remote, name = "d_mat_3", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "d_mat_3_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::DMat3 { fn abs(_self: Ref) { let output: Val = bevy::math::DMat3::abs(&_self).into(); @@ -12909,7 +13009,11 @@ impl bevy::math::DMat3 { output } } -#[script_bindings(remote, name = "d_mat_4", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "d_mat_4_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::DMat4 { fn abs(_self: Ref) { let output: Val = bevy::math::DMat4::abs(&_self).into(); @@ -13399,7 +13503,11 @@ impl bevy::math::DMat4 { output } } -#[script_bindings(remote, name = "affine_2", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "affine_2_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::Affine2 { fn abs_diff_eq( _self: Ref, @@ -13574,7 +13682,7 @@ impl bevy::math::Affine2 { } #[script_bindings( remote, - name = "affine_3_a", + name = "affine_3_a_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::Affine3A { @@ -13845,7 +13953,7 @@ impl bevy::math::Affine3A { } #[script_bindings( remote, - name = "d_affine_2", + name = "d_affine_2_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::DAffine2 { @@ -14009,7 +14117,7 @@ impl bevy::math::DAffine2 { } #[script_bindings( remote, - name = "d_affine_3", + name = "d_affine_3_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::DAffine3 { @@ -14259,7 +14367,11 @@ impl bevy::math::DAffine3 { output } } -#[script_bindings(remote, name = "d_quat", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "d_quat_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::DQuat { fn abs_diff_eq( _self: Val, @@ -14572,7 +14684,11 @@ impl bevy::math::DQuat { output } } -#[script_bindings(remote, name = "euler_rot", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "euler_rot_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::EulerRot { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -14596,7 +14712,11 @@ impl bevy::math::EulerRot { output } } -#[script_bindings(remote, name = "b_vec_3_a", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "b_vec_3_a_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::BVec3A { fn all(_self: Val) { let output: bool = bevy::math::BVec3A::all(_self.into_inner()).into(); @@ -14645,7 +14765,11 @@ impl bevy::math::BVec3A { output } } -#[script_bindings(remote, name = "b_vec_4_a", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "b_vec_4_a_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::math::BVec4A { fn all(_self: Val) { let output: bool = bevy::math::BVec4A::all(_self.into_inner()).into(); @@ -14694,7 +14818,11 @@ impl bevy::math::BVec4A { output } } -#[script_bindings(remote, name = "smol_str", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "smol_str_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl smol_str::SmolStr { fn clone(_self: Ref) { let output: Val = ::clone( @@ -14727,7 +14855,11 @@ impl smol_str::SmolStr { output } } -#[script_bindings(remote, name = "uuid", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "uuid_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl uuid::Uuid { fn as_u128(_self: Ref) { let output: u128 = uuid::Uuid::as_u128(&_self).into(); @@ -14829,59 +14961,59 @@ impl uuid::Uuid { impl ::bevy::app::Plugin for BevyReflectScriptingPlugin { fn build(&self, app: &mut ::bevy::prelude::App) { let mut world = app.world_mut(); - register_atomic_bool(&mut world); - register_atomic_i_16(&mut world); - register_atomic_i_32(&mut world); - register_atomic_i_64(&mut world); - register_atomic_i_8(&mut world); - register_atomic_isize(&mut world); - register_atomic_u_16(&mut world); - register_atomic_u_32(&mut world); - register_atomic_u_64(&mut world); - register_atomic_u_8(&mut world); - register_atomic_usize(&mut world); - register_duration(&mut world); - register_instant(&mut world); - register_range_full(&mut world); - register_quat(&mut world); - register_vec_3(&mut world); - register_i_vec_2(&mut world); - register_i_vec_3(&mut world); - register_i_vec_4(&mut world); - register_i_64_vec_2(&mut world); - register_i_64_vec_3(&mut world); - register_i_64_vec_4(&mut world); - register_u_vec_2(&mut world); - register_u_vec_3(&mut world); - register_u_vec_4(&mut world); - register_u_64_vec_2(&mut world); - register_u_64_vec_3(&mut world); - register_u_64_vec_4(&mut world); - register_vec_2(&mut world); - register_vec_3_a(&mut world); - register_vec_4(&mut world); - register_b_vec_2(&mut world); - register_b_vec_3(&mut world); - register_b_vec_4(&mut world); - register_d_vec_2(&mut world); - register_d_vec_3(&mut world); - register_d_vec_4(&mut world); - register_mat_2(&mut world); - register_mat_3(&mut world); - register_mat_3_a(&mut world); - register_mat_4(&mut world); - register_d_mat_2(&mut world); - register_d_mat_3(&mut world); - register_d_mat_4(&mut world); - register_affine_2(&mut world); - register_affine_3_a(&mut world); - register_d_affine_2(&mut world); - register_d_affine_3(&mut world); - register_d_quat(&mut world); - register_euler_rot(&mut world); - register_b_vec_3_a(&mut world); - register_b_vec_4_a(&mut world); - register_smol_str(&mut world); - register_uuid(&mut world); + register_atomic_bool_functions(&mut world); + register_atomic_i_16_functions(&mut world); + register_atomic_i_32_functions(&mut world); + register_atomic_i_64_functions(&mut world); + register_atomic_i_8_functions(&mut world); + register_atomic_isize_functions(&mut world); + register_atomic_u_16_functions(&mut world); + register_atomic_u_32_functions(&mut world); + register_atomic_u_64_functions(&mut world); + register_atomic_u_8_functions(&mut world); + register_atomic_usize_functions(&mut world); + register_duration_functions(&mut world); + register_instant_functions(&mut world); + register_range_full_functions(&mut world); + register_quat_functions(&mut world); + register_vec_3_functions(&mut world); + register_i_vec_2_functions(&mut world); + register_i_vec_3_functions(&mut world); + register_i_vec_4_functions(&mut world); + register_i_64_vec_2_functions(&mut world); + register_i_64_vec_3_functions(&mut world); + register_i_64_vec_4_functions(&mut world); + register_u_vec_2_functions(&mut world); + register_u_vec_3_functions(&mut world); + register_u_vec_4_functions(&mut world); + register_u_64_vec_2_functions(&mut world); + register_u_64_vec_3_functions(&mut world); + register_u_64_vec_4_functions(&mut world); + register_vec_2_functions(&mut world); + register_vec_3_a_functions(&mut world); + register_vec_4_functions(&mut world); + register_b_vec_2_functions(&mut world); + register_b_vec_3_functions(&mut world); + register_b_vec_4_functions(&mut world); + register_d_vec_2_functions(&mut world); + register_d_vec_3_functions(&mut world); + register_d_vec_4_functions(&mut world); + register_mat_2_functions(&mut world); + register_mat_3_functions(&mut world); + register_mat_3_a_functions(&mut world); + register_mat_4_functions(&mut world); + register_d_mat_2_functions(&mut world); + register_d_mat_3_functions(&mut world); + register_d_mat_4_functions(&mut world); + register_affine_2_functions(&mut world); + register_affine_3_a_functions(&mut world); + register_d_affine_2_functions(&mut world); + register_d_affine_3_functions(&mut world); + register_d_quat_functions(&mut world); + register_euler_rot_functions(&mut world); + register_b_vec_3_a_functions(&mut world); + register_b_vec_4_a_functions(&mut world); + register_smol_str_functions(&mut world); + register_uuid_functions(&mut world); } } diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_time.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_time.rs index 83e4739a9b..beb44be1f7 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_time.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_time.rs @@ -12,7 +12,11 @@ use bevy_mod_scripting_core::bindings::{ use bevy_mod_scripting_derive::script_bindings; use crate::*; pub struct BevyTimeScriptingPlugin; -#[script_bindings(remote, name = "fixed", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "fixed_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::time::prelude::Fixed { fn clone(_self: Ref) { let output: Val = ::clone( @@ -22,7 +26,11 @@ impl bevy::time::prelude::Fixed { output } } -#[script_bindings(remote, name = "real", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "real_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::time::prelude::Real { fn clone(_self: Ref) { let output: Val = ::clone( @@ -32,7 +40,11 @@ impl bevy::time::prelude::Real { output } } -#[script_bindings(remote, name = "timer", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "timer_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::time::prelude::Timer { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -190,7 +202,7 @@ impl bevy::time::prelude::Timer { } #[script_bindings( remote, - name = "timer_mode", + name = "timer_mode_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::time::prelude::TimerMode { @@ -219,7 +231,11 @@ impl bevy::time::prelude::TimerMode { output } } -#[script_bindings(remote, name = "virtual", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "virtual_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::time::prelude::Virtual { fn clone(_self: Ref) { let output: Val = ::clone( @@ -229,7 +245,11 @@ impl bevy::time::prelude::Virtual { output } } -#[script_bindings(remote, name = "stopwatch", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "stopwatch_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::time::Stopwatch { fn assert_receiver_is_total_eq(_self: Ref) { let output: () = ::assert_receiver_is_total_eq( @@ -300,11 +320,11 @@ impl bevy::time::Stopwatch { impl ::bevy::app::Plugin for BevyTimeScriptingPlugin { fn build(&self, app: &mut ::bevy::prelude::App) { let mut world = app.world_mut(); - register_fixed(&mut world); - register_real(&mut world); - register_timer(&mut world); - register_timer_mode(&mut world); - register_virtual(&mut world); - register_stopwatch(&mut world); + register_fixed_functions(&mut world); + register_real_functions(&mut world); + register_timer_functions(&mut world); + register_timer_mode_functions(&mut world); + register_virtual_functions(&mut world); + register_stopwatch_functions(&mut world); } } diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_transform.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_transform.rs index 187eb3334f..4c3fd5c699 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_transform.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_transform.rs @@ -14,7 +14,7 @@ use crate::*; pub struct BevyTransformScriptingPlugin; #[script_bindings( remote, - name = "global_transform", + name = "global_transform_functions", bms_core_path = "bevy_mod_scripting_core" )] impl bevy::transform::components::GlobalTransform { @@ -245,7 +245,11 @@ impl bevy::transform::components::GlobalTransform { output } } -#[script_bindings(remote, name = "transform", bms_core_path = "bevy_mod_scripting_core")] +#[script_bindings( + remote, + name = "transform_functions", + bms_core_path = "bevy_mod_scripting_core" +)] impl bevy::transform::components::Transform { fn back(_self: Ref) { let output: Val = bevy::transform::components::Transform::back( @@ -617,7 +621,7 @@ impl bevy::transform::components::Transform { impl ::bevy::app::Plugin for BevyTransformScriptingPlugin { fn build(&self, app: &mut ::bevy::prelude::App) { let mut world = app.world_mut(); - register_global_transform(&mut world); - register_transform(&mut world); + register_global_transform_functions(&mut world); + register_transform_functions(&mut world); } } From 24edef04d109b17c863f691131172244c6b65b8c Mon Sep 17 00:00:00 2001 From: makspll Date: Mon, 10 Feb 2025 15:04:08 +0000 Subject: [PATCH 10/13] add docstrings --- crates/bevy_api_gen/src/template.rs | 6 -- crates/bevy_api_gen/templates/field.tera | 13 --- crates/bevy_api_gen/templates/footer.tera | 4 + crates/bevy_api_gen/templates/function.tera | 53 ------------ crates/bevy_api_gen/templates/item.tera | 93 --------------------- 5 files changed, 4 insertions(+), 165 deletions(-) delete mode 100644 crates/bevy_api_gen/templates/field.tera delete mode 100644 crates/bevy_api_gen/templates/function.tera delete mode 100644 crates/bevy_api_gen/templates/item.tera diff --git a/crates/bevy_api_gen/src/template.rs b/crates/bevy_api_gen/src/template.rs index 5fd0842e3a..ecc5ceb6b0 100644 --- a/crates/bevy_api_gen/src/template.rs +++ b/crates/bevy_api_gen/src/template.rs @@ -32,12 +32,6 @@ pub enum TemplateKind { SharedModule, #[strum(to_string = "crate.tera")] CrateArtifact, - #[strum(to_string = "field.tera")] - Field, - #[strum(to_string = "function.tera")] - Function, - #[strum(to_string = "item.tera")] - Item, #[strum(to_string = "header.tera")] Header, #[strum(to_string = "footer.tera")] diff --git a/crates/bevy_api_gen/templates/field.tera b/crates/bevy_api_gen/templates/field.tera deleted file mode 100644 index ea5fb1450a..0000000000 --- a/crates/bevy_api_gen/templates/field.tera +++ /dev/null @@ -1,13 +0,0 @@ -{%- if field.reflection_strategy == "Filtered" -%} - #[lua(skip)] -{%- endif -%} - -{%- if not item.is_tuple_struct -%} -{{- field.ident -}} : -{%- endif -%} -{% if field.reflection_strategy != "Reflection" -%} -{{- field.ty -}} -{%- else -%} -ReflectReference -{%- endif -%} , - diff --git a/crates/bevy_api_gen/templates/footer.tera b/crates/bevy_api_gen/templates/footer.tera index 2c2ffd7d52..8ed5a23471 100644 --- a/crates/bevy_api_gen/templates/footer.tera +++ b/crates/bevy_api_gen/templates/footer.tera @@ -15,6 +15,10 @@ pub struct {{ "ScriptingPlugin" | prefix_cratename | convert_case(case="upper_ca )] impl {{item.import_path}} { {% for function in item.functions %} + + {% for docstring in function.docstrings %} + /// {{ docstring }} + {% endfor %} fn {{ function.ident }} ( {%- for arg in function.args -%} {%- if arg.proxy_ty is matching("Mut.*")-%} diff --git a/crates/bevy_api_gen/templates/function.tera b/crates/bevy_api_gen/templates/function.tera deleted file mode 100644 index d6625298f6..0000000000 --- a/crates/bevy_api_gen/templates/function.tera +++ /dev/null @@ -1,53 +0,0 @@ -r#" -{% for docstring in function.docstrings -%} -///{{docstring}} -{% endfor -%} - -{%- filter prettyplease(impl_context=true) -%} -#[lua( - -{%- if function.from_trait_path -%} - {% if function.from_trait_path is matching("std::(ops|cmp)::(PartialEq|Neg|Mul|Add|Sub|Div|Rem)") %} - {% set is_op = true %} - {% endif %} -as_trait="{{ function.from_trait_path }}", -{%- endif -%} -{% if is_op %} -composite="{{ function.ident }}", -{% endif %} - -{% if function.from_trait_path %} - {% if function.from_trait_path is starting_with("std::ops::Neg") %} - metamethod="Unm", - {% elif function.from_trait_path is starting_with("std::ops::Mul") %} - metamethod="Mul", - {% elif function.from_trait_path is starting_with("std::ops::Add") %} - metamethod="Add", - {% elif function.from_trait_path is starting_with("std::ops::Sub") %} - metamethod="Sub", - {% elif function.from_trait_path is starting_with("std::ops::Div") %} - metamethod="Div", - {% elif function.from_trait_path is starting_with("std::ops::Rem") %} - metamethod="Mod", - {% elif function.from_trait_path is starting_with("std::cmp::PartialEq") %} - metamethod="Eq", - {% endif %} -{% endif %} -)] -{% if function.is_unsafe %}unsafe {% endif -%}fn {{ function.ident }} ( - {%- filter separated(delimeter=", ", split_at="---", ignore_first=true) -%} - - {%- for arg in function.args -%} - --- - {%- if arg.ident != "self" -%} - {{- arg.ident -}} - {%- else -%} - _{{- arg.ident -}} - {%- endif -%} - : {{- arg.proxy_ty -}} - {%- endfor -%} - - {%- endfilter -%} -) -> {{ function.output.proxy_ty -}}; -{%- endfilter %} -"# \ No newline at end of file diff --git a/crates/bevy_api_gen/templates/item.tera b/crates/bevy_api_gen/templates/item.tera deleted file mode 100644 index 969b932438..0000000000 --- a/crates/bevy_api_gen/templates/item.tera +++ /dev/null @@ -1,93 +0,0 @@ -{% import "macros.tera" as macros -%} -{% for line in item.docstrings %} -{# for now #} -{% endfor %} - -{% if args.self_is_bms_lua %} -{% set bms_core_path="bevy_mod_scripting_core" %} -{% set bms_lua_path="crate" %} -{% else %} -{% set bms_core_path="bevy_mod_scripting::core" %} -{% set bms_lua_path="bevy_mod_scripting::lua" %} -{% endif %} - -#[derive(bevy_mod_scripting_derive::LuaProxy)] -#[proxy( -remote="{{ item.import_path }}", -bms_core_path="{{bms_core_path}}", -bms_lua_path="{{bms_lua_path}}", - -functions[ - {%- filter separated(delimeter=",\n\t\t\t", split_at="---", ignore_first=true) -%} - {%- for function in item.functions -%} - --- - {%- include "function.tera" -%} - {%- endfor -%} - {%- if item.impls_display -%} - --- - r#" - {{- macros::display_as_to_string() -}} - "# - {%- elif item.impls_debug -%} - --- - r#" - {{- macros::debug_as_to_string() -}} - "# - {%- endif -%} - {%- if item.import_path is matching("bevy::math::[^B]?Vec.?") -%} - {%- set vec_type = item.import_path | split(pat="::") | last -%} - {%- if vec_type is starting_with("V") -%} - {%- set num_type = "f32" -%} - {%- elif vec_type is starting_with("U16") -%} - {%- set num_type = "u64" -%} - {%- elif vec_type is starting_with("UV") -%} - {%- set num_type = "u32" -%} - {%- elif vec_type is starting_with("U16") -%} - {%- set num_type = "u16" -%} - {%- elif vec_type is starting_with("DV") -%} - {%- set num_type = "f64" -%} - {%- elif vec_type is starting_with("IV") -%} - {%- set num_type = "i32" -%} - {%- elif vec_type is starting_with("I16") -%} - {%- set num_type = "i16" -%} - {%- elif vec_type is starting_with("I64") -%} - {%- set num_type = "i64" -%} - {%- endif -%} - - --- - r#" - {{- macros::vector_index(num_type=num_type) -}} - "# - --- - r#" - {{- macros::vector_newindex(num_type=num_type) -}} - "# - {% elif item.import_path is matching("bevy::math::[^B]?Mat.?") %} - --- - r#" - {%- set mat_type = item.import_path | split(pat="::") | last -%} - {%- set col_type = mat_type | replace(from="Mat", to="Vec")-%} - {{- macros::matrix_index(col_type=col_type,mat_type=mat_type,bms_core_path=bms_core_path)-}} - "# - {% endif %} - {%- endfilter -%} -] -)] - -{%- if item.is_tuple_struct -%} -{% set open_item = "(" %} -{% set close_item = ");" %} -{% else %} -{% set open_item = "{" %} -{% set close_item = "}" %} -{% endif %} - -pub struct {{ item.ident -}} {{ open_item }} - {% if not item.is_enum %} - {% for field in item.variants[0].fields %} - {% if field.reflection_strategy != "Filtered" %} - {% include "field.tera" %} - {% endif %} - {% endfor %} - {% endif %} -{{ close_item -}} \ No newline at end of file From f3ed7e5b81fabc266207173145fea46201d3ac5e Mon Sep 17 00:00:00 2001 From: makspll Date: Mon, 10 Feb 2025 15:08:59 +0000 Subject: [PATCH 11/13] add output type --- crates/bevy_api_gen/templates/footer.tera | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_api_gen/templates/footer.tera b/crates/bevy_api_gen/templates/footer.tera index 8ed5a23471..8f333ca65a 100644 --- a/crates/bevy_api_gen/templates/footer.tera +++ b/crates/bevy_api_gen/templates/footer.tera @@ -26,7 +26,7 @@ impl {{item.import_path}} { {{- arg.ident | to_arg_pattern() -}} : {{- arg.proxy_ty -}}, {%- endfor -%} - ) { + ) -> {{ function.output.proxy_ty }} { let output: {{ function.output.proxy_ty }} = {%- if function.from_trait_path -%} {{- function_call_expression(type=item.import_path, trait=function.from_trait_path, function=function.ident) -}} From ef4d1850ff47e05c91eebf3bea4e7512cc076f1f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 15:17:28 +0000 Subject: [PATCH 12/13] chore(codegen): update bevy bindings --- .../src/bevy_bindings/bevy_core.rs | 7 +- .../src/bevy_bindings/bevy_ecs.rs | 135 +- .../src/bevy_bindings/bevy_hierarchy.rs | 20 +- .../src/bevy_bindings/bevy_input.rs | 427 +- .../src/bevy_bindings/bevy_math.rs | 2143 ++- .../src/bevy_bindings/bevy_reflect.rs | 11131 +++++++++++++--- .../src/bevy_bindings/bevy_time.rs | 387 +- .../src/bevy_bindings/bevy_transform.rs | 379 +- 8 files changed, 11830 insertions(+), 2799 deletions(-) diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_core.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_core.rs index 4d3c247bc7..5a74b8c8b8 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_core.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_core.rs @@ -18,14 +18,17 @@ pub struct BevyCoreScriptingPlugin; bms_core_path = "bevy_mod_scripting_core" )] impl bevy::core::prelude::Name { - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq( + _self: Ref, + other: Ref, + ) -> bool { let output: bool = >::eq(&_self, &other) diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_ecs.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_ecs.rs index 530b46e675..2e7bd6901b 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_ecs.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_ecs.rs @@ -18,44 +18,71 @@ pub struct BevyEcsScriptingPlugin; bms_core_path = "bevy_mod_scripting_core" )] impl bevy::ecs::entity::Entity { - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq( + _self: Ref, + other: Ref, + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn from_bits(bits: u64) { + /// Reconstruct an `Entity` previously destructured with [`Entity::to_bits`]. + /// Only useful when applied to results from `to_bits` in the same instance of an application. + /// # Panics + /// This method will likely panic if given `u64` values that did not come from [`Entity::to_bits`]. + fn from_bits(bits: u64) -> Val { let output: Val = bevy::ecs::entity::Entity::from_bits( bits, ) .into(); output } - fn from_raw(index: u32) { + /// Creates a new entity ID with the specified `index` and a generation of 1. + /// # Note + /// Spawning a specific `entity` value is __rarely the right choice__. Most apps should favor + /// [`Commands::spawn`](crate::system::Commands::spawn). This method should generally + /// only be used for sharing entities across apps, and only when they have a scheme + /// worked out to share an index space (which doesn't happen by default). + /// In general, one should not try to synchronize the ECS by attempting to ensure that + /// `Entity` lines up between instances, but instead insert a secondary identifier as + /// a component. + fn from_raw(index: u32) -> Val { let output: Val = bevy::ecs::entity::Entity::from_raw( index, ) .into(); output } - fn generation(_self: Val) { + /// Returns the generation of this Entity's index. The generation is incremented each time an + /// entity with a given index is despawned. This serves as a "count" of the number of times a + /// given index has been reused (index, generation) pairs uniquely identify a given Entity. + fn generation(_self: Val) -> u32 { let output: u32 = bevy::ecs::entity::Entity::generation(_self.into_inner()) .into(); output } - fn index(_self: Val) { + /// Return a transiently unique identifier. + /// No two simultaneously-live entities share the same index, but dead entities' indices may collide + /// with both live and dead entities. Useful for compactly representing entities within a + /// specific snapshot of the world, such as when serializing. + fn index(_self: Val) -> u32 { let output: u32 = bevy::ecs::entity::Entity::index(_self.into_inner()).into(); output } - fn to_bits(_self: Val) { + /// Convert to a form convenient for passing outside of rust. + /// Only useful for identifying entities within the same instance of an application. Do not use + /// for serialization between runs. + /// No particular structure is guaranteed for the returned bits. + fn to_bits(_self: Val) -> u64 { let output: u64 = bevy::ecs::entity::Entity::to_bits(_self.into_inner()).into(); output } @@ -90,14 +117,16 @@ impl bevy::ecs::world::OnReplace {} bms_core_path = "bevy_mod_scripting_core" )] impl bevy::ecs::component::ComponentId { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -107,19 +136,23 @@ impl bevy::ecs::component::ComponentId { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn index(_self: Val) { + /// Returns the index of the current component. + fn index(_self: Val) -> usize { let output: usize = bevy::ecs::component::ComponentId::index(_self.into_inner()) .into(); output } - fn new(index: usize) { + /// Creates a new [`ComponentId`]. + /// The `index` is a unique value associated with each type of component in a given world. + /// Usually, this value is taken from a counter incremented for each type of component registered with the world. + fn new(index: usize) -> Val { let output: Val = bevy::ecs::component::ComponentId::new( index, ) @@ -133,14 +166,14 @@ impl bevy::ecs::component::ComponentId { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::ecs::component::Tick { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) @@ -150,22 +183,25 @@ impl bevy::ecs::component::Tick { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn get(_self: Val) { + /// Gets the value of this change tick. + fn get(_self: Val) -> u32 { let output: u32 = bevy::ecs::component::Tick::get(_self.into_inner()).into(); output } + /// Returns `true` if this `Tick` occurred since the system's `last_run`. + /// `this_run` is the current tick of the system, used as a reference to help deal with wraparound. fn is_newer_than( _self: Val, last_run: Val, this_run: Val, - ) { + ) -> bool { let output: bool = bevy::ecs::component::Tick::is_newer_than( _self.into_inner(), last_run.into_inner(), @@ -174,14 +210,16 @@ impl bevy::ecs::component::Tick { .into(); output } - fn new(tick: u32) { + /// Creates a new [`Tick`] wrapping the given value. + fn new(tick: u32) -> Val { let output: Val = bevy::ecs::component::Tick::new( tick, ) .into(); output } - fn set(mut _self: Mut, tick: u32) { + /// Sets the value of this change tick. + fn set(mut _self: Mut, tick: u32) -> () { let output: () = bevy::ecs::component::Tick::set(&mut _self, tick).into(); output } @@ -192,18 +230,22 @@ impl bevy::ecs::component::Tick { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::ecs::component::ComponentTicks { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } + /// Returns `true` if the component or resource was added after the system last ran + /// (or the system is running for the first time). fn is_added( _self: Ref, last_run: Val, this_run: Val, - ) { + ) -> bool { let output: bool = bevy::ecs::component::ComponentTicks::is_added( &_self, last_run.into_inner(), @@ -212,11 +254,13 @@ impl bevy::ecs::component::ComponentTicks { .into(); output } + /// Returns `true` if the component or resource was added or mutably dereferenced after the system last ran + /// (or the system is running for the first time). fn is_changed( _self: Ref, last_run: Val, this_run: Val, - ) { + ) -> bool { let output: bool = bevy::ecs::component::ComponentTicks::is_changed( &_self, last_run.into_inner(), @@ -225,17 +269,31 @@ impl bevy::ecs::component::ComponentTicks { .into(); output } - fn new(change_tick: Val) { + /// Creates a new instance with the same change tick for `added` and `changed`. + fn new( + change_tick: Val, + ) -> Val { let output: Val = bevy::ecs::component::ComponentTicks::new( change_tick.into_inner(), ) .into(); output } + /// Manually sets the change tick. + /// This is normally done automatically via the [`DerefMut`](std::ops::DerefMut) implementation + /// on [`Mut`](crate::change_detection::Mut), [`ResMut`](crate::change_detection::ResMut), etc. + /// However, components and resources that make use of interior mutability might require manual updates. + /// # Example + /// ```no_run + /// # use bevy_ecs::{world::World, component::ComponentTicks}; + /// let world: World = unimplemented!(); + /// let component_ticks: ComponentTicks = unimplemented!(); + /// component_ticks.set_changed(world.read_change_tick()); + /// ``` fn set_changed( mut _self: Mut, change_tick: Val, - ) { + ) -> () { let output: () = bevy::ecs::component::ComponentTicks::set_changed( &mut _self, change_tick.into_inner(), @@ -250,7 +308,9 @@ impl bevy::ecs::component::ComponentTicks { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::ecs::identifier::Identifier { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -260,33 +320,40 @@ impl bevy::ecs::identifier::Identifier { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn from_bits(value: u64) { + /// Convert a `u64` into an [`Identifier`]. + /// # Panics + /// This method will likely panic if given `u64` values that did not come from [`Identifier::to_bits`]. + fn from_bits(value: u64) -> Val { let output: Val = bevy::ecs::identifier::Identifier::from_bits( value, ) .into(); output } - fn low(_self: Val) { + /// Returns the value of the low segment of the [`Identifier`]. + fn low(_self: Val) -> u32 { let output: u32 = bevy::ecs::identifier::Identifier::low(_self.into_inner()) .into(); output } - fn masked_high(_self: Val) { + /// Returns the masked value of the high segment of the [`Identifier`]. + /// Does not include the flag bits. + fn masked_high(_self: Val) -> u32 { let output: u32 = bevy::ecs::identifier::Identifier::masked_high( _self.into_inner(), ) .into(); output } - fn to_bits(_self: Val) { + /// Convert the [`Identifier`] into a `u64`. + fn to_bits(_self: Val) -> u64 { let output: u64 = bevy::ecs::identifier::Identifier::to_bits(_self.into_inner()) .into(); output @@ -298,7 +365,9 @@ impl bevy::ecs::identifier::Identifier { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::ecs::entity::EntityHash { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -312,7 +381,9 @@ impl bevy::ecs::entity::EntityHash { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::ecs::removal_detection::RemovedComponentEntity { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_hierarchy.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_hierarchy.rs index ca330db19a..2c730db0b1 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_hierarchy.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_hierarchy.rs @@ -18,11 +18,12 @@ pub struct BevyHierarchyScriptingPlugin; bms_core_path = "bevy_mod_scripting_core" )] impl bevy::hierarchy::prelude::Children { + /// Swaps the child at `a_index` with the child at `b_index`. fn swap( mut _self: Mut, a_index: usize, b_index: usize, - ) { + ) -> () { let output: () = bevy::hierarchy::prelude::Children::swap( &mut _self, a_index, @@ -38,7 +39,7 @@ impl bevy::hierarchy::prelude::Children { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::hierarchy::prelude::Parent { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) @@ -48,14 +49,17 @@ impl bevy::hierarchy::prelude::Parent { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn get(_self: Ref) { + /// Gets the [`Entity`] ID of the parent. + fn get( + _self: Ref, + ) -> Val { let output: Val = bevy::hierarchy::prelude::Parent::get( &_self, ) @@ -69,14 +73,16 @@ impl bevy::hierarchy::prelude::Parent { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::hierarchy::HierarchyEvent { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -86,7 +92,7 @@ impl bevy::hierarchy::HierarchyEvent { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_input.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_input.rs index 231964012b..ab06dabc55 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_input.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_input.rs @@ -18,15 +18,18 @@ pub struct BevyInputScriptingPlugin; bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::Gamepad { - fn dpad(_self: Ref) { + /// Returns the directional pad as a [`Vec2`] + fn dpad(_self: Ref) -> Val { let output: Val = bevy::input::gamepad::Gamepad::dpad(&_self) .into(); output } + /// Returns `true` if the [`GamepadButton`] has been pressed during the current frame. + /// Note: This function does not imply information regarding the current state of [`ButtonInput::pressed`] or [`ButtonInput::just_released`]. fn just_pressed( _self: Ref, button_type: Val, - ) { + ) -> bool { let output: bool = bevy::input::gamepad::Gamepad::just_pressed( &_self, button_type.into_inner(), @@ -34,10 +37,12 @@ impl bevy::input::gamepad::Gamepad { .into(); output } + /// Returns `true` if the [`GamepadButton`] has been released during the current frame. + /// Note: This function does not imply information regarding the current state of [`ButtonInput::pressed`] or [`ButtonInput::just_pressed`]. fn just_released( _self: Ref, button_type: Val, - ) { + ) -> bool { let output: bool = bevy::input::gamepad::Gamepad::just_released( &_self, button_type.into_inner(), @@ -45,17 +50,19 @@ impl bevy::input::gamepad::Gamepad { .into(); output } - fn left_stick(_self: Ref) { + /// Returns the left stick as a [`Vec2`] + fn left_stick(_self: Ref) -> Val { let output: Val = bevy::input::gamepad::Gamepad::left_stick( &_self, ) .into(); output } + /// Returns `true` if the [`GamepadButton`] has been pressed. fn pressed( _self: Ref, button_type: Val, - ) { + ) -> bool { let output: bool = bevy::input::gamepad::Gamepad::pressed( &_self, button_type.into_inner(), @@ -63,21 +70,27 @@ impl bevy::input::gamepad::Gamepad { .into(); output } - fn product_id(_self: Ref) { + /// Returns the USB product ID as assigned by the [vendor], if available. + /// [vendor]: Self::vendor_id + fn product_id( + _self: Ref, + ) -> std::option::Option { let output: std::option::Option = bevy::input::gamepad::Gamepad::product_id( &_self, ) .into(); output } - fn right_stick(_self: Ref) { + /// Returns the right stick as a [`Vec2`] + fn right_stick(_self: Ref) -> Val { let output: Val = bevy::input::gamepad::Gamepad::right_stick( &_self, ) .into(); output } - fn vendor_id(_self: Ref) { + /// Returns the USB vendor ID as assigned by the USB-IF, if available. + fn vendor_id(_self: Ref) -> std::option::Option { let output: std::option::Option = bevy::input::gamepad::Gamepad::vendor_id( &_self, ) @@ -91,14 +104,16 @@ impl bevy::input::gamepad::Gamepad { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::GamepadAxis { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -108,7 +123,7 @@ impl bevy::input::gamepad::GamepadAxis { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -122,14 +137,18 @@ impl bevy::input::gamepad::GamepadAxis { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::GamepadButton { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq( + _self: Ref, + ) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -139,7 +158,7 @@ impl bevy::input::gamepad::GamepadButton { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -153,7 +172,9 @@ impl bevy::input::gamepad::GamepadButton { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::GamepadSettings { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -167,14 +188,16 @@ impl bevy::input::gamepad::GamepadSettings { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::keyboard::KeyCode { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -184,7 +207,7 @@ impl bevy::input::keyboard::KeyCode { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -198,14 +221,16 @@ impl bevy::input::keyboard::KeyCode { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::mouse::MouseButton { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -215,7 +240,7 @@ impl bevy::input::mouse::MouseButton { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -229,7 +254,9 @@ impl bevy::input::mouse::MouseButton { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::touch::TouchInput { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -239,7 +266,7 @@ impl bevy::input::touch::TouchInput { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -255,14 +282,16 @@ impl bevy::input::touch::TouchInput { impl bevy::input::keyboard::KeyboardFocusLost { fn assert_receiver_is_total_eq( _self: Ref, - ) { + ) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -272,7 +301,7 @@ impl bevy::input::keyboard::KeyboardFocusLost { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -286,14 +315,18 @@ impl bevy::input::keyboard::KeyboardFocusLost { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::keyboard::KeyboardInput { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq( + _self: Ref, + ) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -303,7 +336,7 @@ impl bevy::input::keyboard::KeyboardInput { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -317,7 +350,9 @@ impl bevy::input::keyboard::KeyboardInput { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::mouse::AccumulatedMouseMotion { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -327,7 +362,7 @@ impl bevy::input::mouse::AccumulatedMouseMotion { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -341,7 +376,9 @@ impl bevy::input::mouse::AccumulatedMouseMotion { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::mouse::AccumulatedMouseScroll { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -351,7 +388,7 @@ impl bevy::input::mouse::AccumulatedMouseScroll { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -365,14 +402,18 @@ impl bevy::input::mouse::AccumulatedMouseScroll { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::mouse::MouseButtonInput { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq( + _self: Ref, + ) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -382,7 +423,7 @@ impl bevy::input::mouse::MouseButtonInput { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -396,7 +437,9 @@ impl bevy::input::mouse::MouseButtonInput { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::mouse::MouseMotion { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -406,7 +449,7 @@ impl bevy::input::mouse::MouseMotion { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -420,7 +463,9 @@ impl bevy::input::mouse::MouseMotion { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::mouse::MouseWheel { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -430,7 +475,7 @@ impl bevy::input::mouse::MouseWheel { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -444,7 +489,9 @@ impl bevy::input::mouse::MouseWheel { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::GamepadAxisChangedEvent { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -454,18 +501,19 @@ impl bevy::input::gamepad::GamepadAxisChangedEvent { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } + /// Creates a new [`GamepadAxisChangedEvent`] fn new( entity: Val, axis: Val, value: f32, - ) { + ) -> Val { let output: Val = bevy::input::gamepad::GamepadAxisChangedEvent::new( entity.into_inner(), axis.into_inner(), @@ -481,7 +529,9 @@ impl bevy::input::gamepad::GamepadAxisChangedEvent { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::GamepadButtonChangedEvent { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -491,19 +541,20 @@ impl bevy::input::gamepad::GamepadButtonChangedEvent { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } + /// Creates a new [`GamepadButtonChangedEvent`] fn new( entity: Val, button: Val, state: Val, value: f32, - ) { + ) -> Val { let output: Val = bevy::input::gamepad::GamepadButtonChangedEvent::new( entity.into_inner(), button.into_inner(), @@ -522,14 +573,16 @@ impl bevy::input::gamepad::GamepadButtonChangedEvent { impl bevy::input::gamepad::GamepadButtonStateChangedEvent { fn assert_receiver_is_total_eq( _self: Ref, - ) { + ) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -539,18 +592,19 @@ impl bevy::input::gamepad::GamepadButtonStateChangedEvent { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } + /// Creates a new [`GamepadButtonStateChangedEvent`] fn new( entity: Val, button: Val, state: Val, - ) { + ) -> Val { let output: Val = bevy::input::gamepad::GamepadButtonStateChangedEvent::new( entity.into_inner(), button.into_inner(), @@ -566,7 +620,9 @@ impl bevy::input::gamepad::GamepadButtonStateChangedEvent { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::GamepadConnection { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -576,7 +632,7 @@ impl bevy::input::gamepad::GamepadConnection { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -590,21 +646,25 @@ impl bevy::input::gamepad::GamepadConnection { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::GamepadConnectionEvent { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn connected(_self: Ref) { + /// Is the gamepad connected? + fn connected(_self: Ref) -> bool { let output: bool = bevy::input::gamepad::GamepadConnectionEvent::connected( &_self, ) .into(); output } - fn disconnected(_self: Ref) { + /// Is the gamepad disconnected? + fn disconnected(_self: Ref) -> bool { let output: bool = bevy::input::gamepad::GamepadConnectionEvent::disconnected( &_self, ) @@ -614,17 +674,18 @@ impl bevy::input::gamepad::GamepadConnectionEvent { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } + /// Creates a [`GamepadConnectionEvent`]. fn new( gamepad: Val, connection: Val, - ) { + ) -> Val { let output: Val = bevy::input::gamepad::GamepadConnectionEvent::new( gamepad.into_inner(), connection.into_inner(), @@ -639,7 +700,9 @@ impl bevy::input::gamepad::GamepadConnectionEvent { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::GamepadEvent { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -649,7 +712,7 @@ impl bevy::input::gamepad::GamepadEvent { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -663,14 +726,18 @@ impl bevy::input::gamepad::GamepadEvent { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::GamepadInput { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq( + _self: Ref, + ) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -680,7 +747,7 @@ impl bevy::input::gamepad::GamepadInput { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -694,14 +761,19 @@ impl bevy::input::gamepad::GamepadInput { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::GamepadRumbleRequest { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn gamepad(_self: Ref) { + /// Get the [`Entity`] associated with this request. + fn gamepad( + _self: Ref, + ) -> Val { let output: Val = bevy::input::gamepad::GamepadRumbleRequest::gamepad( &_self, ) @@ -715,7 +787,9 @@ impl bevy::input::gamepad::GamepadRumbleRequest { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::RawGamepadAxisChangedEvent { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -725,18 +799,19 @@ impl bevy::input::gamepad::RawGamepadAxisChangedEvent { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } + /// Creates a [`RawGamepadAxisChangedEvent`]. fn new( gamepad: Val, axis_type: Val, value: f32, - ) { + ) -> Val { let output: Val = bevy::input::gamepad::RawGamepadAxisChangedEvent::new( gamepad.into_inner(), axis_type.into_inner(), @@ -752,7 +827,9 @@ impl bevy::input::gamepad::RawGamepadAxisChangedEvent { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::RawGamepadButtonChangedEvent { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -762,18 +839,19 @@ impl bevy::input::gamepad::RawGamepadButtonChangedEvent { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } + /// Creates a [`RawGamepadButtonChangedEvent`]. fn new( gamepad: Val, button_type: Val, value: f32, - ) { + ) -> Val { let output: Val = bevy::input::gamepad::RawGamepadButtonChangedEvent::new( gamepad.into_inner(), button_type.into_inner(), @@ -789,7 +867,9 @@ impl bevy::input::gamepad::RawGamepadButtonChangedEvent { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::RawGamepadEvent { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -799,7 +879,7 @@ impl bevy::input::gamepad::RawGamepadEvent { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -813,7 +893,9 @@ impl bevy::input::gamepad::RawGamepadEvent { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gestures::PinchGesture { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -823,7 +905,7 @@ impl bevy::input::gestures::PinchGesture { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -837,7 +919,9 @@ impl bevy::input::gestures::PinchGesture { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gestures::RotationGesture { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -847,7 +931,7 @@ impl bevy::input::gestures::RotationGesture { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -861,7 +945,9 @@ impl bevy::input::gestures::RotationGesture { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gestures::DoubleTapGesture { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -871,7 +957,7 @@ impl bevy::input::gestures::DoubleTapGesture { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -885,7 +971,9 @@ impl bevy::input::gestures::DoubleTapGesture { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gestures::PanGesture { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -895,7 +983,7 @@ impl bevy::input::gestures::PanGesture { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -909,28 +997,32 @@ impl bevy::input::gestures::PanGesture { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::ButtonState { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq( + _self: Ref, + other: Ref, + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn is_pressed(_self: Ref) { + /// Is this button pressed? + fn is_pressed(_self: Ref) -> bool { let output: bool = bevy::input::ButtonState::is_pressed(&_self).into(); output } @@ -941,7 +1033,9 @@ impl bevy::input::ButtonState { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::ButtonSettings { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -951,14 +1045,16 @@ impl bevy::input::gamepad::ButtonSettings { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn is_pressed(_self: Ref, value: f32) { + /// Returns `true` if the button is pressed. + /// A button is considered pressed if the `value` passed is greater than or equal to the press threshold. + fn is_pressed(_self: Ref, value: f32) -> bool { let output: bool = bevy::input::gamepad::ButtonSettings::is_pressed( &_self, value, @@ -966,7 +1062,12 @@ impl bevy::input::gamepad::ButtonSettings { .into(); output } - fn is_released(_self: Ref, value: f32) { + /// Returns `true` if the button is released. + /// A button is considered released if the `value` passed is lower than or equal to the release threshold. + fn is_released( + _self: Ref, + value: f32, + ) -> bool { let output: bool = bevy::input::gamepad::ButtonSettings::is_released( &_self, value, @@ -974,20 +1075,25 @@ impl bevy::input::gamepad::ButtonSettings { .into(); output } - fn press_threshold(_self: Ref) { + /// Get the button input threshold above which the button is considered pressed. + fn press_threshold(_self: Ref) -> f32 { let output: f32 = bevy::input::gamepad::ButtonSettings::press_threshold(&_self) .into(); output } - fn release_threshold(_self: Ref) { + /// Get the button input threshold below which the button is considered released. + fn release_threshold(_self: Ref) -> f32 { let output: f32 = bevy::input::gamepad::ButtonSettings::release_threshold(&_self) .into(); output } + /// Try to set the button input threshold above which the button is considered pressed. + /// If the value passed is outside the range [release threshold..=1.0], the value will not be changed. + /// Returns the new value of the press threshold. fn set_press_threshold( mut _self: Mut, value: f32, - ) { + ) -> f32 { let output: f32 = bevy::input::gamepad::ButtonSettings::set_press_threshold( &mut _self, value, @@ -995,10 +1101,13 @@ impl bevy::input::gamepad::ButtonSettings { .into(); output } + /// Try to set the button input threshold below which the button is considered released. If the + /// value passed is outside the range [0.0..=press threshold], the value will not be changed. + /// Returns the new value of the release threshold. fn set_release_threshold( mut _self: Mut, value: f32, - ) { + ) -> f32 { let output: f32 = bevy::input::gamepad::ButtonSettings::set_release_threshold( &mut _self, value, @@ -1013,24 +1122,29 @@ impl bevy::input::gamepad::ButtonSettings { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::AxisSettings { - fn clamp(_self: Ref, new_value: f32) { + /// Clamps the `raw_value` according to the `AxisSettings`. + fn clamp(_self: Ref, new_value: f32) -> f32 { let output: f32 = bevy::input::gamepad::AxisSettings::clamp(&_self, new_value) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn deadzone_lowerbound(_self: Ref) { + /// Get the value above which inputs will be rounded up to 0.0. + fn deadzone_lowerbound(_self: Ref) -> f32 { let output: f32 = bevy::input::gamepad::AxisSettings::deadzone_lowerbound(&_self) .into(); output } - fn deadzone_upperbound(_self: Ref) { + /// Get the value below which positive inputs will be rounded down to 0.0. + fn deadzone_upperbound(_self: Ref) -> f32 { let output: f32 = bevy::input::gamepad::AxisSettings::deadzone_upperbound(&_self) .into(); output @@ -1038,18 +1152,21 @@ impl bevy::input::gamepad::AxisSettings { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } + /// Filters the `new_value` based on the `old_value`, according to the [`AxisSettings`]. + /// Returns the clamped `new_value` if the change exceeds the settings threshold, + /// and `None` otherwise. fn filter( _self: Ref, new_value: f32, old_value: std::option::Option, - ) { + ) -> std::option::Option { let output: std::option::Option = bevy::input::gamepad::AxisSettings::filter( &_self, new_value, @@ -1058,20 +1175,26 @@ impl bevy::input::gamepad::AxisSettings { .into(); output } - fn livezone_lowerbound(_self: Ref) { + /// Get the value below which negative inputs will be rounded down to -1.0. + fn livezone_lowerbound(_self: Ref) -> f32 { let output: f32 = bevy::input::gamepad::AxisSettings::livezone_lowerbound(&_self) .into(); output } - fn livezone_upperbound(_self: Ref) { + /// Get the value above which inputs will be rounded up to 1.0. + fn livezone_upperbound(_self: Ref) -> f32 { let output: f32 = bevy::input::gamepad::AxisSettings::livezone_upperbound(&_self) .into(); output } + /// Try to set the value above which inputs will be rounded up to 0.0. + /// If the value passed is less than -1.0 or less than `livezone_lowerbound`, + /// the value will not be changed. + /// Returns the new value of `deadzone_lowerbound`. fn set_deadzone_lowerbound( mut _self: Mut, value: f32, - ) { + ) -> f32 { let output: f32 = bevy::input::gamepad::AxisSettings::set_deadzone_lowerbound( &mut _self, value, @@ -1079,10 +1202,14 @@ impl bevy::input::gamepad::AxisSettings { .into(); output } + /// Try to set the value below which positive inputs will be rounded down to 0.0. + /// If the value passed is negative or greater than `livezone_upperbound`, + /// the value will not be changed. + /// Returns the new value of `deadzone_upperbound`. fn set_deadzone_upperbound( mut _self: Mut, value: f32, - ) { + ) -> f32 { let output: f32 = bevy::input::gamepad::AxisSettings::set_deadzone_upperbound( &mut _self, value, @@ -1090,10 +1217,14 @@ impl bevy::input::gamepad::AxisSettings { .into(); output } + /// Try to set the value below which negative inputs will be rounded down to -1.0. + /// If the value passed is positive or greater than `deadzone_lowerbound`, + /// the value will not be changed. + /// Returns the new value of `livezone_lowerbound`. fn set_livezone_lowerbound( mut _self: Mut, value: f32, - ) { + ) -> f32 { let output: f32 = bevy::input::gamepad::AxisSettings::set_livezone_lowerbound( &mut _self, value, @@ -1101,10 +1232,14 @@ impl bevy::input::gamepad::AxisSettings { .into(); output } + /// Try to set the value above which inputs will be rounded up to 1.0. + /// If the value passed is negative or less than `deadzone_upperbound`, + /// the value will not be changed. + /// Returns the new value of `livezone_upperbound`. fn set_livezone_upperbound( mut _self: Mut, value: f32, - ) { + ) -> f32 { let output: f32 = bevy::input::gamepad::AxisSettings::set_livezone_upperbound( &mut _self, value, @@ -1112,7 +1247,13 @@ impl bevy::input::gamepad::AxisSettings { .into(); output } - fn set_threshold(mut _self: Mut, value: f32) { + /// Try to set the minimum value by which input must change before the changes will be applied. + /// If the value passed is not within [0.0..=2.0], the value will not be changed. + /// Returns the new value of threshold. + fn set_threshold( + mut _self: Mut, + value: f32, + ) -> f32 { let output: f32 = bevy::input::gamepad::AxisSettings::set_threshold( &mut _self, value, @@ -1120,7 +1261,8 @@ impl bevy::input::gamepad::AxisSettings { .into(); output } - fn threshold(_self: Ref) { + /// Get the minimum value by which input must change before the change is registered. + fn threshold(_self: Ref) -> f32 { let output: f32 = bevy::input::gamepad::AxisSettings::threshold(&_self).into(); output } @@ -1131,18 +1273,23 @@ impl bevy::input::gamepad::AxisSettings { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::ButtonAxisSettings { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } + /// Filters the `new_value` based on the `old_value`, according to the [`ButtonAxisSettings`]. + /// Returns the clamped `new_value`, according to the [`ButtonAxisSettings`], if the change + /// exceeds the settings threshold, and `None` otherwise. fn filter( _self: Ref, new_value: f32, old_value: std::option::Option, - ) { + ) -> std::option::Option { let output: std::option::Option = bevy::input::gamepad::ButtonAxisSettings::filter( &_self, new_value, @@ -1158,7 +1305,9 @@ impl bevy::input::gamepad::ButtonAxisSettings { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::gamepad::GamepadRumbleIntensity { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -1168,21 +1317,27 @@ impl bevy::input::gamepad::GamepadRumbleIntensity { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn strong_motor(intensity: f32) { + /// Creates a new rumble intensity with strong motor intensity set to the given value. + /// Clamped within the `0.0` to `1.0` range. + fn strong_motor( + intensity: f32, + ) -> Val { let output: Val = bevy::input::gamepad::GamepadRumbleIntensity::strong_motor( intensity, ) .into(); output } - fn weak_motor(intensity: f32) { + /// Creates a new rumble intensity with weak motor intensity set to the given value. + /// Clamped within the `0.0` to `1.0` range. + fn weak_motor(intensity: f32) -> Val { let output: Val = bevy::input::gamepad::GamepadRumbleIntensity::weak_motor( intensity, ) @@ -1196,14 +1351,14 @@ impl bevy::input::gamepad::GamepadRumbleIntensity { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::keyboard::Key { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) @@ -1213,7 +1368,7 @@ impl bevy::input::keyboard::Key { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -1227,14 +1382,18 @@ impl bevy::input::keyboard::Key { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::keyboard::NativeKeyCode { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq( + _self: Ref, + ) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -1244,7 +1403,7 @@ impl bevy::input::keyboard::NativeKeyCode { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -1258,14 +1417,16 @@ impl bevy::input::keyboard::NativeKeyCode { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::keyboard::NativeKey { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -1275,7 +1436,7 @@ impl bevy::input::keyboard::NativeKey { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -1289,14 +1450,18 @@ impl bevy::input::keyboard::NativeKey { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::mouse::MouseScrollUnit { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq( + _self: Ref, + ) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -1306,7 +1471,7 @@ impl bevy::input::mouse::MouseScrollUnit { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -1320,14 +1485,16 @@ impl bevy::input::mouse::MouseScrollUnit { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::touch::TouchPhase { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -1337,7 +1504,7 @@ impl bevy::input::touch::TouchPhase { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -1351,7 +1518,9 @@ impl bevy::input::touch::TouchPhase { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::input::touch::ForceTouch { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -1361,7 +1530,7 @@ impl bevy::input::touch::ForceTouch { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_math.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_math.rs index 4a2a76eac5..c9a4eb3108 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_math.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_math.rs @@ -18,40 +18,48 @@ pub struct BevyMathScriptingPlugin; bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::AspectRatio { - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq( + _self: Ref, + other: Ref, + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn inverse(_self: Ref) { + /// Returns the inverse of this aspect ratio (height/width). + fn inverse(_self: Ref) -> Val { let output: Val = bevy::math::AspectRatio::inverse( &_self, ) .into(); output } - fn is_landscape(_self: Ref) { + /// Returns true if the aspect ratio represents a landscape orientation. + fn is_landscape(_self: Ref) -> bool { let output: bool = bevy::math::AspectRatio::is_landscape(&_self).into(); output } - fn is_portrait(_self: Ref) { + /// Returns true if the aspect ratio represents a portrait orientation. + fn is_portrait(_self: Ref) -> bool { let output: bool = bevy::math::AspectRatio::is_portrait(&_self).into(); output } - fn is_square(_self: Ref) { + /// Returns true if the aspect ratio is exactly square. + fn is_square(_self: Ref) -> bool { let output: bool = bevy::math::AspectRatio::is_square(&_self).into(); output } - fn ratio(_self: Ref) { + /// Returns the aspect ratio as a f32 value. + fn ratio(_self: Ref) -> f32 { let output: f32 = bevy::math::AspectRatio::ratio(&_self).into(); output } @@ -62,21 +70,24 @@ impl bevy::math::AspectRatio { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::CompassOctant { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq( + _self: Ref, + other: Ref, + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -90,14 +101,16 @@ impl bevy::math::CompassOctant { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::CompassQuadrant { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -107,7 +120,7 @@ impl bevy::math::CompassQuadrant { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -121,48 +134,60 @@ impl bevy::math::CompassQuadrant { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::Isometry2d { - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq( + _self: Ref, + other: Ref, + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn from_rotation(rotation: Val) { + /// Create a two-dimensional isometry from a rotation. + fn from_rotation(rotation: Val) -> Val { let output: Val = bevy::math::Isometry2d::from_rotation( rotation.into_inner(), ) .into(); output } - fn from_translation(translation: Val) { + /// Create a two-dimensional isometry from a translation. + fn from_translation( + translation: Val, + ) -> Val { let output: Val = bevy::math::Isometry2d::from_translation( translation.into_inner(), ) .into(); output } - fn from_xy(x: f32, y: f32) { + /// Create a two-dimensional isometry from a translation with the given `x` and `y` components. + fn from_xy(x: f32, y: f32) -> Val { let output: Val = bevy::math::Isometry2d::from_xy(x, y) .into(); output } - fn inverse(_self: Ref) { + /// The inverse isometry that undoes this one. + fn inverse(_self: Ref) -> Val { let output: Val = bevy::math::Isometry2d::inverse(&_self) .into(); output } + /// Compute `iso1.inverse() * iso2` in a more efficient way for one-shot cases. + /// If the same isometry is used multiple times, it is more efficient to instead compute + /// the inverse once and use that for each transformation. fn inverse_mul( _self: Ref, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::Isometry2d::inverse_mul( &_self, rhs.into_inner(), @@ -170,10 +195,14 @@ impl bevy::math::Isometry2d { .into(); output } + /// Transform a point by rotating and translating it using the inverse of this isometry. + /// This is more efficient than `iso.inverse().transform_point(point)` for one-shot cases. + /// If the same isometry is used multiple times, it is more efficient to instead compute + /// the inverse once and use that for each transformation. fn inverse_transform_point( _self: Ref, point: Val, - ) { + ) -> Val { let output: Val = bevy::math::Isometry2d::inverse_transform_point( &_self, point.into_inner(), @@ -181,31 +210,41 @@ impl bevy::math::Isometry2d { .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } + /// Create a two-dimensional isometry from a rotation and a translation. fn new( translation: Val, rotation: Val, - ) { + ) -> Val { let output: Val = bevy::math::Isometry2d::new( translation.into_inner(), rotation.into_inner(), @@ -213,10 +252,11 @@ impl bevy::math::Isometry2d { .into(); output } + /// Transform a point by rotating and translating it using this isometry. fn transform_point( _self: Ref, point: Val, - ) { + ) -> Val { let output: Val = bevy::math::Isometry2d::transform_point( &_self, point.into_inner(), @@ -231,28 +271,35 @@ impl bevy::math::Isometry2d { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::Isometry3d { - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq( + _self: Ref, + other: Ref, + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn from_rotation(rotation: Val) { + /// Create a three-dimensional isometry from a rotation. + fn from_rotation( + rotation: Val, + ) -> Val { let output: Val = bevy::math::Isometry3d::from_rotation( rotation.into_inner(), ) .into(); output } - fn from_xyz(x: f32, y: f32, z: f32) { + /// Create a three-dimensional isometry from a translation with the given `x`, `y`, and `z` components. + fn from_xyz(x: f32, y: f32, z: f32) -> Val { let output: Val = bevy::math::Isometry3d::from_xyz( x, y, @@ -261,15 +308,19 @@ impl bevy::math::Isometry3d { .into(); output } - fn inverse(_self: Ref) { + /// The inverse isometry that undoes this one. + fn inverse(_self: Ref) -> Val { let output: Val = bevy::math::Isometry3d::inverse(&_self) .into(); output } + /// Compute `iso1.inverse() * iso2` in a more efficient way for one-shot cases. + /// If the same isometry is used multiple times, it is more efficient to instead compute + /// the inverse once and use that for each transformation. fn inverse_mul( _self: Ref, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::Isometry3d::inverse_mul( &_self, rhs.into_inner(), @@ -277,28 +328,40 @@ impl bevy::math::Isometry3d { .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) @@ -312,21 +375,25 @@ impl bevy::math::Isometry3d { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::Ray2d { - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn get_point(_self: Ref, distance: f32) { + /// Get a point at a given distance along the ray + fn get_point( + _self: Ref, + distance: f32, + ) -> Val { let output: Val = bevy::math::Ray2d::get_point( &_self, distance, @@ -334,11 +401,12 @@ impl bevy::math::Ray2d { .into(); output } + /// Get the distance to a plane if the ray intersects it fn intersect_plane( _self: Ref, plane_origin: Val, plane: Val, - ) { + ) -> std::option::Option { let output: std::option::Option = bevy::math::Ray2d::intersect_plane( &_self, plane_origin.into_inner(), @@ -347,10 +415,11 @@ impl bevy::math::Ray2d { .into(); output } + /// Create a new `Ray2d` from a given origin and direction fn new( origin: Val, direction: Val, - ) { + ) -> Val { let output: Val = bevy::math::Ray2d::new( origin.into_inner(), direction.into_inner(), @@ -365,21 +434,25 @@ impl bevy::math::Ray2d { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::Ray3d { - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn get_point(_self: Ref, distance: f32) { + /// Get a point at a given distance along the ray + fn get_point( + _self: Ref, + distance: f32, + ) -> Val { let output: Val = bevy::math::Ray3d::get_point( &_self, distance, @@ -387,11 +460,12 @@ impl bevy::math::Ray3d { .into(); output } + /// Get the distance to a plane if the ray intersects it fn intersect_plane( _self: Ref, plane_origin: Val, plane: Val, - ) { + ) -> std::option::Option { let output: std::option::Option = bevy::math::Ray3d::intersect_plane( &_self, plane_origin.into_inner(), @@ -400,10 +474,11 @@ impl bevy::math::Ray3d { .into(); output } + /// Create a new `Ray3d` from a given origin and direction fn new( origin: Val, direction: Val, - ) { + ) -> Val { let output: Val = bevy::math::Ray3d::new( origin.into_inner(), direction.into_inner(), @@ -418,7 +493,8 @@ impl bevy::math::Ray3d { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::Rot2 { - fn angle_between(_self: Val, other: Val) { + /// Returns the angle in radians needed to make `self` and `other` coincide. + fn angle_between(_self: Val, other: Val) -> f32 { let output: f32 = bevy::math::Rot2::angle_between( _self.into_inner(), other.into_inner(), @@ -426,7 +502,8 @@ impl bevy::math::Rot2 { .into(); output } - fn angle_to(_self: Val, other: Val) { + /// Returns the angle in radians needed to make `self` and `other` coincide. + fn angle_to(_self: Val, other: Val) -> f32 { let output: f32 = bevy::math::Rot2::angle_to( _self.into_inner(), other.into_inner(), @@ -434,103 +511,187 @@ impl bevy::math::Rot2 { .into(); output } - fn as_degrees(_self: Val) { + /// Returns the rotation in degrees in the `(-180, 180]` range. + fn as_degrees(_self: Val) -> f32 { let output: f32 = bevy::math::Rot2::as_degrees(_self.into_inner()).into(); output } - fn as_radians(_self: Val) { + /// Returns the rotation in radians in the `(-pi, pi]` range. + fn as_radians(_self: Val) -> f32 { let output: f32 = bevy::math::Rot2::as_radians(_self.into_inner()).into(); output } - fn as_turn_fraction(_self: Val) { + /// Returns the rotation as a fraction of a full 360 degree turn. + fn as_turn_fraction(_self: Val) -> f32 { let output: f32 = bevy::math::Rot2::as_turn_fraction(_self.into_inner()).into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn degrees(degrees: f32) { + /// Creates a [`Rot2`] from a counterclockwise angle in degrees. + /// # Note + /// The input rotation will always be clamped to the range `(-180°, 180°]` by design. + /// # Example + /// ``` + /// # use bevy_math::Rot2; + /// # use approx::assert_relative_eq; + /// let rot1 = Rot2::degrees(270.0); + /// let rot2 = Rot2::degrees(-90.0); + /// assert_relative_eq!(rot1, rot2); + /// let rot3 = Rot2::degrees(180.0); + /// assert_relative_eq!(rot1 * rot1, rot3); + /// ``` + fn degrees(degrees: f32) -> Val { let output: Val = bevy::math::Rot2::degrees(degrees).into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn fast_renormalize(_self: Val) { + /// Returns `self` after an approximate normalization, assuming the value is already nearly normalized. + /// Useful for preventing numerical error accumulation. + /// See [`Dir3::fast_renormalize`](crate::Dir3::fast_renormalize) for an example of when such error accumulation might occur. + fn fast_renormalize(_self: Val) -> Val { let output: Val = bevy::math::Rot2::fast_renormalize( _self.into_inner(), ) .into(); output } - fn from_sin_cos(sin: f32, cos: f32) { + /// Creates a [`Rot2`] from the sine and cosine of an angle in radians. + /// The rotation is only valid if `sin * sin + cos * cos == 1.0`. + /// # Panics + /// Panics if `sin * sin + cos * cos != 1.0` when the `glam_assert` feature is enabled. + fn from_sin_cos(sin: f32, cos: f32) -> Val { let output: Val = bevy::math::Rot2::from_sin_cos(sin, cos) .into(); output } - fn inverse(_self: Val) { + /// Returns the inverse of the rotation. This is also the conjugate + /// of the unit complex number representing the rotation. + fn inverse(_self: Val) -> Val { let output: Val = bevy::math::Rot2::inverse(_self.into_inner()) .into(); output } - fn is_finite(_self: Val) { + /// Returns `true` if the rotation is neither infinite nor NaN. + fn is_finite(_self: Val) -> bool { let output: bool = bevy::math::Rot2::is_finite(_self.into_inner()).into(); output } - fn is_nan(_self: Val) { + /// Returns `true` if the rotation is NaN. + fn is_nan(_self: Val) -> bool { let output: bool = bevy::math::Rot2::is_nan(_self.into_inner()).into(); output } - fn is_near_identity(_self: Val) { + /// Returns `true` if the rotation is near [`Rot2::IDENTITY`]. + fn is_near_identity(_self: Val) -> bool { let output: bool = bevy::math::Rot2::is_near_identity(_self.into_inner()).into(); output } - fn is_normalized(_self: Val) { + /// Returns whether `self` has a length of `1.0` or not. + /// Uses a precision threshold of approximately `1e-4`. + fn is_normalized(_self: Val) -> bool { let output: bool = bevy::math::Rot2::is_normalized(_self.into_inner()).into(); output } - fn length(_self: Val) { + /// Computes the length or norm of the complex number used to represent the rotation. + /// The length is typically expected to be `1.0`. Unexpectedly denormalized rotations + /// can be a result of incorrect construction or floating point error caused by + /// successive operations. + fn length(_self: Val) -> f32 { let output: f32 = bevy::math::Rot2::length(_self.into_inner()).into(); output } - fn length_recip(_self: Val) { + /// Computes `1.0 / self.length()`. + /// For valid results, `self` must _not_ have a length of zero. + fn length_recip(_self: Val) -> f32 { let output: f32 = bevy::math::Rot2::length_recip(_self.into_inner()).into(); output } - fn length_squared(_self: Val) { + /// Computes the squared length or norm of the complex number used to represent the rotation. + /// This is generally faster than [`Rot2::length()`], as it avoids a square + /// root operation. + /// The length is typically expected to be `1.0`. Unexpectedly denormalized rotations + /// can be a result of incorrect construction or floating point error caused by + /// successive operations. + fn length_squared(_self: Val) -> f32 { let output: f32 = bevy::math::Rot2::length_squared(_self.into_inner()).into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, direction: Val) { + /// Rotates the [`Dir2`] using a [`Rot2`]. + fn mul( + _self: Val, + direction: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), direction.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + /// Rotates a [`Vec2`] by a [`Rot2`]. + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn nlerp(_self: Val, end: Val, s: f32) { + /// Performs a linear interpolation between `self` and `rhs` based on + /// the value `s`, and normalizes the rotation afterwards. + /// When `s == 0.0`, the result will be equal to `self`. + /// When `s == 1.0`, the result will be equal to `rhs`. + /// This is slightly more efficient than [`slerp`](Self::slerp), and produces a similar result + /// when the difference between the two rotations is small. At larger differences, + /// the result resembles a kind of ease-in-out effect. + /// If you would like the angular velocity to remain constant, consider using [`slerp`](Self::slerp) instead. + /// # Details + /// `nlerp` corresponds to computing an angle for a point at position `s` on a line drawn + /// between the endpoints of the arc formed by `self` and `rhs` on a unit circle, + /// and normalizing the result afterwards. + /// Note that if the angles are opposite like 0 and π, the line will pass through the origin, + /// and the resulting angle will always be either `self` or `rhs` depending on `s`. + /// If `s` happens to be `0.5` in this case, a valid rotation cannot be computed, and `self` + /// will be returned as a fallback. + /// # Example + /// ``` + /// # use bevy_math::Rot2; + /// # + /// let rot1 = Rot2::IDENTITY; + /// let rot2 = Rot2::degrees(135.0); + /// let result1 = rot1.nlerp(rot2, 1.0 / 3.0); + /// assert_eq!(result1.as_degrees(), 28.675055); + /// let result2 = rot1.nlerp(rot2, 0.5); + /// assert_eq!(result2.as_degrees(), 67.5); + /// ``` + fn nlerp( + _self: Val, + end: Val, + s: f32, + ) -> Val { let output: Val = bevy::math::Rot2::nlerp( _self.into_inner(), end.into_inner(), @@ -539,22 +700,66 @@ impl bevy::math::Rot2 { .into(); output } - fn normalize(_self: Val) { + /// Returns `self` with a length of `1.0`. + /// Note that [`Rot2`] should typically already be normalized by design. + /// Manual normalization is only needed when successive operations result in + /// accumulated floating point error, or if the rotation was constructed + /// with invalid values. + /// # Panics + /// Panics if `self` has a length of zero, NaN, or infinity when debug assertions are enabled. + fn normalize(_self: Val) -> Val { let output: Val = bevy::math::Rot2::normalize( _self.into_inner(), ) .into(); output } - fn radians(radians: f32) { + /// Creates a [`Rot2`] from a counterclockwise angle in radians. + /// # Note + /// The input rotation will always be clamped to the range `(-π, π]` by design. + /// # Example + /// ``` + /// # use bevy_math::Rot2; + /// # use approx::assert_relative_eq; + /// # use std::f32::consts::{FRAC_PI_2, PI}; + /// let rot1 = Rot2::radians(3.0 * FRAC_PI_2); + /// let rot2 = Rot2::radians(-FRAC_PI_2); + /// assert_relative_eq!(rot1, rot2); + /// let rot3 = Rot2::radians(PI); + /// assert_relative_eq!(rot1 * rot1, rot3); + /// ``` + fn radians(radians: f32) -> Val { let output: Val = bevy::math::Rot2::radians(radians).into(); output } - fn sin_cos(_self: Val) { + /// Returns the sine and cosine of the rotation angle in radians. + fn sin_cos(_self: Val) -> (f32, f32) { let output: (f32, f32) = bevy::math::Rot2::sin_cos(_self.into_inner()).into(); output } - fn slerp(_self: Val, end: Val, s: f32) { + /// Performs a spherical linear interpolation between `self` and `end` + /// based on the value `s`. + /// This corresponds to interpolating between the two angles at a constant angular velocity. + /// When `s == 0.0`, the result will be equal to `self`. + /// When `s == 1.0`, the result will be equal to `rhs`. + /// If you would like the rotation to have a kind of ease-in-out effect, consider + /// using the slightly more efficient [`nlerp`](Self::nlerp) instead. + /// # Example + /// ``` + /// # use bevy_math::Rot2; + /// # + /// let rot1 = Rot2::IDENTITY; + /// let rot2 = Rot2::degrees(135.0); + /// let result1 = rot1.slerp(rot2, 1.0 / 3.0); + /// assert_eq!(result1.as_degrees(), 45.0); + /// let result2 = rot1.slerp(rot2, 0.5); + /// assert_eq!(result2.as_degrees(), 67.5); + /// ``` + fn slerp( + _self: Val, + end: Val, + s: f32, + ) -> Val { let output: Val = bevy::math::Rot2::slerp( _self.into_inner(), end.into_inner(), @@ -563,7 +768,20 @@ impl bevy::math::Rot2 { .into(); output } - fn turn_fraction(fraction: f32) { + /// Creates a [`Rot2`] from a counterclockwise fraction of a full turn of 360 degrees. + /// # Note + /// The input rotation will always be clamped to the range `(-50%, 50%]` by design. + /// # Example + /// ``` + /// # use bevy_math::Rot2; + /// # use approx::assert_relative_eq; + /// let rot1 = Rot2::turn_fraction(0.75); + /// let rot2 = Rot2::turn_fraction(-0.25); + /// assert_relative_eq!(rot1, rot2); + /// let rot3 = Rot2::turn_fraction(0.5); + /// assert_relative_eq!(rot1 * rot1, rot3); + /// ``` + fn turn_fraction(fraction: f32) -> Val { let output: Val = bevy::math::Rot2::turn_fraction(fraction) .into(); output @@ -575,35 +793,47 @@ impl bevy::math::Rot2 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::prelude::Dir2 { - fn as_vec2(_self: Ref) { + /// Returns the inner [`Vec2`] + fn as_vec2(_self: Ref) -> Val { let output: Val = bevy::math::prelude::Dir2::as_vec2( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq( + _self: Ref, + other: Ref, + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn fast_renormalize(_self: Val) { + /// Returns `self` after an approximate normalization, assuming the value is already nearly normalized. + /// Useful for preventing numerical error accumulation. + /// See [`Dir3::fast_renormalize`] for an example of when such error accumulation might occur. + fn fast_renormalize( + _self: Val, + ) -> Val { let output: Val = bevy::math::prelude::Dir2::fast_renormalize( _self.into_inner(), ) .into(); output } - fn from_xy_unchecked(x: f32, y: f32) { + /// Create a direction from its `x` and `y` components, assuming the resulting vector is normalized. + /// # Warning + /// The vector produced from `x` and `y` must be normalized, i.e its length must be `1.0`. + fn from_xy_unchecked(x: f32, y: f32) -> Val { let output: Val = bevy::math::prelude::Dir2::from_xy_unchecked( x, y, @@ -611,31 +841,40 @@ impl bevy::math::prelude::Dir2 { .into(); output } - fn mul(_self: Val, rhs: f32) { + fn mul( + _self: Val, + rhs: f32, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } - fn new_unchecked(value: Val) { + /// Create a [`Dir2`] from a [`Vec2`] that is already normalized. + /// # Warning + /// `value` must be normalized, i.e its length must be `1.0`. + fn new_unchecked( + value: Val, + ) -> Val { let output: Val = bevy::math::prelude::Dir2::new_unchecked( value.into_inner(), ) .into(); output } + /// Get the rotation that rotates `other` to this direction. fn rotation_from( _self: Val, other: Val, - ) { + ) -> Val { let output: Val = bevy::math::prelude::Dir2::rotation_from( _self.into_inner(), other.into_inner(), @@ -643,24 +882,27 @@ impl bevy::math::prelude::Dir2 { .into(); output } - fn rotation_from_x(_self: Val) { + /// Get the rotation that rotates the X-axis to this direction. + fn rotation_from_x(_self: Val) -> Val { let output: Val = bevy::math::prelude::Dir2::rotation_from_x( _self.into_inner(), ) .into(); output } - fn rotation_from_y(_self: Val) { + /// Get the rotation that rotates the Y-axis to this direction. + fn rotation_from_y(_self: Val) -> Val { let output: Val = bevy::math::prelude::Dir2::rotation_from_y( _self.into_inner(), ) .into(); output } + /// Get the rotation that rotates this direction to `other`. fn rotation_to( _self: Val, other: Val, - ) { + ) -> Val { let output: Val = bevy::math::prelude::Dir2::rotation_to( _self.into_inner(), other.into_inner(), @@ -668,25 +910,44 @@ impl bevy::math::prelude::Dir2 { .into(); output } - fn rotation_to_x(_self: Val) { + /// Get the rotation that rotates this direction to the X-axis. + fn rotation_to_x(_self: Val) -> Val { let output: Val = bevy::math::prelude::Dir2::rotation_to_x( _self.into_inner(), ) .into(); output } - fn rotation_to_y(_self: Val) { + /// Get the rotation that rotates this direction to the Y-axis. + fn rotation_to_y(_self: Val) -> Val { let output: Val = bevy::math::prelude::Dir2::rotation_to_y( _self.into_inner(), ) .into(); output } + /// Performs a spherical linear interpolation between `self` and `rhs` + /// based on the value `s`. + /// This corresponds to interpolating between the two directions at a constant angular velocity. + /// When `s == 0.0`, the result will be equal to `self`. + /// When `s == 1.0`, the result will be equal to `rhs`. + /// # Example + /// ``` + /// # use bevy_math::Dir2; + /// # use approx::{assert_relative_eq, RelativeEq}; + /// # + /// let dir1 = Dir2::X; + /// let dir2 = Dir2::Y; + /// let result1 = dir1.slerp(dir2, 1.0 / 3.0); + /// assert_relative_eq!(result1, Dir2::from_xy(0.75_f32.sqrt(), 0.5).unwrap()); + /// let result2 = dir1.slerp(dir2, 0.5); + /// assert_relative_eq!(result2, Dir2::from_xy(0.5_f32.sqrt(), 0.5_f32.sqrt()).unwrap()); + /// ``` fn slerp( _self: Val, rhs: Val, s: f32, - ) { + ) -> Val { let output: Val = bevy::math::prelude::Dir2::slerp( _self.into_inner(), rhs.into_inner(), @@ -702,35 +963,69 @@ impl bevy::math::prelude::Dir2 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::prelude::Dir3 { - fn as_vec3(_self: Ref) { + /// Returns the inner [`Vec3`] + fn as_vec3(_self: Ref) -> Val { let output: Val = bevy::math::prelude::Dir3::as_vec3( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq( + _self: Ref, + other: Ref, + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn fast_renormalize(_self: Val) { + /// Returns `self` after an approximate normalization, assuming the value is already nearly normalized. + /// Useful for preventing numerical error accumulation. + /// # Example + /// The following seemingly benign code would start accumulating errors over time, + /// leading to `dir` eventually not being normalized anymore. + /// ``` + /// # use bevy_math::prelude::*; + /// # let N: usize = 200; + /// let mut dir = Dir3::X; + /// let quaternion = Quat::from_euler(EulerRot::XYZ, 1.0, 2.0, 3.0); + /// for i in 0..N { + /// dir = quaternion * dir; + /// } + /// ``` + /// Instead, do the following. + /// ``` + /// # use bevy_math::prelude::*; + /// # let N: usize = 200; + /// let mut dir = Dir3::X; + /// let quaternion = Quat::from_euler(EulerRot::XYZ, 1.0, 2.0, 3.0); + /// for i in 0..N { + /// dir = quaternion * dir; + /// dir = dir.fast_renormalize(); + /// } + /// ``` + fn fast_renormalize( + _self: Val, + ) -> Val { let output: Val = bevy::math::prelude::Dir3::fast_renormalize( _self.into_inner(), ) .into(); output } - fn from_xyz_unchecked(x: f32, y: f32, z: f32) { + /// Create a direction from its `x`, `y`, and `z` components, assuming the resulting vector is normalized. + /// # Warning + /// The vector produced from `x`, `y`, and `z` must be normalized, i.e its length must be `1.0`. + fn from_xyz_unchecked(x: f32, y: f32, z: f32) -> Val { let output: Val = bevy::math::prelude::Dir3::from_xyz_unchecked( x, y, @@ -739,32 +1034,61 @@ impl bevy::math::prelude::Dir3 { .into(); output } - fn mul(_self: Val, rhs: f32) { + fn mul( + _self: Val, + rhs: f32, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } - fn new_unchecked(value: Val) { + /// Create a [`Dir3`] from a [`Vec3`] that is already normalized. + /// # Warning + /// `value` must be normalized, i.e its length must be `1.0`. + fn new_unchecked( + value: Val, + ) -> Val { let output: Val = bevy::math::prelude::Dir3::new_unchecked( value.into_inner(), ) .into(); output } + /// Performs a spherical linear interpolation between `self` and `rhs` + /// based on the value `s`. + /// This corresponds to interpolating between the two directions at a constant angular velocity. + /// When `s == 0.0`, the result will be equal to `self`. + /// When `s == 1.0`, the result will be equal to `rhs`. + /// # Example + /// ``` + /// # use bevy_math::Dir3; + /// # use approx::{assert_relative_eq, RelativeEq}; + /// # + /// let dir1 = Dir3::X; + /// let dir2 = Dir3::Y; + /// let result1 = dir1.slerp(dir2, 1.0 / 3.0); + /// assert_relative_eq!( + /// result1, + /// Dir3::from_xyz(0.75_f32.sqrt(), 0.5, 0.0).unwrap(), + /// epsilon = 0.000001 + /// ); + /// let result2 = dir1.slerp(dir2, 0.5); + /// assert_relative_eq!(result2, Dir3::from_xyz(0.5_f32.sqrt(), 0.5_f32.sqrt(), 0.0).unwrap()); + /// ``` fn slerp( _self: Val, rhs: Val, s: f32, - ) { + ) -> Val { let output: Val = bevy::math::prelude::Dir3::slerp( _self.into_inner(), rhs.into_inner(), @@ -780,12 +1104,13 @@ impl bevy::math::prelude::Dir3 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::prelude::Dir3A { - fn as_vec3a(_self: Ref) { + /// Returns the inner [`Vec3A`] + fn as_vec3a(_self: Ref) -> Val { let output: Val = bevy::math::prelude::Dir3A::as_vec3a(&_self) .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) @@ -795,21 +1120,29 @@ impl bevy::math::prelude::Dir3A { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn fast_renormalize(_self: Val) { + /// Returns `self` after an approximate normalization, assuming the value is already nearly normalized. + /// Useful for preventing numerical error accumulation. + /// See [`Dir3::fast_renormalize`] for an example of when such error accumulation might occur. + fn fast_renormalize( + _self: Val, + ) -> Val { let output: Val = bevy::math::prelude::Dir3A::fast_renormalize( _self.into_inner(), ) .into(); output } - fn from_xyz_unchecked(x: f32, y: f32, z: f32) { + /// Create a direction from its `x`, `y`, and `z` components, assuming the resulting vector is normalized. + /// # Warning + /// The vector produced from `x`, `y`, and `z` must be normalized, i.e its length must be `1.0`. + fn from_xyz_unchecked(x: f32, y: f32, z: f32) -> Val { let output: Val = bevy::math::prelude::Dir3A::from_xyz_unchecked( x, y, @@ -818,32 +1151,56 @@ impl bevy::math::prelude::Dir3A { .into(); output } - fn mul(_self: Val, rhs: f32) { + fn mul(_self: Val, rhs: f32) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } - fn new_unchecked(value: Val) { + /// Create a [`Dir3A`] from a [`Vec3A`] that is already normalized. + /// # Warning + /// `value` must be normalized, i.e its length must be `1.0`. + fn new_unchecked(value: Val) -> Val { let output: Val = bevy::math::prelude::Dir3A::new_unchecked( value.into_inner(), ) .into(); output } + /// Performs a spherical linear interpolation between `self` and `rhs` + /// based on the value `s`. + /// This corresponds to interpolating between the two directions at a constant angular velocity. + /// When `s == 0.0`, the result will be equal to `self`. + /// When `s == 1.0`, the result will be equal to `rhs`. + /// # Example + /// ``` + /// # use bevy_math::Dir3A; + /// # use approx::{assert_relative_eq, RelativeEq}; + /// # + /// let dir1 = Dir3A::X; + /// let dir2 = Dir3A::Y; + /// let result1 = dir1.slerp(dir2, 1.0 / 3.0); + /// assert_relative_eq!( + /// result1, + /// Dir3A::from_xyz(0.75_f32.sqrt(), 0.5, 0.0).unwrap(), + /// epsilon = 0.000001 + /// ); + /// let result2 = dir1.slerp(dir2, 0.5); + /// assert_relative_eq!(result2, Dir3A::from_xyz(0.5_f32.sqrt(), 0.5_f32.sqrt(), 0.0).unwrap()); + /// ``` fn slerp( _self: Val, rhs: Val, s: f32, - ) { + ) -> Val { let output: Val = bevy::math::prelude::Dir3A::slerp( _self.into_inner(), rhs.into_inner(), @@ -859,45 +1216,71 @@ impl bevy::math::prelude::Dir3A { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::prelude::IRect { - fn as_rect(_self: Ref) { + /// Returns self as [`Rect`] (f32) + fn as_rect( + _self: Ref, + ) -> Val { let output: Val = bevy::math::prelude::IRect::as_rect( &_self, ) .into(); output } - fn as_urect(_self: Ref) { + /// Returns self as [`URect`] (u32) + fn as_urect( + _self: Ref, + ) -> Val { let output: Val = bevy::math::prelude::IRect::as_urect( &_self, ) .into(); output } - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn center(_self: Ref) { + /// The center point of the rectangle. + /// # Rounding Behavior + /// If the (min + max) contains odd numbers they will be rounded down to the nearest whole number when calculating the center. + /// # Examples + /// ``` + /// # use bevy_math::{IRect, IVec2}; + /// let r = IRect::new(0, 0, 5, 2); // w=5 h=2 + /// assert_eq!(r.center(), IVec2::new(2, 1)); + /// ``` + fn center( + _self: Ref, + ) -> Val { let output: Val = bevy::math::prelude::IRect::center( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } + /// Check if a point lies within this rectangle, inclusive of its edges. + /// # Examples + /// ``` + /// # use bevy_math::IRect; + /// let r = IRect::new(0, 0, 5, 1); // w=5 h=1 + /// assert!(r.contains(r.center())); + /// assert!(r.contains(r.min)); + /// assert!(r.contains(r.max)); + /// ``` fn contains( _self: Ref, point: Val, - ) { + ) -> bool { let output: bool = bevy::math::prelude::IRect::contains( &_self, point.into_inner(), @@ -908,17 +1291,27 @@ impl bevy::math::prelude::IRect { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } + /// Create a new rectangle from its center and half-size. + /// # Panics + /// This method panics if any of the components of the half-size is negative. + /// # Examples + /// ``` + /// # use bevy_math::{IRect, IVec2}; + /// let r = IRect::from_center_half_size(IVec2::ZERO, IVec2::ONE); // w=2 h=2 + /// assert_eq!(r.min, IVec2::splat(-1)); + /// assert_eq!(r.max, IVec2::splat(1)); + /// ``` fn from_center_half_size( origin: Val, half_size: Val, - ) { + ) -> Val { let output: Val = bevy::math::prelude::IRect::from_center_half_size( origin.into_inner(), half_size.into_inner(), @@ -926,10 +1319,22 @@ impl bevy::math::prelude::IRect { .into(); output } + /// Create a new rectangle from its center and size. + /// # Rounding Behavior + /// If the size contains odd numbers they will be rounded down to the nearest whole number. + /// # Panics + /// This method panics if any of the components of the size is negative. + /// # Examples + /// ``` + /// # use bevy_math::{IRect, IVec2}; + /// let r = IRect::from_center_size(IVec2::ZERO, IVec2::new(3, 2)); // w=2 h=2 + /// assert_eq!(r.min, IVec2::splat(-1)); + /// assert_eq!(r.max, IVec2::splat(1)); + /// ``` fn from_center_size( origin: Val, size: Val, - ) { + ) -> Val { let output: Val = bevy::math::prelude::IRect::from_center_size( origin.into_inner(), size.into_inner(), @@ -937,10 +1342,21 @@ impl bevy::math::prelude::IRect { .into(); output } + /// Create a new rectangle from two corner points. + /// The two points do not need to be the minimum and/or maximum corners. + /// They only need to be two opposite corners. + /// # Examples + /// ``` + /// # use bevy_math::{IRect, IVec2}; + /// // Unit rect from [0,0] to [1,1] + /// let r = IRect::from_corners(IVec2::ZERO, IVec2::ONE); // w=1 h=1 + /// // Same; the points do not need to be ordered + /// let r = IRect::from_corners(IVec2::ONE, IVec2::ZERO); // w=1 h=1 + /// ``` fn from_corners( p0: Val, p1: Val, - ) { + ) -> Val { let output: Val = bevy::math::prelude::IRect::from_corners( p0.into_inner(), p1.into_inner(), @@ -948,18 +1364,55 @@ impl bevy::math::prelude::IRect { .into(); output } - fn half_size(_self: Ref) { + /// Rectangle half-size. + /// # Rounding Behavior + /// If the full size contains odd numbers they will be rounded down to the nearest whole number when calculating the half size. + /// # Examples + /// ``` + /// # use bevy_math::{IRect, IVec2}; + /// let r = IRect::new(0, 0, 4, 3); // w=4 h=3 + /// assert_eq!(r.half_size(), IVec2::new(2, 1)); + /// ``` + fn half_size( + _self: Ref, + ) -> Val { let output: Val = bevy::math::prelude::IRect::half_size( &_self, ) .into(); output } - fn height(_self: Ref) { + /// Rectangle height (max.y - min.y). + /// # Examples + /// ``` + /// # use bevy_math::IRect; + /// let r = IRect::new(0, 0, 5, 1); // w=5 h=1 + /// assert_eq!(r.height(), 1); + /// ``` + fn height(_self: Ref) -> i32 { let output: i32 = bevy::math::prelude::IRect::height(&_self).into(); output } - fn inflate(_self: Ref, expansion: i32) { + /// Create a new rectangle by expanding it evenly on all sides. + /// A positive expansion value produces a larger rectangle, + /// while a negative expansion value produces a smaller rectangle. + /// If this would result in zero or negative width or height, [`IRect::EMPTY`] is returned instead. + /// # Examples + /// ``` + /// # use bevy_math::{IRect, IVec2}; + /// let r = IRect::new(0, 0, 5, 1); // w=5 h=1 + /// let r2 = r.inflate(3); // w=11 h=7 + /// assert_eq!(r2.min, IVec2::splat(-3)); + /// assert_eq!(r2.max, IVec2::new(8, 4)); + /// let r = IRect::new(0, -1, 4, 3); // w=4 h=4 + /// let r2 = r.inflate(-1); // w=2 h=2 + /// assert_eq!(r2.min, IVec2::new(1, 0)); + /// assert_eq!(r2.max, IVec2::new(3, 2)); + /// ``` + fn inflate( + _self: Ref, + expansion: i32, + ) -> Val { let output: Val = bevy::math::prelude::IRect::inflate( &_self, expansion, @@ -967,10 +1420,23 @@ impl bevy::math::prelude::IRect { .into(); output } + /// Build a new rectangle formed of the intersection of this rectangle and another rectangle. + /// The intersection is the largest rectangle enclosed in both rectangles. If the intersection + /// is empty, this method returns an empty rectangle ([`IRect::is_empty()`] returns `true`), but + /// the actual values of [`IRect::min`] and [`IRect::max`] are implementation-dependent. + /// # Examples + /// ``` + /// # use bevy_math::{IRect, IVec2}; + /// let r1 = IRect::new(0, 0, 5, 1); // w=5 h=1 + /// let r2 = IRect::new(1, -1, 3, 3); // w=2 h=4 + /// let r = r1.intersect(r2); + /// assert_eq!(r.min, IVec2::new(1, 0)); + /// assert_eq!(r.max, IVec2::new(3, 1)); + /// ``` fn intersect( _self: Ref, other: Val, - ) { + ) -> Val { let output: Val = bevy::math::prelude::IRect::intersect( &_self, other.into_inner(), @@ -978,11 +1444,27 @@ impl bevy::math::prelude::IRect { .into(); output } - fn is_empty(_self: Ref) { + /// Check if the rectangle is empty. + /// # Examples + /// ``` + /// # use bevy_math::{IRect, IVec2}; + /// let r = IRect::from_corners(IVec2::ZERO, IVec2::new(0, 1)); // w=0 h=1 + /// assert!(r.is_empty()); + /// ``` + fn is_empty(_self: Ref) -> bool { let output: bool = bevy::math::prelude::IRect::is_empty(&_self).into(); output } - fn new(x0: i32, y0: i32, x1: i32, y1: i32) { + /// Create a new rectangle from two corner points. + /// The two points do not need to be the minimum and/or maximum corners. + /// They only need to be two opposite corners. + /// # Examples + /// ``` + /// # use bevy_math::IRect; + /// let r = IRect::new(0, 4, 10, 6); // w=10 h=2 + /// let r = IRect::new(2, 3, 5, -1); // w=3 h=4 + /// ``` + fn new(x0: i32, y0: i32, x1: i32, y1: i32) -> Val { let output: Val = bevy::math::prelude::IRect::new( x0, y0, @@ -992,17 +1474,35 @@ impl bevy::math::prelude::IRect { .into(); output } - fn size(_self: Ref) { + /// Rectangle size. + /// # Examples + /// ``` + /// # use bevy_math::{IRect, IVec2}; + /// let r = IRect::new(0, 0, 5, 1); // w=5 h=1 + /// assert_eq!(r.size(), IVec2::new(5, 1)); + /// ``` + fn size(_self: Ref) -> Val { let output: Val = bevy::math::prelude::IRect::size( &_self, ) .into(); output } + /// Build a new rectangle formed of the union of this rectangle and another rectangle. + /// The union is the smallest rectangle enclosing both rectangles. + /// # Examples + /// ``` + /// # use bevy_math::{IRect, IVec2}; + /// let r1 = IRect::new(0, 0, 5, 1); // w=5 h=1 + /// let r2 = IRect::new(1, -1, 3, 3); // w=2 h=4 + /// let r = r1.union(r2); + /// assert_eq!(r.min, IVec2::new(0, -1)); + /// assert_eq!(r.max, IVec2::new(5, 3)); + /// ``` fn union( _self: Ref, other: Val, - ) { + ) -> Val { let output: Val = bevy::math::prelude::IRect::union( &_self, other.into_inner(), @@ -1010,10 +1510,21 @@ impl bevy::math::prelude::IRect { .into(); output } + /// Build a new rectangle formed of the union of this rectangle and a point. + /// The union is the smallest rectangle enclosing both the rectangle and the point. If the + /// point is already inside the rectangle, this method returns a copy of the rectangle. + /// # Examples + /// ``` + /// # use bevy_math::{IRect, IVec2}; + /// let r = IRect::new(0, 0, 5, 1); // w=5 h=1 + /// let u = r.union_point(IVec2::new(3, 6)); + /// assert_eq!(u.min, IVec2::ZERO); + /// assert_eq!(u.max, IVec2::new(5, 6)); + /// ``` fn union_point( _self: Ref, other: Val, - ) { + ) -> Val { let output: Val = bevy::math::prelude::IRect::union_point( &_self, other.into_inner(), @@ -1021,7 +1532,14 @@ impl bevy::math::prelude::IRect { .into(); output } - fn width(_self: Ref) { + /// Rectangle width (max.x - min.x). + /// # Examples + /// ``` + /// # use bevy_math::IRect; + /// let r = IRect::new(0, 0, 5, 1); // w=5 h=1 + /// assert_eq!(r.width(), 5); + /// ``` + fn width(_self: Ref) -> i32 { let output: i32 = bevy::math::prelude::IRect::width(&_self).into(); output } @@ -1032,38 +1550,60 @@ impl bevy::math::prelude::IRect { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::prelude::Rect { - fn as_irect(_self: Ref) { + /// Returns self as [`IRect`] (i32) + fn as_irect( + _self: Ref, + ) -> Val { let output: Val = bevy::math::prelude::Rect::as_irect( &_self, ) .into(); output } - fn as_urect(_self: Ref) { + /// Returns self as [`URect`] (u32) + fn as_urect( + _self: Ref, + ) -> Val { let output: Val = bevy::math::prelude::Rect::as_urect( &_self, ) .into(); output } - fn center(_self: Ref) { + /// The center point of the rectangle. + /// # Examples + /// ``` + /// # use bevy_math::{Rect, Vec2}; + /// let r = Rect::new(0., 0., 5., 1.); // w=5 h=1 + /// assert!(r.center().abs_diff_eq(Vec2::new(2.5, 0.5), 1e-5)); + /// ``` + fn center(_self: Ref) -> Val { let output: Val = bevy::math::prelude::Rect::center( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } + /// Check if a point lies within this rectangle, inclusive of its edges. + /// # Examples + /// ``` + /// # use bevy_math::Rect; + /// let r = Rect::new(0., 0., 5., 1.); // w=5 h=1 + /// assert!(r.contains(r.center())); + /// assert!(r.contains(r.min)); + /// assert!(r.contains(r.max)); + /// ``` fn contains( _self: Ref, point: Val, - ) { + ) -> bool { let output: bool = bevy::math::prelude::Rect::contains( &_self, point.into_inner(), @@ -1071,17 +1611,30 @@ impl bevy::math::prelude::Rect { .into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq( + _self: Ref, + other: Ref, + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } + /// Create a new rectangle from its center and half-size. + /// # Panics + /// This method panics if any of the components of the half-size is negative. + /// # Examples + /// ``` + /// # use bevy_math::{Rect, Vec2}; + /// let r = Rect::from_center_half_size(Vec2::ZERO, Vec2::ONE); // w=2 h=2 + /// assert!(r.min.abs_diff_eq(Vec2::splat(-1.), 1e-5)); + /// assert!(r.max.abs_diff_eq(Vec2::splat(1.), 1e-5)); + /// ``` fn from_center_half_size( origin: Val, half_size: Val, - ) { + ) -> Val { let output: Val = bevy::math::prelude::Rect::from_center_half_size( origin.into_inner(), half_size.into_inner(), @@ -1089,10 +1642,20 @@ impl bevy::math::prelude::Rect { .into(); output } + /// Create a new rectangle from its center and size. + /// # Panics + /// This method panics if any of the components of the size is negative. + /// # Examples + /// ``` + /// # use bevy_math::{Rect, Vec2}; + /// let r = Rect::from_center_size(Vec2::ZERO, Vec2::ONE); // w=1 h=1 + /// assert!(r.min.abs_diff_eq(Vec2::splat(-0.5), 1e-5)); + /// assert!(r.max.abs_diff_eq(Vec2::splat(0.5), 1e-5)); + /// ``` fn from_center_size( origin: Val, size: Val, - ) { + ) -> Val { let output: Val = bevy::math::prelude::Rect::from_center_size( origin.into_inner(), size.into_inner(), @@ -1100,10 +1663,21 @@ impl bevy::math::prelude::Rect { .into(); output } + /// Create a new rectangle from two corner points. + /// The two points do not need to be the minimum and/or maximum corners. + /// They only need to be two opposite corners. + /// # Examples + /// ``` + /// # use bevy_math::{Rect, Vec2}; + /// // Unit rect from [0,0] to [1,1] + /// let r = Rect::from_corners(Vec2::ZERO, Vec2::ONE); // w=1 h=1 + /// // Same; the points do not need to be ordered + /// let r = Rect::from_corners(Vec2::ONE, Vec2::ZERO); // w=1 h=1 + /// ``` fn from_corners( p0: Val, p1: Val, - ) { + ) -> Val { let output: Val = bevy::math::prelude::Rect::from_corners( p0.into_inner(), p1.into_inner(), @@ -1111,18 +1685,53 @@ impl bevy::math::prelude::Rect { .into(); output } - fn half_size(_self: Ref) { + /// Rectangle half-size. + /// # Examples + /// ``` + /// # use bevy_math::{Rect, Vec2}; + /// let r = Rect::new(0., 0., 5., 1.); // w=5 h=1 + /// assert!(r.half_size().abs_diff_eq(Vec2::new(2.5, 0.5), 1e-5)); + /// ``` + fn half_size( + _self: Ref, + ) -> Val { let output: Val = bevy::math::prelude::Rect::half_size( &_self, ) .into(); output } - fn height(_self: Ref) { + /// Rectangle height (max.y - min.y). + /// # Examples + /// ``` + /// # use bevy_math::Rect; + /// let r = Rect::new(0., 0., 5., 1.); // w=5 h=1 + /// assert!((r.height() - 1.).abs() <= 1e-5); + /// ``` + fn height(_self: Ref) -> f32 { let output: f32 = bevy::math::prelude::Rect::height(&_self).into(); output } - fn inflate(_self: Ref, expansion: f32) { + /// Create a new rectangle by expanding it evenly on all sides. + /// A positive expansion value produces a larger rectangle, + /// while a negative expansion value produces a smaller rectangle. + /// If this would result in zero or negative width or height, [`Rect::EMPTY`] is returned instead. + /// # Examples + /// ``` + /// # use bevy_math::{Rect, Vec2}; + /// let r = Rect::new(0., 0., 5., 1.); // w=5 h=1 + /// let r2 = r.inflate(3.); // w=11 h=7 + /// assert!(r2.min.abs_diff_eq(Vec2::splat(-3.), 1e-5)); + /// assert!(r2.max.abs_diff_eq(Vec2::new(8., 4.), 1e-5)); + /// let r = Rect::new(0., -1., 6., 7.); // w=6 h=8 + /// let r2 = r.inflate(-2.); // w=11 h=7 + /// assert!(r2.min.abs_diff_eq(Vec2::new(2., 1.), 1e-5)); + /// assert!(r2.max.abs_diff_eq(Vec2::new(4., 5.), 1e-5)); + /// ``` + fn inflate( + _self: Ref, + expansion: f32, + ) -> Val { let output: Val = bevy::math::prelude::Rect::inflate( &_self, expansion, @@ -1130,10 +1739,23 @@ impl bevy::math::prelude::Rect { .into(); output } + /// Build a new rectangle formed of the intersection of this rectangle and another rectangle. + /// The intersection is the largest rectangle enclosed in both rectangles. If the intersection + /// is empty, this method returns an empty rectangle ([`Rect::is_empty()`] returns `true`), but + /// the actual values of [`Rect::min`] and [`Rect::max`] are implementation-dependent. + /// # Examples + /// ``` + /// # use bevy_math::{Rect, Vec2}; + /// let r1 = Rect::new(0., 0., 5., 1.); // w=5 h=1 + /// let r2 = Rect::new(1., -1., 3., 3.); // w=2 h=4 + /// let r = r1.intersect(r2); + /// assert!(r.min.abs_diff_eq(Vec2::new(1., 0.), 1e-5)); + /// assert!(r.max.abs_diff_eq(Vec2::new(3., 1.), 1e-5)); + /// ``` fn intersect( _self: Ref, other: Val, - ) { + ) -> Val { let output: Val = bevy::math::prelude::Rect::intersect( &_self, other.into_inner(), @@ -1141,11 +1763,27 @@ impl bevy::math::prelude::Rect { .into(); output } - fn is_empty(_self: Ref) { + /// Check if the rectangle is empty. + /// # Examples + /// ``` + /// # use bevy_math::{Rect, Vec2}; + /// let r = Rect::from_corners(Vec2::ZERO, Vec2::new(0., 1.)); // w=0 h=1 + /// assert!(r.is_empty()); + /// ``` + fn is_empty(_self: Ref) -> bool { let output: bool = bevy::math::prelude::Rect::is_empty(&_self).into(); output } - fn new(x0: f32, y0: f32, x1: f32, y1: f32) { + /// Create a new rectangle from two corner points. + /// The two points do not need to be the minimum and/or maximum corners. + /// They only need to be two opposite corners. + /// # Examples + /// ``` + /// # use bevy_math::Rect; + /// let r = Rect::new(0., 4., 10., 6.); // w=10 h=2 + /// let r = Rect::new(2., 3., 5., -1.); // w=3 h=4 + /// ``` + fn new(x0: f32, y0: f32, x1: f32, y1: f32) -> Val { let output: Val = bevy::math::prelude::Rect::new( x0, y0, @@ -1155,10 +1793,23 @@ impl bevy::math::prelude::Rect { .into(); output } + /// Build a new rectangle from this one with its coordinates expressed + /// relative to `other` in a normalized ([0..1] x [0..1]) coordinate system. + /// # Examples + /// ``` + /// # use bevy_math::{Rect, Vec2}; + /// let r = Rect::new(2., 3., 4., 6.); + /// let s = Rect::new(0., 0., 10., 10.); + /// let n = r.normalize(s); + /// assert_eq!(n.min.x, 0.2); + /// assert_eq!(n.min.y, 0.3); + /// assert_eq!(n.max.x, 0.4); + /// assert_eq!(n.max.y, 0.6); + /// ``` fn normalize( _self: Ref, other: Val, - ) { + ) -> Val { let output: Val = bevy::math::prelude::Rect::normalize( &_self, other.into_inner(), @@ -1166,17 +1817,35 @@ impl bevy::math::prelude::Rect { .into(); output } - fn size(_self: Ref) { + /// Rectangle size. + /// # Examples + /// ``` + /// # use bevy_math::{Rect, Vec2}; + /// let r = Rect::new(0., 0., 5., 1.); // w=5 h=1 + /// assert!(r.size().abs_diff_eq(Vec2::new(5., 1.), 1e-5)); + /// ``` + fn size(_self: Ref) -> Val { let output: Val = bevy::math::prelude::Rect::size( &_self, ) .into(); output } + /// Build a new rectangle formed of the union of this rectangle and another rectangle. + /// The union is the smallest rectangle enclosing both rectangles. + /// # Examples + /// ``` + /// # use bevy_math::{Rect, Vec2}; + /// let r1 = Rect::new(0., 0., 5., 1.); // w=5 h=1 + /// let r2 = Rect::new(1., -1., 3., 3.); // w=2 h=4 + /// let r = r1.union(r2); + /// assert!(r.min.abs_diff_eq(Vec2::new(0., -1.), 1e-5)); + /// assert!(r.max.abs_diff_eq(Vec2::new(5., 3.), 1e-5)); + /// ``` fn union( _self: Ref, other: Val, - ) { + ) -> Val { let output: Val = bevy::math::prelude::Rect::union( &_self, other.into_inner(), @@ -1184,10 +1853,21 @@ impl bevy::math::prelude::Rect { .into(); output } + /// Build a new rectangle formed of the union of this rectangle and a point. + /// The union is the smallest rectangle enclosing both the rectangle and the point. If the + /// point is already inside the rectangle, this method returns a copy of the rectangle. + /// # Examples + /// ``` + /// # use bevy_math::{Rect, Vec2}; + /// let r = Rect::new(0., 0., 5., 1.); // w=5 h=1 + /// let u = r.union_point(Vec2::new(3., 6.)); + /// assert!(u.min.abs_diff_eq(Vec2::ZERO, 1e-5)); + /// assert!(u.max.abs_diff_eq(Vec2::new(5., 6.), 1e-5)); + /// ``` fn union_point( _self: Ref, other: Val, - ) { + ) -> Val { let output: Val = bevy::math::prelude::Rect::union_point( &_self, other.into_inner(), @@ -1195,7 +1875,14 @@ impl bevy::math::prelude::Rect { .into(); output } - fn width(_self: Ref) { + /// Rectangle width (max.x - min.x). + /// # Examples + /// ``` + /// # use bevy_math::Rect; + /// let r = Rect::new(0., 0., 5., 1.); // w=5 h=1 + /// assert!((r.width() - 5.).abs() <= 1e-5); + /// ``` + fn width(_self: Ref) -> f32 { let output: f32 = bevy::math::prelude::Rect::width(&_self).into(); output } @@ -1206,45 +1893,71 @@ impl bevy::math::prelude::Rect { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::prelude::URect { - fn as_irect(_self: Ref) { + /// Returns self as [`IRect`] (i32) + fn as_irect( + _self: Ref, + ) -> Val { let output: Val = bevy::math::prelude::URect::as_irect( &_self, ) .into(); output } - fn as_rect(_self: Ref) { + /// Returns self as [`Rect`] (f32) + fn as_rect( + _self: Ref, + ) -> Val { let output: Val = bevy::math::prelude::URect::as_rect( &_self, ) .into(); output } - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn center(_self: Ref) { + /// The center point of the rectangle. + /// # Rounding Behavior + /// If the (min + max) contains odd numbers they will be rounded down to the nearest whole number when calculating the center. + /// # Examples + /// ``` + /// # use bevy_math::{URect, UVec2}; + /// let r = URect::new(0, 0, 4, 2); // w=4 h=2 + /// assert_eq!(r.center(), UVec2::new(2, 1)); + /// ``` + fn center( + _self: Ref, + ) -> Val { let output: Val = bevy::math::prelude::URect::center( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } + /// Check if a point lies within this rectangle, inclusive of its edges. + /// # Examples + /// ``` + /// # use bevy_math::URect; + /// let r = URect::new(0, 0, 5, 1); // w=5 h=1 + /// assert!(r.contains(r.center())); + /// assert!(r.contains(r.min)); + /// assert!(r.contains(r.max)); + /// ``` fn contains( _self: Ref, point: Val, - ) { + ) -> bool { let output: bool = bevy::math::prelude::URect::contains( &_self, point.into_inner(), @@ -1255,17 +1968,27 @@ impl bevy::math::prelude::URect { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } + /// Create a new rectangle from its center and half-size. + /// # Panics + /// This method panics if any of the components of the half-size is negative or if `origin - half_size` results in any negatives. + /// # Examples + /// ``` + /// # use bevy_math::{URect, UVec2}; + /// let r = URect::from_center_half_size(UVec2::ONE, UVec2::ONE); // w=2 h=2 + /// assert_eq!(r.min, UVec2::splat(0)); + /// assert_eq!(r.max, UVec2::splat(2)); + /// ``` fn from_center_half_size( origin: Val, half_size: Val, - ) { + ) -> Val { let output: Val = bevy::math::prelude::URect::from_center_half_size( origin.into_inner(), half_size.into_inner(), @@ -1273,10 +1996,22 @@ impl bevy::math::prelude::URect { .into(); output } + /// Create a new rectangle from its center and size. + /// # Rounding Behavior + /// If the size contains odd numbers they will be rounded down to the nearest whole number. + /// # Panics + /// This method panics if any of the components of the size is negative or if `origin - (size / 2)` results in any negatives. + /// # Examples + /// ``` + /// # use bevy_math::{URect, UVec2}; + /// let r = URect::from_center_size(UVec2::ONE, UVec2::splat(2)); // w=2 h=2 + /// assert_eq!(r.min, UVec2::splat(0)); + /// assert_eq!(r.max, UVec2::splat(2)); + /// ``` fn from_center_size( origin: Val, size: Val, - ) { + ) -> Val { let output: Val = bevy::math::prelude::URect::from_center_size( origin.into_inner(), size.into_inner(), @@ -1284,10 +2019,21 @@ impl bevy::math::prelude::URect { .into(); output } + /// Create a new rectangle from two corner points. + /// The two points do not need to be the minimum and/or maximum corners. + /// They only need to be two opposite corners. + /// # Examples + /// ``` + /// # use bevy_math::{URect, UVec2}; + /// // Unit rect from [0,0] to [1,1] + /// let r = URect::from_corners(UVec2::ZERO, UVec2::ONE); // w=1 h=1 + /// // Same; the points do not need to be ordered + /// let r = URect::from_corners(UVec2::ONE, UVec2::ZERO); // w=1 h=1 + /// ``` fn from_corners( p0: Val, p1: Val, - ) { + ) -> Val { let output: Val = bevy::math::prelude::URect::from_corners( p0.into_inner(), p1.into_inner(), @@ -1295,18 +2041,55 @@ impl bevy::math::prelude::URect { .into(); output } - fn half_size(_self: Ref) { + /// Rectangle half-size. + /// # Rounding Behavior + /// If the full size contains odd numbers they will be rounded down to the nearest whole number when calculating the half size. + /// # Examples + /// ``` + /// # use bevy_math::{URect, UVec2}; + /// let r = URect::new(0, 0, 4, 2); // w=4 h=2 + /// assert_eq!(r.half_size(), UVec2::new(2, 1)); + /// ``` + fn half_size( + _self: Ref, + ) -> Val { let output: Val = bevy::math::prelude::URect::half_size( &_self, ) .into(); output } - fn height(_self: Ref) { + /// Rectangle height (max.y - min.y). + /// # Examples + /// ``` + /// # use bevy_math::URect; + /// let r = URect::new(0, 0, 5, 1); // w=5 h=1 + /// assert_eq!(r.height(), 1); + /// ``` + fn height(_self: Ref) -> u32 { let output: u32 = bevy::math::prelude::URect::height(&_self).into(); output } - fn inflate(_self: Ref, expansion: i32) { + /// Create a new rectangle by expanding it evenly on all sides. + /// A positive expansion value produces a larger rectangle, + /// while a negative expansion value produces a smaller rectangle. + /// If this would result in zero width or height, [`URect::EMPTY`] is returned instead. + /// # Examples + /// ``` + /// # use bevy_math::{URect, UVec2}; + /// let r = URect::new(4, 4, 6, 6); // w=2 h=2 + /// let r2 = r.inflate(1); // w=4 h=4 + /// assert_eq!(r2.min, UVec2::splat(3)); + /// assert_eq!(r2.max, UVec2::splat(7)); + /// let r = URect::new(4, 4, 8, 8); // w=4 h=4 + /// let r2 = r.inflate(-1); // w=2 h=2 + /// assert_eq!(r2.min, UVec2::splat(5)); + /// assert_eq!(r2.max, UVec2::splat(7)); + /// ``` + fn inflate( + _self: Ref, + expansion: i32, + ) -> Val { let output: Val = bevy::math::prelude::URect::inflate( &_self, expansion, @@ -1314,10 +2097,23 @@ impl bevy::math::prelude::URect { .into(); output } + /// Build a new rectangle formed of the intersection of this rectangle and another rectangle. + /// The intersection is the largest rectangle enclosed in both rectangles. If the intersection + /// is empty, this method returns an empty rectangle ([`URect::is_empty()`] returns `true`), but + /// the actual values of [`URect::min`] and [`URect::max`] are implementation-dependent. + /// # Examples + /// ``` + /// # use bevy_math::{URect, UVec2}; + /// let r1 = URect::new(0, 0, 2, 2); // w=2 h=2 + /// let r2 = URect::new(1, 1, 3, 3); // w=2 h=2 + /// let r = r1.intersect(r2); + /// assert_eq!(r.min, UVec2::new(1, 1)); + /// assert_eq!(r.max, UVec2::new(2, 2)); + /// ``` fn intersect( _self: Ref, other: Val, - ) { + ) -> Val { let output: Val = bevy::math::prelude::URect::intersect( &_self, other.into_inner(), @@ -1325,11 +2121,27 @@ impl bevy::math::prelude::URect { .into(); output } - fn is_empty(_self: Ref) { + /// Check if the rectangle is empty. + /// # Examples + /// ``` + /// # use bevy_math::{URect, UVec2}; + /// let r = URect::from_corners(UVec2::ZERO, UVec2::new(0, 1)); // w=0 h=1 + /// assert!(r.is_empty()); + /// ``` + fn is_empty(_self: Ref) -> bool { let output: bool = bevy::math::prelude::URect::is_empty(&_self).into(); output } - fn new(x0: u32, y0: u32, x1: u32, y1: u32) { + /// Create a new rectangle from two corner points. + /// The two points do not need to be the minimum and/or maximum corners. + /// They only need to be two opposite corners. + /// # Examples + /// ``` + /// # use bevy_math::URect; + /// let r = URect::new(0, 4, 10, 6); // w=10 h=2 + /// let r = URect::new(2, 4, 5, 0); // w=3 h=4 + /// ``` + fn new(x0: u32, y0: u32, x1: u32, y1: u32) -> Val { let output: Val = bevy::math::prelude::URect::new( x0, y0, @@ -1339,17 +2151,35 @@ impl bevy::math::prelude::URect { .into(); output } - fn size(_self: Ref) { + /// Rectangle size. + /// # Examples + /// ``` + /// # use bevy_math::{URect, UVec2}; + /// let r = URect::new(0, 0, 5, 1); // w=5 h=1 + /// assert_eq!(r.size(), UVec2::new(5, 1)); + /// ``` + fn size(_self: Ref) -> Val { let output: Val = bevy::math::prelude::URect::size( &_self, ) .into(); output } + /// Build a new rectangle formed of the union of this rectangle and another rectangle. + /// The union is the smallest rectangle enclosing both rectangles. + /// # Examples + /// ``` + /// # use bevy_math::{URect, UVec2}; + /// let r1 = URect::new(0, 0, 5, 1); // w=5 h=1 + /// let r2 = URect::new(1, 0, 3, 8); // w=2 h=4 + /// let r = r1.union(r2); + /// assert_eq!(r.min, UVec2::new(0, 0)); + /// assert_eq!(r.max, UVec2::new(5, 8)); + /// ``` fn union( _self: Ref, other: Val, - ) { + ) -> Val { let output: Val = bevy::math::prelude::URect::union( &_self, other.into_inner(), @@ -1357,10 +2187,21 @@ impl bevy::math::prelude::URect { .into(); output } + /// Build a new rectangle formed of the union of this rectangle and a point. + /// The union is the smallest rectangle enclosing both the rectangle and the point. If the + /// point is already inside the rectangle, this method returns a copy of the rectangle. + /// # Examples + /// ``` + /// # use bevy_math::{URect, UVec2}; + /// let r = URect::new(0, 0, 5, 1); // w=5 h=1 + /// let u = r.union_point(UVec2::new(3, 6)); + /// assert_eq!(u.min, UVec2::ZERO); + /// assert_eq!(u.max, UVec2::new(5, 6)); + /// ``` fn union_point( _self: Ref, other: Val, - ) { + ) -> Val { let output: Val = bevy::math::prelude::URect::union_point( &_self, other.into_inner(), @@ -1368,7 +2209,14 @@ impl bevy::math::prelude::URect { .into(); output } - fn width(_self: Ref) { + /// Rectangle width (max.x - min.x). + /// # Examples + /// ``` + /// # use bevy_math::URect; + /// let r = URect::new(0, 0, 5, 1); // w=5 h=1 + /// assert_eq!(r.width(), 5); + /// ``` + fn width(_self: Ref) -> u32 { let output: u32 = bevy::math::prelude::URect::width(&_self).into(); output } @@ -1385,24 +2233,32 @@ impl bevy::math::Affine3 {} bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::bounding::Aabb2d { - fn bounding_circle(_self: Ref) { + /// Computes the smallest [`BoundingCircle`] containing this [`Aabb2d`]. + fn bounding_circle( + _self: Ref, + ) -> Val { let output: Val = bevy::math::bounding::Aabb2d::bounding_circle( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } + /// Finds the point on the AABB that is closest to the given `point`. + /// If the point is outside the AABB, the returned point will be on the perimeter of the AABB. + /// Otherwise, it will be inside the AABB and returned as is. fn closest_point( _self: Ref, point: Val, - ) { + ) -> Val { let output: Val = bevy::math::bounding::Aabb2d::closest_point( &_self, point.into_inner(), @@ -1410,10 +2266,11 @@ impl bevy::math::bounding::Aabb2d { .into(); output } + /// Constructs an AABB from its center and half-size. fn new( center: Val, half_size: Val, - ) { + ) -> Val { let output: Val = bevy::math::bounding::Aabb2d::new( center.into_inner(), half_size.into_inner(), @@ -1428,24 +2285,32 @@ impl bevy::math::bounding::Aabb2d { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::bounding::BoundingCircle { - fn aabb_2d(_self: Ref) { + /// Computes the smallest [`Aabb2d`] containing this [`BoundingCircle`]. + fn aabb_2d( + _self: Ref, + ) -> Val { let output: Val = bevy::math::bounding::BoundingCircle::aabb_2d( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } + /// Finds the point on the bounding circle that is closest to the given `point`. + /// If the point is outside the circle, the returned point will be on the perimeter of the circle. + /// Otherwise, it will be inside the circle and returned as is. fn closest_point( _self: Ref, point: Val, - ) { + ) -> Val { let output: Val = bevy::math::bounding::BoundingCircle::closest_point( &_self, point.into_inner(), @@ -1453,7 +2318,11 @@ impl bevy::math::bounding::BoundingCircle { .into(); output } - fn new(center: Val, radius: f32) { + /// Constructs a bounding circle from its center and radius. + fn new( + center: Val, + radius: f32, + ) -> Val { let output: Val = bevy::math::bounding::BoundingCircle::new( center.into_inner(), radius, @@ -1461,7 +2330,8 @@ impl bevy::math::bounding::BoundingCircle { .into(); output } - fn radius(_self: Ref) { + /// Get the radius of the bounding circle + fn radius(_self: Ref) -> f32 { let output: f32 = bevy::math::bounding::BoundingCircle::radius(&_self).into(); output } @@ -1472,17 +2342,22 @@ impl bevy::math::bounding::BoundingCircle { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Circle { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } + /// Finds the point on the circle that is closest to the given `point`. + /// If the point is outside the circle, the returned point will be on the perimeter of the circle. + /// Otherwise, it will be inside the circle and returned as is. fn closest_point( _self: Ref, point: Val, - ) { + ) -> Val { let output: Val = bevy::math::primitives::Circle::closest_point( &_self, point.into_inner(), @@ -1490,21 +2365,23 @@ impl bevy::math::primitives::Circle { .into(); output } - fn diameter(_self: Ref) { + /// Get the diameter of the circle + fn diameter(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Circle::diameter(&_self).into(); output } fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn new(radius: f32) { + /// Create a new [`Circle`] from a `radius` + fn new(radius: f32) -> Val { let output: Val = bevy::math::primitives::Circle::new( radius, ) @@ -1518,17 +2395,23 @@ impl bevy::math::primitives::Circle { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Annulus { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } + /// Finds the point on the annulus that is closest to the given `point`: + /// - If the point is outside of the annulus completely, the returned point will be on the outer perimeter. + /// - If the point is inside of the inner circle (hole) of the annulus, the returned point will be on the inner perimeter. + /// - Otherwise, the returned point is overlapping the annulus and returned as is. fn closest_point( _self: Ref, point: Val, - ) { + ) -> Val { let output: Val = bevy::math::primitives::Annulus::closest_point( &_self, point.into_inner(), @@ -1536,21 +2419,26 @@ impl bevy::math::primitives::Annulus { .into(); output } - fn diameter(_self: Ref) { + /// Get the diameter of the annulus + fn diameter(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Annulus::diameter(&_self).into(); output } fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn new(inner_radius: f32, outer_radius: f32) { + /// Create a new [`Annulus`] from the radii of the inner and outer circle + fn new( + inner_radius: f32, + outer_radius: f32, + ) -> Val { let output: Val = bevy::math::primitives::Annulus::new( inner_radius, outer_radius, @@ -1558,7 +2446,8 @@ impl bevy::math::primitives::Annulus { .into(); output } - fn thickness(_self: Ref) { + /// Get the thickness of the annulus + fn thickness(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Annulus::thickness(&_self).into(); output } @@ -1569,26 +2458,37 @@ impl bevy::math::primitives::Annulus { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Arc2d { - fn angle(_self: Ref) { + /// Get the angle of the arc + fn angle(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Arc2d::angle(&_self).into(); output } - fn apothem(_self: Ref) { + /// Get the length of the apothem of this arc, that is, + /// the distance from the center of the circle to the midpoint of the chord, in the direction of the midpoint of the arc. + /// Equivalently, the [`radius`](Self::radius) minus the [`sagitta`](Self::sagitta). + /// Note that for a [`major`](Self::is_major) arc, the apothem will be negative. + fn apothem(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Arc2d::apothem(&_self).into(); output } - fn chord_length(_self: Ref) { + /// Get the distance between the endpoints (the length of the chord) + fn chord_length(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Arc2d::chord_length(&_self).into(); output } - fn chord_midpoint(_self: Ref) { + /// Get the midpoint of the two endpoints (the midpoint of the chord) + fn chord_midpoint( + _self: Ref, + ) -> Val { let output: Val = bevy::math::primitives::Arc2d::chord_midpoint( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -1598,14 +2498,15 @@ impl bevy::math::primitives::Arc2d { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn from_degrees(radius: f32, angle: f32) { + /// Create a new [`Arc2d`] from a `radius` and an `angle` in degrees. + fn from_degrees(radius: f32, angle: f32) -> Val { let output: Val = bevy::math::primitives::Arc2d::from_degrees( radius, angle, @@ -1613,7 +2514,8 @@ impl bevy::math::primitives::Arc2d { .into(); output } - fn from_radians(radius: f32, angle: f32) { + /// Create a new [`Arc2d`] from a `radius` and an `angle` in radians + fn from_radians(radius: f32, angle: f32) -> Val { let output: Val = bevy::math::primitives::Arc2d::from_radians( radius, angle, @@ -1621,7 +2523,9 @@ impl bevy::math::primitives::Arc2d { .into(); output } - fn from_turns(radius: f32, fraction: f32) { + /// Create a new [`Arc2d`] from a `radius` and a `fraction` of a single turn. + /// For instance, `0.5` turns is a semicircle. + fn from_turns(radius: f32, fraction: f32) -> Val { let output: Val = bevy::math::primitives::Arc2d::from_turns( radius, fraction, @@ -1629,38 +2533,51 @@ impl bevy::math::primitives::Arc2d { .into(); output } - fn half_chord_length(_self: Ref) { + /// Get half the distance between the endpoints (half the length of the chord) + fn half_chord_length(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Arc2d::half_chord_length(&_self) .into(); output } - fn is_major(_self: Ref) { + /// Produces true if the arc is at least half a circle. + /// **Note:** This is not the negation of [`is_minor`](Self::is_minor): an exact semicircle is both major and minor. + fn is_major(_self: Ref) -> bool { let output: bool = bevy::math::primitives::Arc2d::is_major(&_self).into(); output } - fn is_minor(_self: Ref) { + /// Produces true if the arc is at most half a circle. + /// **Note:** This is not the negation of [`is_major`](Self::is_major): an exact semicircle is both major and minor. + fn is_minor(_self: Ref) -> bool { let output: bool = bevy::math::primitives::Arc2d::is_minor(&_self).into(); output } - fn left_endpoint(_self: Ref) { + /// Get the left-hand end point of the arc + fn left_endpoint( + _self: Ref, + ) -> Val { let output: Val = bevy::math::primitives::Arc2d::left_endpoint( &_self, ) .into(); output } - fn length(_self: Ref) { + /// Get the length of the arc + fn length(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Arc2d::length(&_self).into(); output } - fn midpoint(_self: Ref) { + /// Get the midpoint of the arc + fn midpoint( + _self: Ref, + ) -> Val { let output: Val = bevy::math::primitives::Arc2d::midpoint( &_self, ) .into(); output } - fn new(radius: f32, half_angle: f32) { + /// Create a new [`Arc2d`] from a `radius` and a `half_angle` + fn new(radius: f32, half_angle: f32) -> Val { let output: Val = bevy::math::primitives::Arc2d::new( radius, half_angle, @@ -1668,14 +2585,21 @@ impl bevy::math::primitives::Arc2d { .into(); output } - fn right_endpoint(_self: Ref) { + /// Get the right-hand end point of the arc + fn right_endpoint( + _self: Ref, + ) -> Val { let output: Val = bevy::math::primitives::Arc2d::right_endpoint( &_self, ) .into(); output } - fn sagitta(_self: Ref) { + /// Get the length of the sagitta of this arc, that is, + /// the length of the line between the midpoints of the arc and its chord. + /// Equivalently, the height of the triangle whose base is the chord and whose apex is the midpoint of the arc. + /// The sagitta is also the sum of the [`radius`](Self::radius) and the [`apothem`](Self::apothem). + fn sagitta(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Arc2d::sagitta(&_self).into(); output } @@ -1686,7 +2610,9 @@ impl bevy::math::primitives::Arc2d { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Capsule2d { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -1696,14 +2622,15 @@ impl bevy::math::primitives::Capsule2d { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn new(radius: f32, length: f32) { + /// Create a new `Capsule2d` from a radius and length + fn new(radius: f32, length: f32) -> Val { let output: Val = bevy::math::primitives::Capsule2d::new( radius, length, @@ -1711,7 +2638,10 @@ impl bevy::math::primitives::Capsule2d { .into(); output } - fn to_inner_rectangle(_self: Ref) { + /// Get the part connecting the semicircular ends of the capsule as a [`Rectangle`] + fn to_inner_rectangle( + _self: Ref, + ) -> Val { let output: Val = bevy::math::primitives::Capsule2d::to_inner_rectangle( &_self, ) @@ -1725,32 +2655,44 @@ impl bevy::math::primitives::Capsule2d { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::CircularSector { - fn angle(_self: Ref) { + /// Get the angle of the sector + fn angle(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::CircularSector::angle(&_self).into(); output } - fn apothem(_self: Ref) { + /// Get the length of the apothem of this sector + /// See [`Arc2d::apothem`] + fn apothem(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::CircularSector::apothem(&_self).into(); output } - fn arc_length(_self: Ref) { + /// Get the length of the arc defining the sector + fn arc_length(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::CircularSector::arc_length(&_self) .into(); output } - fn chord_length(_self: Ref) { + /// Get the length of the chord defined by the sector + /// See [`Arc2d::chord_length`] + fn chord_length(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::CircularSector::chord_length(&_self) .into(); output } - fn chord_midpoint(_self: Ref) { + /// Get the midpoint of the chord defined by the sector + /// See [`Arc2d::chord_midpoint`] + fn chord_midpoint( + _self: Ref, + ) -> Val { let output: Val = bevy::math::primitives::CircularSector::chord_midpoint( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -1760,14 +2702,18 @@ impl bevy::math::primitives::CircularSector { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn from_degrees(radius: f32, angle: f32) { + /// Create a new [`CircularSector`] from a `radius` and an `angle` in degrees. + fn from_degrees( + radius: f32, + angle: f32, + ) -> Val { let output: Val = bevy::math::primitives::CircularSector::from_degrees( radius, angle, @@ -1775,7 +2721,11 @@ impl bevy::math::primitives::CircularSector { .into(); output } - fn from_radians(radius: f32, angle: f32) { + /// Create a new [`CircularSector`] from a `radius` and an `angle` in radians. + fn from_radians( + radius: f32, + angle: f32, + ) -> Val { let output: Val = bevy::math::primitives::CircularSector::from_radians( radius, angle, @@ -1783,7 +2733,12 @@ impl bevy::math::primitives::CircularSector { .into(); output } - fn from_turns(radius: f32, fraction: f32) { + /// Create a new [`CircularSector`] from a `radius` and a number of `turns` of a circle. + /// For instance, `0.5` turns is a semicircle. + fn from_turns( + radius: f32, + fraction: f32, + ) -> Val { let output: Val = bevy::math::primitives::CircularSector::from_turns( radius, fraction, @@ -1791,19 +2746,23 @@ impl bevy::math::primitives::CircularSector { .into(); output } - fn half_angle(_self: Ref) { + /// Get half the angle of the sector + fn half_angle(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::CircularSector::half_angle(&_self) .into(); output } - fn half_chord_length(_self: Ref) { + /// Get half the length of the chord defined by the sector + /// See [`Arc2d::half_chord_length`] + fn half_chord_length(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::CircularSector::half_chord_length( &_self, ) .into(); output } - fn new(radius: f32, angle: f32) { + /// Create a new [`CircularSector`] from a `radius` and an `angle` + fn new(radius: f32, angle: f32) -> Val { let output: Val = bevy::math::primitives::CircularSector::new( radius, angle, @@ -1811,11 +2770,14 @@ impl bevy::math::primitives::CircularSector { .into(); output } - fn radius(_self: Ref) { + /// Get the radius of the sector + fn radius(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::CircularSector::radius(&_self).into(); output } - fn sagitta(_self: Ref) { + /// Get the length of the sagitta of this sector + /// See [`Arc2d::sagitta`] + fn sagitta(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::CircularSector::sagitta(&_self).into(); output } @@ -1826,33 +2788,44 @@ impl bevy::math::primitives::CircularSector { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::CircularSegment { - fn angle(_self: Ref) { + /// Get the angle of the segment + fn angle(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::CircularSegment::angle(&_self).into(); output } - fn apothem(_self: Ref) { + /// Get the length of the apothem of this segment, + /// which is the signed distance between the segment and the center of its circle + /// See [`Arc2d::apothem`] + fn apothem(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::CircularSegment::apothem(&_self) .into(); output } - fn arc_length(_self: Ref) { + /// Get the length of the arc defining the segment + fn arc_length(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::CircularSegment::arc_length(&_self) .into(); output } - fn chord_length(_self: Ref) { + /// Get the length of the segment's base, also known as its chord + fn chord_length(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::CircularSegment::chord_length(&_self) .into(); output } - fn chord_midpoint(_self: Ref) { + /// Get the midpoint of the segment's base, also known as its chord + fn chord_midpoint( + _self: Ref, + ) -> Val { let output: Val = bevy::math::primitives::CircularSegment::chord_midpoint( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -1862,14 +2835,18 @@ impl bevy::math::primitives::CircularSegment { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn from_degrees(radius: f32, angle: f32) { + /// Create a new [`CircularSegment`] from a `radius` and an `angle` in degrees. + fn from_degrees( + radius: f32, + angle: f32, + ) -> Val { let output: Val = bevy::math::primitives::CircularSegment::from_degrees( radius, angle, @@ -1877,7 +2854,11 @@ impl bevy::math::primitives::CircularSegment { .into(); output } - fn from_radians(radius: f32, angle: f32) { + /// Create a new [`CircularSegment`] from a `radius` and an `angle` in radians. + fn from_radians( + radius: f32, + angle: f32, + ) -> Val { let output: Val = bevy::math::primitives::CircularSegment::from_radians( radius, angle, @@ -1885,7 +2866,12 @@ impl bevy::math::primitives::CircularSegment { .into(); output } - fn from_turns(radius: f32, fraction: f32) { + /// Create a new [`CircularSegment`] from a `radius` and a number of `turns` of a circle. + /// For instance, `0.5` turns is a semicircle. + fn from_turns( + radius: f32, + fraction: f32, + ) -> Val { let output: Val = bevy::math::primitives::CircularSegment::from_turns( radius, fraction, @@ -1893,19 +2879,22 @@ impl bevy::math::primitives::CircularSegment { .into(); output } - fn half_angle(_self: Ref) { + /// Get the half-angle of the segment + fn half_angle(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::CircularSegment::half_angle(&_self) .into(); output } - fn half_chord_length(_self: Ref) { + /// Get half the length of the segment's base, also known as its chord + fn half_chord_length(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::CircularSegment::half_chord_length( &_self, ) .into(); output } - fn new(radius: f32, angle: f32) { + /// Create a new [`CircularSegment`] from a `radius`, and an `angle` + fn new(radius: f32, angle: f32) -> Val { let output: Val = bevy::math::primitives::CircularSegment::new( radius, angle, @@ -1913,11 +2902,14 @@ impl bevy::math::primitives::CircularSegment { .into(); output } - fn radius(_self: Ref) { + /// Get the radius of the segment + fn radius(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::CircularSegment::radius(&_self).into(); output } - fn sagitta(_self: Ref) { + /// Get the length of the sagitta of this segment, also known as its height + /// See [`Arc2d::sagitta`] + fn sagitta(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::CircularSegment::sagitta(&_self) .into(); output @@ -1929,39 +2921,52 @@ impl bevy::math::primitives::CircularSegment { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Ellipse { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eccentricity(_self: Ref) { + /// Returns the [eccentricity](https://en.wikipedia.org/wiki/Eccentricity_(mathematics)) of the ellipse. + /// It can be thought of as a measure of how "stretched" or elongated the ellipse is. + /// The value should be in the range [0, 1), where 0 represents a circle, and 1 represents a parabola. + fn eccentricity(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Ellipse::eccentricity(&_self).into(); output } fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn focal_length(_self: Ref) { + /// Get the focal length of the ellipse. This corresponds to the distance between one of the foci and the center of the ellipse. + /// The focal length of an ellipse is related to its eccentricity by `eccentricity = focal_length / semi_major` + fn focal_length(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Ellipse::focal_length(&_self).into(); output } - fn from_size(size: Val) { + /// Create a new `Ellipse` from a given full size. + /// `size.x` is the diameter along the X axis, and `size.y` is the diameter along the Y axis. + fn from_size( + size: Val, + ) -> Val { let output: Val = bevy::math::primitives::Ellipse::from_size( size.into_inner(), ) .into(); output } - fn new(half_width: f32, half_height: f32) { + /// Create a new `Ellipse` from half of its width and height. + /// This corresponds to the two perpendicular radii defining the ellipse. + fn new(half_width: f32, half_height: f32) -> Val { let output: Val = bevy::math::primitives::Ellipse::new( half_width, half_height, @@ -1969,11 +2974,13 @@ impl bevy::math::primitives::Ellipse { .into(); output } - fn semi_major(_self: Ref) { + /// Returns the length of the semi-major axis. This corresponds to the longest radius of the ellipse. + fn semi_major(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Ellipse::semi_major(&_self).into(); output } - fn semi_minor(_self: Ref) { + /// Returns the length of the semi-minor axis. This corresponds to the shortest radius of the ellipse. + fn semi_minor(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Ellipse::semi_minor(&_self).into(); output } @@ -1984,7 +2991,9 @@ impl bevy::math::primitives::Ellipse { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Line2d { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -1994,7 +3003,7 @@ impl bevy::math::primitives::Line2d { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -2008,7 +3017,9 @@ impl bevy::math::primitives::Line2d { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Plane2d { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -2018,14 +3029,19 @@ impl bevy::math::primitives::Plane2d { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn new(normal: Val) { + /// Create a new `Plane2d` from a normal + /// # Panics + /// Panics if the given `normal` is zero (or very close to zero), or non-finite. + fn new( + normal: Val, + ) -> Val { let output: Val = bevy::math::primitives::Plane2d::new( normal.into_inner(), ) @@ -2039,17 +3055,22 @@ impl bevy::math::primitives::Plane2d { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Rectangle { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } + /// Finds the point on the rectangle that is closest to the given `point`. + /// If the point is outside the rectangle, the returned point will be on the perimeter of the rectangle. + /// Otherwise, it will be inside the rectangle and returned as is. fn closest_point( _self: Ref, point: Val, - ) { + ) -> Val { let output: Val = bevy::math::primitives::Rectangle::closest_point( &_self, point.into_inner(), @@ -2060,17 +3081,18 @@ impl bevy::math::primitives::Rectangle { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } + /// Create a new `Rectangle` from two corner points fn from_corners( point1: Val, point2: Val, - ) { + ) -> Val { let output: Val = bevy::math::primitives::Rectangle::from_corners( point1.into_inner(), point2.into_inner(), @@ -2078,21 +3100,27 @@ impl bevy::math::primitives::Rectangle { .into(); output } - fn from_length(length: f32) { + /// Create a `Rectangle` from a single length. + /// The resulting `Rectangle` will be the same size in every direction. + fn from_length(length: f32) -> Val { let output: Val = bevy::math::primitives::Rectangle::from_length( length, ) .into(); output } - fn from_size(size: Val) { + /// Create a new `Rectangle` from a given full size + fn from_size( + size: Val, + ) -> Val { let output: Val = bevy::math::primitives::Rectangle::from_size( size.into_inner(), ) .into(); output } - fn new(width: f32, height: f32) { + /// Create a new `Rectangle` from a full width and height + fn new(width: f32, height: f32) -> Val { let output: Val = bevy::math::primitives::Rectangle::new( width, height, @@ -2100,7 +3128,10 @@ impl bevy::math::primitives::Rectangle { .into(); output } - fn size(_self: Ref) { + /// Get the size of the rectangle + fn size( + _self: Ref, + ) -> Val { let output: Val = bevy::math::primitives::Rectangle::size( &_self, ) @@ -2114,12 +3145,16 @@ impl bevy::math::primitives::Rectangle { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::RegularPolygon { - fn circumradius(_self: Ref) { + /// Get the radius of the circumcircle on which all vertices + /// of the regular polygon lie + fn circumradius(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::RegularPolygon::circumradius(&_self) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -2129,47 +3164,77 @@ impl bevy::math::primitives::RegularPolygon { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn external_angle_degrees(_self: Ref) { + /// Get the external angle of the regular polygon in degrees. + /// This is the angle formed by two adjacent sides with points + /// within the angle being in the exterior of the polygon + fn external_angle_degrees( + _self: Ref, + ) -> f32 { let output: f32 = bevy::math::primitives::RegularPolygon::external_angle_degrees( &_self, ) .into(); output } - fn external_angle_radians(_self: Ref) { + /// Get the external angle of the regular polygon in radians. + /// This is the angle formed by two adjacent sides with points + /// within the angle being in the exterior of the polygon + fn external_angle_radians( + _self: Ref, + ) -> f32 { let output: f32 = bevy::math::primitives::RegularPolygon::external_angle_radians( &_self, ) .into(); output } - fn inradius(_self: Ref) { + /// Get the inradius or apothem of the regular polygon. + /// This is the radius of the largest circle that can + /// be drawn within the polygon + fn inradius(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::RegularPolygon::inradius(&_self) .into(); output } - fn internal_angle_degrees(_self: Ref) { + /// Get the internal angle of the regular polygon in degrees. + /// This is the angle formed by two adjacent sides with points + /// within the angle being in the interior of the polygon + fn internal_angle_degrees( + _self: Ref, + ) -> f32 { let output: f32 = bevy::math::primitives::RegularPolygon::internal_angle_degrees( &_self, ) .into(); output } - fn internal_angle_radians(_self: Ref) { + /// Get the internal angle of the regular polygon in radians. + /// This is the angle formed by two adjacent sides with points + /// within the angle being in the interior of the polygon + fn internal_angle_radians( + _self: Ref, + ) -> f32 { let output: f32 = bevy::math::primitives::RegularPolygon::internal_angle_radians( &_self, ) .into(); output } - fn new(circumradius: f32, sides: u32) { + /// Create a new `RegularPolygon` + /// from the radius of the circumcircle and a number of sides + /// # Panics + /// Panics if `circumradius` is negative + fn new( + circumradius: f32, + sides: u32, + ) -> Val { let output: Val = bevy::math::primitives::RegularPolygon::new( circumradius, sides, @@ -2177,7 +3242,8 @@ impl bevy::math::primitives::RegularPolygon { .into(); output } - fn side_length(_self: Ref) { + /// Get the length of one side of the regular polygon + fn side_length(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::RegularPolygon::side_length(&_self) .into(); output @@ -2189,21 +3255,28 @@ impl bevy::math::primitives::RegularPolygon { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Rhombus { - fn circumradius(_self: Ref) { + /// Get the radius of the circumcircle on which all vertices + /// of the rhombus lie + fn circumradius(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Rhombus::circumradius(&_self).into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } + /// Finds the point on the rhombus that is closest to the given `point`. + /// If the point is outside the rhombus, the returned point will be on the perimeter of the rhombus. + /// Otherwise, it will be inside the rhombus and returned as is. fn closest_point( _self: Ref, point: Val, - ) { + ) -> Val { let output: Val = bevy::math::primitives::Rhombus::closest_point( &_self, point.into_inner(), @@ -2214,32 +3287,40 @@ impl bevy::math::primitives::Rhombus { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn from_inradius(inradius: f32) { + /// Create a new `Rhombus` from a given inradius with all inner angles equal. + fn from_inradius(inradius: f32) -> Val { let output: Val = bevy::math::primitives::Rhombus::from_inradius( inradius, ) .into(); output } - fn from_side(side: f32) { + /// Create a new `Rhombus` from a side length with all inner angles equal. + fn from_side(side: f32) -> Val { let output: Val = bevy::math::primitives::Rhombus::from_side( side, ) .into(); output } - fn inradius(_self: Ref) { + /// Get the radius of the largest circle that can + /// be drawn within the rhombus + fn inradius(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Rhombus::inradius(&_self).into(); output } - fn new(horizontal_diagonal: f32, vertical_diagonal: f32) { + /// Create a new `Rhombus` from a vertical and horizontal diagonal sizes. + fn new( + horizontal_diagonal: f32, + vertical_diagonal: f32, + ) -> Val { let output: Val = bevy::math::primitives::Rhombus::new( horizontal_diagonal, vertical_diagonal, @@ -2247,7 +3328,8 @@ impl bevy::math::primitives::Rhombus { .into(); output } - fn side(_self: Ref) { + /// Get the length of each side of the rhombus + fn side(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Rhombus::side(&_self).into(); output } @@ -2258,7 +3340,9 @@ impl bevy::math::primitives::Rhombus { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Segment2d { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -2268,14 +3352,18 @@ impl bevy::math::primitives::Segment2d { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn new(direction: Val, length: f32) { + /// Create a new `Segment2d` from a direction and full length of the segment + fn new( + direction: Val, + length: f32, + ) -> Val { let output: Val = bevy::math::primitives::Segment2d::new( direction.into_inner(), length, @@ -2283,14 +3371,20 @@ impl bevy::math::primitives::Segment2d { .into(); output } - fn point1(_self: Ref) { + /// Get the position of the first point on the line segment + fn point1( + _self: Ref, + ) -> Val { let output: Val = bevy::math::primitives::Segment2d::point1( &_self, ) .into(); output } - fn point2(_self: Ref) { + /// Get the position of the second point on the line segment + fn point2( + _self: Ref, + ) -> Val { let output: Val = bevy::math::primitives::Segment2d::point2( &_self, ) @@ -2304,7 +3398,9 @@ impl bevy::math::primitives::Segment2d { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Triangle2d { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -2314,31 +3410,37 @@ impl bevy::math::primitives::Triangle2d { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn is_acute(_self: Ref) { + /// Checks if the triangle is acute, meaning all angles are less than 90 degrees + fn is_acute(_self: Ref) -> bool { let output: bool = bevy::math::primitives::Triangle2d::is_acute(&_self).into(); output } - fn is_degenerate(_self: Ref) { + /// Checks if the triangle is degenerate, meaning it has zero area. + /// A triangle is degenerate if the cross product of the vectors `ab` and `ac` has a length less than `10e-7`. + /// This indicates that the three vertices are collinear or nearly collinear. + fn is_degenerate(_self: Ref) -> bool { let output: bool = bevy::math::primitives::Triangle2d::is_degenerate(&_self) .into(); output } - fn is_obtuse(_self: Ref) { + /// Checks if the triangle is obtuse, meaning one angle is greater than 90 degrees + fn is_obtuse(_self: Ref) -> bool { let output: bool = bevy::math::primitives::Triangle2d::is_obtuse(&_self).into(); output } + /// Create a new `Triangle2d` from points `a`, `b`, and `c` fn new( a: Val, b: Val, c: Val, - ) { + ) -> Val { let output: Val = bevy::math::primitives::Triangle2d::new( a.into_inner(), b.into_inner(), @@ -2347,11 +3449,16 @@ impl bevy::math::primitives::Triangle2d { .into(); output } - fn reverse(mut _self: Mut) { + /// Reverse the [`WindingOrder`] of the triangle + /// by swapping the first and last vertices. + fn reverse(mut _self: Mut) -> () { let output: () = bevy::math::primitives::Triangle2d::reverse(&mut _self).into(); output } - fn reversed(_self: Val) { + /// This triangle but reversed. + fn reversed( + _self: Val, + ) -> Val { let output: Val = bevy::math::primitives::Triangle2d::reversed( _self.into_inner(), ) @@ -2365,14 +3472,19 @@ impl bevy::math::primitives::Triangle2d { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::bounding::Aabb3d { - fn bounding_sphere(_self: Ref) { + /// Computes the smallest [`BoundingSphere`] containing this [`Aabb3d`]. + fn bounding_sphere( + _self: Ref, + ) -> Val { let output: Val = bevy::math::bounding::Aabb3d::bounding_sphere( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -2386,21 +3498,27 @@ impl bevy::math::bounding::Aabb3d { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::bounding::BoundingSphere { - fn aabb_3d(_self: Ref) { + /// Computes the smallest [`Aabb3d`] containing this [`BoundingSphere`]. + fn aabb_3d( + _self: Ref, + ) -> Val { let output: Val = bevy::math::bounding::BoundingSphere::aabb_3d( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn radius(_self: Ref) { + /// Get the radius of the bounding sphere + fn radius(_self: Ref) -> f32 { let output: f32 = bevy::math::bounding::BoundingSphere::radius(&_self).into(); output } @@ -2411,17 +3529,22 @@ impl bevy::math::bounding::BoundingSphere { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Sphere { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } + /// Finds the point on the sphere that is closest to the given `point`. + /// If the point is outside the sphere, the returned point will be on the surface of the sphere. + /// Otherwise, it will be inside the sphere and returned as is. fn closest_point( _self: Ref, point: Val, - ) { + ) -> Val { let output: Val = bevy::math::primitives::Sphere::closest_point( &_self, point.into_inner(), @@ -2429,21 +3552,23 @@ impl bevy::math::primitives::Sphere { .into(); output } - fn diameter(_self: Ref) { + /// Get the diameter of the sphere + fn diameter(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Sphere::diameter(&_self).into(); output } fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn new(radius: f32) { + /// Create a new [`Sphere`] from a `radius` + fn new(radius: f32) -> Val { let output: Val = bevy::math::primitives::Sphere::new( radius, ) @@ -2457,17 +3582,22 @@ impl bevy::math::primitives::Sphere { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Cuboid { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } + /// Finds the point on the cuboid that is closest to the given `point`. + /// If the point is outside the cuboid, the returned point will be on the surface of the cuboid. + /// Otherwise, it will be inside the cuboid and returned as is. fn closest_point( _self: Ref, point: Val, - ) { + ) -> Val { let output: Val = bevy::math::primitives::Cuboid::closest_point( &_self, point.into_inner(), @@ -2478,17 +3608,18 @@ impl bevy::math::primitives::Cuboid { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } + /// Create a new `Cuboid` from two corner points fn from_corners( point1: Val, point2: Val, - ) { + ) -> Val { let output: Val = bevy::math::primitives::Cuboid::from_corners( point1.into_inner(), point2.into_inner(), @@ -2496,21 +3627,31 @@ impl bevy::math::primitives::Cuboid { .into(); output } - fn from_length(length: f32) { + /// Create a `Cuboid` from a single length. + /// The resulting `Cuboid` will be the same size in every direction. + fn from_length(length: f32) -> Val { let output: Val = bevy::math::primitives::Cuboid::from_length( length, ) .into(); output } - fn from_size(size: Val) { + /// Create a new `Cuboid` from a given full size + fn from_size( + size: Val, + ) -> Val { let output: Val = bevy::math::primitives::Cuboid::from_size( size.into_inner(), ) .into(); output } - fn new(x_length: f32, y_length: f32, z_length: f32) { + /// Create a new `Cuboid` from a full x, y, and z length + fn new( + x_length: f32, + y_length: f32, + z_length: f32, + ) -> Val { let output: Val = bevy::math::primitives::Cuboid::new( x_length, y_length, @@ -2519,7 +3660,10 @@ impl bevy::math::primitives::Cuboid { .into(); output } - fn size(_self: Ref) { + /// Get the size of the cuboid + fn size( + _self: Ref, + ) -> Val { let output: Val = bevy::math::primitives::Cuboid::size( &_self, ) @@ -2533,18 +3677,24 @@ impl bevy::math::primitives::Cuboid { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Cylinder { - fn base(_self: Ref) { + /// Get the base of the cylinder as a [`Circle`] + fn base( + _self: Ref, + ) -> Val { let output: Val = bevy::math::primitives::Cylinder::base( &_self, ) .into(); output } - fn base_area(_self: Ref) { + /// Get the surface area of one base of the cylinder + fn base_area(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Cylinder::base_area(&_self).into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -2554,18 +3704,21 @@ impl bevy::math::primitives::Cylinder { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn lateral_area(_self: Ref) { + /// Get the surface area of the side of the cylinder, + /// also known as the lateral area + fn lateral_area(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Cylinder::lateral_area(&_self).into(); output } - fn new(radius: f32, height: f32) { + /// Create a new `Cylinder` from a radius and full height + fn new(radius: f32, height: f32) -> Val { let output: Val = bevy::math::primitives::Cylinder::new( radius, height, @@ -2580,7 +3733,9 @@ impl bevy::math::primitives::Cylinder { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Capsule3d { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -2590,14 +3745,15 @@ impl bevy::math::primitives::Capsule3d { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn new(radius: f32, length: f32) { + /// Create a new `Capsule3d` from a radius and length + fn new(radius: f32, length: f32) -> Val { let output: Val = bevy::math::primitives::Capsule3d::new( radius, length, @@ -2605,7 +3761,11 @@ impl bevy::math::primitives::Capsule3d { .into(); output } - fn to_cylinder(_self: Ref) { + /// Get the part connecting the hemispherical ends + /// of the capsule as a [`Cylinder`] + fn to_cylinder( + _self: Ref, + ) -> Val { let output: Val = bevy::math::primitives::Capsule3d::to_cylinder( &_self, ) @@ -2619,18 +3779,24 @@ impl bevy::math::primitives::Capsule3d { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Cone { - fn base(_self: Ref) { + /// Get the base of the cone as a [`Circle`] + fn base( + _self: Ref, + ) -> Val { let output: Val = bevy::math::primitives::Cone::base( &_self, ) .into(); output } - fn base_area(_self: Ref) { + /// Get the surface area of the base of the cone + fn base_area(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Cone::base_area(&_self).into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -2640,18 +3806,21 @@ impl bevy::math::primitives::Cone { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn lateral_area(_self: Ref) { + /// Get the surface area of the side of the cone, + /// also known as the lateral area + fn lateral_area(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Cone::lateral_area(&_self).into(); output } - fn new(radius: f32, height: f32) { + /// Create a new [`Cone`] from a radius and height. + fn new(radius: f32, height: f32) -> Val { let output: Val = bevy::math::primitives::Cone::new( radius, height, @@ -2659,7 +3828,9 @@ impl bevy::math::primitives::Cone { .into(); output } - fn slant_height(_self: Ref) { + /// Get the slant height of the cone, the length of the line segment + /// connecting a point on the base to the apex + fn slant_height(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Cone::slant_height(&_self).into(); output } @@ -2670,7 +3841,9 @@ impl bevy::math::primitives::Cone { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::ConicalFrustum { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -2680,7 +3853,7 @@ impl bevy::math::primitives::ConicalFrustum { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -2694,7 +3867,9 @@ impl bevy::math::primitives::ConicalFrustum { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::InfinitePlane3d { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -2704,17 +3879,35 @@ impl bevy::math::primitives::InfinitePlane3d { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } + /// Computes an [`Isometry3d`] which transforms points from the XY-plane to this plane with the + /// given `origin`. + /// ## Guarantees + /// * the transformation is a [congruence] meaning it will preserve all distances and angles of + /// the transformed geometry + /// * uses the least rotation possible to transform the geometry + /// * if two geometries are transformed with the same isometry, then the relations between + /// them, like distances, are also preserved + /// * compared to projections, the transformation is lossless (up to floating point errors) + /// reversible + /// ## Non-Guarantees + /// * the rotation used is generally not unique + /// * the orientation of the transformed geometry in the XY plane might be arbitrary, to + /// enforce some kind of alignment the user has to use an extra transformation ontop of this + /// one + /// See [`isometries_xy`] for example usescases. + /// [congruence]: https://en.wikipedia.org/wiki/Congruence_(geometry) + /// [`isometries_xy`]: `InfinitePlane3d::isometries_xy` fn isometry_from_xy( _self: Ref, origin: Val, - ) { + ) -> Val { let output: Val = bevy::math::primitives::InfinitePlane3d::isometry_from_xy( &_self, origin.into_inner(), @@ -2722,10 +3915,28 @@ impl bevy::math::primitives::InfinitePlane3d { .into(); output } + /// Computes an [`Isometry3d`] which transforms points from the plane in 3D space with the given + /// `origin` to the XY-plane. + /// ## Guarantees + /// * the transformation is a [congruence] meaning it will preserve all distances and angles of + /// the transformed geometry + /// * uses the least rotation possible to transform the geometry + /// * if two geometries are transformed with the same isometry, then the relations between + /// them, like distances, are also preserved + /// * compared to projections, the transformation is lossless (up to floating point errors) + /// reversible + /// ## Non-Guarantees + /// * the rotation used is generally not unique + /// * the orientation of the transformed geometry in the XY plane might be arbitrary, to + /// enforce some kind of alignment the user has to use an extra transformation ontop of this + /// one + /// See [`isometries_xy`] for example usescases. + /// [congruence]: https://en.wikipedia.org/wiki/Congruence_(geometry) + /// [`isometries_xy`]: `InfinitePlane3d::isometries_xy` fn isometry_into_xy( _self: Ref, origin: Val, - ) { + ) -> Val { let output: Val = bevy::math::primitives::InfinitePlane3d::isometry_into_xy( &_self, origin.into_inner(), @@ -2740,7 +3951,9 @@ impl bevy::math::primitives::InfinitePlane3d { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Line3d { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -2750,7 +3963,7 @@ impl bevy::math::primitives::Line3d { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -2764,7 +3977,9 @@ impl bevy::math::primitives::Line3d { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Segment3d { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -2774,14 +3989,18 @@ impl bevy::math::primitives::Segment3d { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn new(direction: Val, length: f32) { + /// Create a new `Segment3d` from a direction and full length of the segment + fn new( + direction: Val, + length: f32, + ) -> Val { let output: Val = bevy::math::primitives::Segment3d::new( direction.into_inner(), length, @@ -2789,14 +4008,20 @@ impl bevy::math::primitives::Segment3d { .into(); output } - fn point1(_self: Ref) { + /// Get the position of the first point on the line segment + fn point1( + _self: Ref, + ) -> Val { let output: Val = bevy::math::primitives::Segment3d::point1( &_self, ) .into(); output } - fn point2(_self: Ref) { + /// Get the position of the second point on the line segment + fn point2( + _self: Ref, + ) -> Val { let output: Val = bevy::math::primitives::Segment3d::point2( &_self, ) @@ -2810,7 +4035,9 @@ impl bevy::math::primitives::Segment3d { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Torus { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -2820,18 +4047,24 @@ impl bevy::math::primitives::Torus { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn inner_radius(_self: Ref) { + /// Get the inner radius of the torus. + /// For a ring torus, this corresponds to the radius of the hole, + /// or `major_radius - minor_radius` + fn inner_radius(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Torus::inner_radius(&_self).into(); output } - fn new(inner_radius: f32, outer_radius: f32) { + /// Create a new `Torus` from an inner and outer radius. + /// The inner radius is the radius of the hole, and the outer radius + /// is the radius of the entire object + fn new(inner_radius: f32, outer_radius: f32) -> Val { let output: Val = bevy::math::primitives::Torus::new( inner_radius, outer_radius, @@ -2839,7 +4072,10 @@ impl bevy::math::primitives::Torus { .into(); output } - fn outer_radius(_self: Ref) { + /// Get the outer radius of the torus. + /// This corresponds to the overall radius of the entire object, + /// or `major_radius + minor_radius` + fn outer_radius(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Torus::outer_radius(&_self).into(); output } @@ -2850,21 +4086,31 @@ impl bevy::math::primitives::Torus { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Triangle3d { - fn centroid(_self: Ref) { + /// Get the centroid of the triangle. + /// This function finds the geometric center of the triangle by averaging the vertices: + /// `centroid = (a + b + c) / 3`. + fn centroid( + _self: Ref, + ) -> Val { let output: Val = bevy::math::primitives::Triangle3d::centroid( &_self, ) .into(); output } - fn circumcenter(_self: Ref) { + /// Get the circumcenter of the triangle. + fn circumcenter( + _self: Ref, + ) -> Val { let output: Val = bevy::math::primitives::Triangle3d::circumcenter( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -2874,31 +4120,37 @@ impl bevy::math::primitives::Triangle3d { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn is_acute(_self: Ref) { + /// Checks if the triangle is acute, meaning all angles are less than 90 degrees + fn is_acute(_self: Ref) -> bool { let output: bool = bevy::math::primitives::Triangle3d::is_acute(&_self).into(); output } - fn is_degenerate(_self: Ref) { + /// Checks if the triangle is degenerate, meaning it has zero area. + /// A triangle is degenerate if the cross product of the vectors `ab` and `ac` has a length less than `10e-7`. + /// This indicates that the three vertices are collinear or nearly collinear. + fn is_degenerate(_self: Ref) -> bool { let output: bool = bevy::math::primitives::Triangle3d::is_degenerate(&_self) .into(); output } - fn is_obtuse(_self: Ref) { + /// Checks if the triangle is obtuse, meaning one angle is greater than 90 degrees + fn is_obtuse(_self: Ref) -> bool { let output: bool = bevy::math::primitives::Triangle3d::is_obtuse(&_self).into(); output } + /// Create a new [`Triangle3d`] from points `a`, `b`, and `c`. fn new( a: Val, b: Val, c: Val, - ) { + ) -> Val { let output: Val = bevy::math::primitives::Triangle3d::new( a.into_inner(), b.into_inner(), @@ -2907,11 +4159,15 @@ impl bevy::math::primitives::Triangle3d { .into(); output } - fn reverse(mut _self: Mut) { + /// Reverse the triangle by swapping the first and last vertices. + fn reverse(mut _self: Mut) -> () { let output: () = bevy::math::primitives::Triangle3d::reverse(&mut _self).into(); output } - fn reversed(_self: Val) { + /// This triangle but reversed. + fn reversed( + _self: Val, + ) -> Val { let output: Val = bevy::math::primitives::Triangle3d::reversed( _self.into_inner(), ) @@ -2925,10 +4181,11 @@ impl bevy::math::primitives::Triangle3d { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::bounding::RayCast2d { + /// Get the distance of an intersection with an [`Aabb2d`], if any. fn aabb_intersection_at( _self: Ref, aabb: Ref, - ) { + ) -> std::option::Option { let output: std::option::Option = bevy::math::bounding::RayCast2d::aabb_intersection_at( &_self, &aabb, @@ -2936,10 +4193,11 @@ impl bevy::math::bounding::RayCast2d { .into(); output } + /// Get the distance of an intersection with a [`BoundingCircle`], if any. fn circle_intersection_at( _self: Ref, circle: Ref, - ) { + ) -> std::option::Option { let output: std::option::Option = bevy::math::bounding::RayCast2d::circle_intersection_at( &_self, &circle, @@ -2947,21 +4205,30 @@ impl bevy::math::bounding::RayCast2d { .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn direction_recip(_self: Ref) { + /// Get the cached multiplicative inverse of the direction of the ray. + fn direction_recip( + _self: Ref, + ) -> Val { let output: Val = bevy::math::bounding::RayCast2d::direction_recip( &_self, ) .into(); output } - fn from_ray(ray: Val, max: f32) { + /// Construct a [`RayCast2d`] from a [`Ray2d`] and max distance. + fn from_ray( + ray: Val, + max: f32, + ) -> Val { let output: Val = bevy::math::bounding::RayCast2d::from_ray( ray.into_inner(), max, @@ -2969,11 +4236,12 @@ impl bevy::math::bounding::RayCast2d { .into(); output } + /// Construct a [`RayCast2d`] from an origin, [`Dir2`], and max distance. fn new( origin: Val, direction: Val, max: f32, - ) { + ) -> Val { let output: Val = bevy::math::bounding::RayCast2d::new( origin.into_inner(), direction.into_inner(), @@ -2989,10 +4257,11 @@ impl bevy::math::bounding::RayCast2d { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::bounding::AabbCast2d { + /// Get the distance at which the [`Aabb2d`]s collide, if at all. fn aabb_collision_at( _self: Ref, aabb: Val, - ) { + ) -> std::option::Option { let output: std::option::Option = bevy::math::bounding::AabbCast2d::aabb_collision_at( &_self, aabb.into_inner(), @@ -3000,18 +4269,21 @@ impl bevy::math::bounding::AabbCast2d { .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } + /// Construct an [`AabbCast2d`] from an [`Aabb2d`], [`Ray2d`], and max distance. fn from_ray( aabb: Val, ray: Val, max: f32, - ) { + ) -> Val { let output: Val = bevy::math::bounding::AabbCast2d::from_ray( aabb.into_inner(), ray.into_inner(), @@ -3020,12 +4292,13 @@ impl bevy::math::bounding::AabbCast2d { .into(); output } + /// Construct an [`AabbCast2d`] from an [`Aabb2d`], origin, [`Dir2`], and max distance. fn new( aabb: Val, origin: Val, direction: Val, max: f32, - ) { + ) -> Val { let output: Val = bevy::math::bounding::AabbCast2d::new( aabb.into_inner(), origin.into_inner(), @@ -3042,10 +4315,11 @@ impl bevy::math::bounding::AabbCast2d { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::bounding::BoundingCircleCast { + /// Get the distance at which the [`BoundingCircle`]s collide, if at all. fn circle_collision_at( _self: Ref, circle: Val, - ) { + ) -> std::option::Option { let output: std::option::Option = bevy::math::bounding::BoundingCircleCast::circle_collision_at( &_self, circle.into_inner(), @@ -3053,18 +4327,21 @@ impl bevy::math::bounding::BoundingCircleCast { .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } + /// Construct a [`BoundingCircleCast`] from a [`BoundingCircle`], [`Ray2d`], and max distance. fn from_ray( circle: Val, ray: Val, max: f32, - ) { + ) -> Val { let output: Val = bevy::math::bounding::BoundingCircleCast::from_ray( circle.into_inner(), ray.into_inner(), @@ -3073,12 +4350,13 @@ impl bevy::math::bounding::BoundingCircleCast { .into(); output } + /// Construct a [`BoundingCircleCast`] from a [`BoundingCircle`], origin, [`Dir2`], and max distance. fn new( circle: Val, origin: Val, direction: Val, max: f32, - ) { + ) -> Val { let output: Val = bevy::math::bounding::BoundingCircleCast::new( circle.into_inner(), origin.into_inner(), @@ -3095,10 +4373,11 @@ impl bevy::math::bounding::BoundingCircleCast { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::bounding::RayCast3d { + /// Get the distance of an intersection with an [`Aabb3d`], if any. fn aabb_intersection_at( _self: Ref, aabb: Ref, - ) { + ) -> std::option::Option { let output: std::option::Option = bevy::math::bounding::RayCast3d::aabb_intersection_at( &_self, &aabb, @@ -3106,21 +4385,30 @@ impl bevy::math::bounding::RayCast3d { .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn direction_recip(_self: Ref) { + /// Get the cached multiplicative inverse of the direction of the ray. + fn direction_recip( + _self: Ref, + ) -> Val { let output: Val = bevy::math::bounding::RayCast3d::direction_recip( &_self, ) .into(); output } - fn from_ray(ray: Val, max: f32) { + /// Construct a [`RayCast3d`] from a [`Ray3d`] and max distance. + fn from_ray( + ray: Val, + max: f32, + ) -> Val { let output: Val = bevy::math::bounding::RayCast3d::from_ray( ray.into_inner(), max, @@ -3128,10 +4416,11 @@ impl bevy::math::bounding::RayCast3d { .into(); output } + /// Get the distance of an intersection with a [`BoundingSphere`], if any. fn sphere_intersection_at( _self: Ref, sphere: Ref, - ) { + ) -> std::option::Option { let output: std::option::Option = bevy::math::bounding::RayCast3d::sphere_intersection_at( &_self, &sphere, @@ -3146,10 +4435,11 @@ impl bevy::math::bounding::RayCast3d { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::bounding::AabbCast3d { + /// Get the distance at which the [`Aabb3d`]s collide, if at all. fn aabb_collision_at( _self: Ref, aabb: Val, - ) { + ) -> std::option::Option { let output: std::option::Option = bevy::math::bounding::AabbCast3d::aabb_collision_at( &_self, aabb.into_inner(), @@ -3157,18 +4447,21 @@ impl bevy::math::bounding::AabbCast3d { .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } + /// Construct an [`AabbCast3d`] from an [`Aabb3d`], [`Ray3d`], and max distance. fn from_ray( aabb: Val, ray: Val, max: f32, - ) { + ) -> Val { let output: Val = bevy::math::bounding::AabbCast3d::from_ray( aabb.into_inner(), ray.into_inner(), @@ -3184,18 +4477,21 @@ impl bevy::math::bounding::AabbCast3d { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::bounding::BoundingSphereCast { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } + /// Construct a [`BoundingSphereCast`] from a [`BoundingSphere`], [`Ray3d`], and max distance. fn from_ray( sphere: Val, ray: Val, max: f32, - ) { + ) -> Val { let output: Val = bevy::math::bounding::BoundingSphereCast::from_ray( sphere.into_inner(), ray.into_inner(), @@ -3204,10 +4500,11 @@ impl bevy::math::bounding::BoundingSphereCast { .into(); output } + /// Get the distance at which the [`BoundingSphere`]s collide, if at all. fn sphere_collision_at( _self: Ref, sphere: Val, - ) { + ) -> std::option::Option { let output: std::option::Option = bevy::math::bounding::BoundingSphereCast::sphere_collision_at( &_self, sphere.into_inner(), @@ -3222,7 +4519,8 @@ impl bevy::math::bounding::BoundingSphereCast { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::curve::interval::Interval { - fn clamp(_self: Val, value: f32) { + /// Clamp the given `value` to lie within this interval. + fn clamp(_self: Val, value: f32) -> f32 { let output: f32 = bevy::math::curve::interval::Interval::clamp( _self.into_inner(), value, @@ -3230,14 +4528,17 @@ impl bevy::math::curve::interval::Interval { .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn contains(_self: Val, item: f32) { + /// Returns `true` if `item` is contained in this interval. + fn contains(_self: Val, item: f32) -> bool { let output: bool = bevy::math::curve::interval::Interval::contains( _self.into_inner(), item, @@ -3245,10 +4546,12 @@ impl bevy::math::curve::interval::Interval { .into(); output } + /// Returns `true` if the other interval is contained in this interval. + /// This is non-strict: each interval will contain itself. fn contains_interval( _self: Val, other: Val, - ) { + ) -> bool { let output: bool = bevy::math::curve::interval::Interval::contains_interval( _self.into_inner(), other.into_inner(), @@ -3256,7 +4559,8 @@ impl bevy::math::curve::interval::Interval { .into(); output } - fn end(_self: Val) { + /// Get the end of this interval. + fn end(_self: Val) -> f32 { let output: f32 = bevy::math::curve::interval::Interval::end(_self.into_inner()) .into(); output @@ -3264,42 +4568,48 @@ impl bevy::math::curve::interval::Interval { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn has_finite_end(_self: Val) { + /// Returns `true` if this interval has a finite end. + fn has_finite_end(_self: Val) -> bool { let output: bool = bevy::math::curve::interval::Interval::has_finite_end( _self.into_inner(), ) .into(); output } - fn has_finite_start(_self: Val) { + /// Returns `true` if this interval has a finite start. + fn has_finite_start(_self: Val) -> bool { let output: bool = bevy::math::curve::interval::Interval::has_finite_start( _self.into_inner(), ) .into(); output } - fn is_bounded(_self: Val) { + /// Returns `true` if this interval is bounded — that is, if both its start and end are finite. + /// Equivalently, an interval is bounded if its length is finite. + fn is_bounded(_self: Val) -> bool { let output: bool = bevy::math::curve::interval::Interval::is_bounded( _self.into_inner(), ) .into(); output } - fn length(_self: Val) { + /// Get the length of this interval. Note that the result may be infinite (`f32::INFINITY`). + fn length(_self: Val) -> f32 { let output: f32 = bevy::math::curve::interval::Interval::length( _self.into_inner(), ) .into(); output } - fn start(_self: Val) { + /// Get the start of this interval. + fn start(_self: Val) -> f32 { let output: f32 = bevy::math::curve::interval::Interval::start( _self.into_inner(), ) @@ -3313,49 +4623,49 @@ impl bevy::math::curve::interval::Interval { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::FloatOrd { - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn ge(_self: Ref, other: Ref) { + fn ge(_self: Ref, other: Ref) -> bool { let output: bool = >::ge(&_self, &other) .into(); output } - fn gt(_self: Ref, other: Ref) { + fn gt(_self: Ref, other: Ref) -> bool { let output: bool = >::gt(&_self, &other) .into(); output } - fn le(_self: Ref, other: Ref) { + fn le(_self: Ref, other: Ref) -> bool { let output: bool = >::le(&_self, &other) .into(); output } - fn lt(_self: Ref, other: Ref) { + fn lt(_self: Ref, other: Ref) -> bool { let output: bool = >::lt(&_self, &other) .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) @@ -3369,7 +4679,9 @@ impl bevy::math::FloatOrd { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Plane3d { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -3379,17 +4691,20 @@ impl bevy::math::primitives::Plane3d { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } + /// Create a new `Plane3d` from a normal and a half size + /// # Panics + /// Panics if the given `normal` is zero (or very close to zero), or non-finite. fn new( normal: Val, half_size: Val, - ) { + ) -> Val { let output: Val = bevy::math::primitives::Plane3d::new( normal.into_inner(), half_size.into_inner(), @@ -3404,14 +4719,21 @@ impl bevy::math::primitives::Plane3d { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::primitives::Tetrahedron { - fn centroid(_self: Ref) { + /// Get the centroid of the tetrahedron. + /// This function finds the geometric center of the tetrahedron + /// by averaging the vertices: `centroid = (a + b + c + d) / 4`. + fn centroid( + _self: Ref, + ) -> Val { let output: Val = bevy::math::primitives::Tetrahedron::centroid( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -3421,19 +4743,20 @@ impl bevy::math::primitives::Tetrahedron { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } + /// Create a new [`Tetrahedron`] from points `a`, `b`, `c` and `d`. fn new( a: Val, b: Val, c: Val, d: Val, - ) { + ) -> Val { let output: Val = bevy::math::primitives::Tetrahedron::new( a.into_inner(), b.into_inner(), @@ -3443,7 +4766,11 @@ impl bevy::math::primitives::Tetrahedron { .into(); output } - fn signed_volume(_self: Ref) { + /// Get the signed volume of the tetrahedron. + /// If it's negative, the normal vector of the face defined by + /// the first three points using the right-hand rule points + /// away from the fourth vertex. + fn signed_volume(_self: Ref) -> f32 { let output: f32 = bevy::math::primitives::Tetrahedron::signed_volume(&_self) .into(); output @@ -3455,7 +4782,9 @@ impl bevy::math::primitives::Tetrahedron { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::curve::easing::EaseFunction { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -3465,7 +4794,7 @@ impl bevy::math::curve::easing::EaseFunction { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_reflect.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_reflect.rs index 172b81a9e2..83ad7639a1 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_reflect.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_reflect.rs @@ -18,12 +18,28 @@ pub struct BevyReflectScriptingPlugin; bms_core_path = "bevy_mod_scripting_core" )] impl std::sync::atomic::AtomicBool { - fn into_inner(_self: Val) { + /// Consumes the atomic and returns the contained value. + /// This is safe because passing `self` by value guarantees that no other threads are + /// concurrently accessing the atomic data. + /// # Examples + /// ``` + /// use std::sync::atomic::AtomicBool; + /// let some_bool = AtomicBool::new(true); + /// assert_eq!(some_bool.into_inner(), true); + /// ``` + fn into_inner(_self: Val) -> bool { let output: bool = std::sync::atomic::AtomicBool::into_inner(_self.into_inner()) .into(); output } - fn new(v: bool) { + /// Creates a new `AtomicBool`. + /// # Examples + /// ``` + /// use std::sync::atomic::AtomicBool; + /// let atomic_true = AtomicBool::new(true); + /// let atomic_false = AtomicBool::new(false); + /// ``` + fn new(v: bool) -> Val { let output: Val = std::sync::atomic::AtomicBool::new( v, ) @@ -37,12 +53,27 @@ impl std::sync::atomic::AtomicBool { bms_core_path = "bevy_mod_scripting_core" )] impl std::sync::atomic::AtomicI16 { - fn into_inner(_self: Val) { + /// Consumes the atomic and returns the contained value. + /// This is safe because passing `self` by value guarantees that no other threads are + /// concurrently accessing the atomic data. + /// # Examples + /// ``` + /// use std::sync::atomic::AtomicI16; + /// let some_var = AtomicI16::new(5); + /// assert_eq!(some_var.into_inner(), 5); + /// ``` + fn into_inner(_self: Val) -> i16 { let output: i16 = std::sync::atomic::AtomicI16::into_inner(_self.into_inner()) .into(); output } - fn new(v: i16) { + /// Creates a new atomic integer. + /// # Examples + /// ``` + /// use std::sync::atomic::AtomicI16; + /// let atomic_forty_two = AtomicI16::new(42); + /// ``` + fn new(v: i16) -> Val { let output: Val = std::sync::atomic::AtomicI16::new( v, ) @@ -56,12 +87,27 @@ impl std::sync::atomic::AtomicI16 { bms_core_path = "bevy_mod_scripting_core" )] impl std::sync::atomic::AtomicI32 { - fn into_inner(_self: Val) { + /// Consumes the atomic and returns the contained value. + /// This is safe because passing `self` by value guarantees that no other threads are + /// concurrently accessing the atomic data. + /// # Examples + /// ``` + /// use std::sync::atomic::AtomicI32; + /// let some_var = AtomicI32::new(5); + /// assert_eq!(some_var.into_inner(), 5); + /// ``` + fn into_inner(_self: Val) -> i32 { let output: i32 = std::sync::atomic::AtomicI32::into_inner(_self.into_inner()) .into(); output } - fn new(v: i32) { + /// Creates a new atomic integer. + /// # Examples + /// ``` + /// use std::sync::atomic::AtomicI32; + /// let atomic_forty_two = AtomicI32::new(42); + /// ``` + fn new(v: i32) -> Val { let output: Val = std::sync::atomic::AtomicI32::new( v, ) @@ -75,12 +121,27 @@ impl std::sync::atomic::AtomicI32 { bms_core_path = "bevy_mod_scripting_core" )] impl std::sync::atomic::AtomicI64 { - fn into_inner(_self: Val) { + /// Consumes the atomic and returns the contained value. + /// This is safe because passing `self` by value guarantees that no other threads are + /// concurrently accessing the atomic data. + /// # Examples + /// ``` + /// use std::sync::atomic::AtomicI64; + /// let some_var = AtomicI64::new(5); + /// assert_eq!(some_var.into_inner(), 5); + /// ``` + fn into_inner(_self: Val) -> i64 { let output: i64 = std::sync::atomic::AtomicI64::into_inner(_self.into_inner()) .into(); output } - fn new(v: i64) { + /// Creates a new atomic integer. + /// # Examples + /// ``` + /// use std::sync::atomic::AtomicI64; + /// let atomic_forty_two = AtomicI64::new(42); + /// ``` + fn new(v: i64) -> Val { let output: Val = std::sync::atomic::AtomicI64::new( v, ) @@ -94,12 +155,27 @@ impl std::sync::atomic::AtomicI64 { bms_core_path = "bevy_mod_scripting_core" )] impl std::sync::atomic::AtomicI8 { - fn into_inner(_self: Val) { + /// Consumes the atomic and returns the contained value. + /// This is safe because passing `self` by value guarantees that no other threads are + /// concurrently accessing the atomic data. + /// # Examples + /// ``` + /// use std::sync::atomic::AtomicI8; + /// let some_var = AtomicI8::new(5); + /// assert_eq!(some_var.into_inner(), 5); + /// ``` + fn into_inner(_self: Val) -> i8 { let output: i8 = std::sync::atomic::AtomicI8::into_inner(_self.into_inner()) .into(); output } - fn new(v: i8) { + /// Creates a new atomic integer. + /// # Examples + /// ``` + /// use std::sync::atomic::AtomicI8; + /// let atomic_forty_two = AtomicI8::new(42); + /// ``` + fn new(v: i8) -> Val { let output: Val = std::sync::atomic::AtomicI8::new( v, ) @@ -113,14 +189,29 @@ impl std::sync::atomic::AtomicI8 { bms_core_path = "bevy_mod_scripting_core" )] impl std::sync::atomic::AtomicIsize { - fn into_inner(_self: Val) { + /// Consumes the atomic and returns the contained value. + /// This is safe because passing `self` by value guarantees that no other threads are + /// concurrently accessing the atomic data. + /// # Examples + /// ``` + /// use std::sync::atomic::AtomicIsize; + /// let some_var = AtomicIsize::new(5); + /// assert_eq!(some_var.into_inner(), 5); + /// ``` + fn into_inner(_self: Val) -> isize { let output: isize = std::sync::atomic::AtomicIsize::into_inner( _self.into_inner(), ) .into(); output } - fn new(v: isize) { + /// Creates a new atomic integer. + /// # Examples + /// ``` + /// use std::sync::atomic::AtomicIsize; + /// let atomic_forty_two = AtomicIsize::new(42); + /// ``` + fn new(v: isize) -> Val { let output: Val = std::sync::atomic::AtomicIsize::new( v, ) @@ -134,12 +225,27 @@ impl std::sync::atomic::AtomicIsize { bms_core_path = "bevy_mod_scripting_core" )] impl std::sync::atomic::AtomicU16 { - fn into_inner(_self: Val) { + /// Consumes the atomic and returns the contained value. + /// This is safe because passing `self` by value guarantees that no other threads are + /// concurrently accessing the atomic data. + /// # Examples + /// ``` + /// use std::sync::atomic::AtomicU16; + /// let some_var = AtomicU16::new(5); + /// assert_eq!(some_var.into_inner(), 5); + /// ``` + fn into_inner(_self: Val) -> u16 { let output: u16 = std::sync::atomic::AtomicU16::into_inner(_self.into_inner()) .into(); output } - fn new(v: u16) { + /// Creates a new atomic integer. + /// # Examples + /// ``` + /// use std::sync::atomic::AtomicU16; + /// let atomic_forty_two = AtomicU16::new(42); + /// ``` + fn new(v: u16) -> Val { let output: Val = std::sync::atomic::AtomicU16::new( v, ) @@ -153,12 +259,27 @@ impl std::sync::atomic::AtomicU16 { bms_core_path = "bevy_mod_scripting_core" )] impl std::sync::atomic::AtomicU32 { - fn into_inner(_self: Val) { + /// Consumes the atomic and returns the contained value. + /// This is safe because passing `self` by value guarantees that no other threads are + /// concurrently accessing the atomic data. + /// # Examples + /// ``` + /// use std::sync::atomic::AtomicU32; + /// let some_var = AtomicU32::new(5); + /// assert_eq!(some_var.into_inner(), 5); + /// ``` + fn into_inner(_self: Val) -> u32 { let output: u32 = std::sync::atomic::AtomicU32::into_inner(_self.into_inner()) .into(); output } - fn new(v: u32) { + /// Creates a new atomic integer. + /// # Examples + /// ``` + /// use std::sync::atomic::AtomicU32; + /// let atomic_forty_two = AtomicU32::new(42); + /// ``` + fn new(v: u32) -> Val { let output: Val = std::sync::atomic::AtomicU32::new( v, ) @@ -172,12 +293,27 @@ impl std::sync::atomic::AtomicU32 { bms_core_path = "bevy_mod_scripting_core" )] impl std::sync::atomic::AtomicU64 { - fn into_inner(_self: Val) { + /// Consumes the atomic and returns the contained value. + /// This is safe because passing `self` by value guarantees that no other threads are + /// concurrently accessing the atomic data. + /// # Examples + /// ``` + /// use std::sync::atomic::AtomicU64; + /// let some_var = AtomicU64::new(5); + /// assert_eq!(some_var.into_inner(), 5); + /// ``` + fn into_inner(_self: Val) -> u64 { let output: u64 = std::sync::atomic::AtomicU64::into_inner(_self.into_inner()) .into(); output } - fn new(v: u64) { + /// Creates a new atomic integer. + /// # Examples + /// ``` + /// use std::sync::atomic::AtomicU64; + /// let atomic_forty_two = AtomicU64::new(42); + /// ``` + fn new(v: u64) -> Val { let output: Val = std::sync::atomic::AtomicU64::new( v, ) @@ -191,12 +327,27 @@ impl std::sync::atomic::AtomicU64 { bms_core_path = "bevy_mod_scripting_core" )] impl std::sync::atomic::AtomicU8 { - fn into_inner(_self: Val) { + /// Consumes the atomic and returns the contained value. + /// This is safe because passing `self` by value guarantees that no other threads are + /// concurrently accessing the atomic data. + /// # Examples + /// ``` + /// use std::sync::atomic::AtomicU8; + /// let some_var = AtomicU8::new(5); + /// assert_eq!(some_var.into_inner(), 5); + /// ``` + fn into_inner(_self: Val) -> u8 { let output: u8 = std::sync::atomic::AtomicU8::into_inner(_self.into_inner()) .into(); output } - fn new(v: u8) { + /// Creates a new atomic integer. + /// # Examples + /// ``` + /// use std::sync::atomic::AtomicU8; + /// let atomic_forty_two = AtomicU8::new(42); + /// ``` + fn new(v: u8) -> Val { let output: Val = std::sync::atomic::AtomicU8::new( v, ) @@ -210,14 +361,29 @@ impl std::sync::atomic::AtomicU8 { bms_core_path = "bevy_mod_scripting_core" )] impl std::sync::atomic::AtomicUsize { - fn into_inner(_self: Val) { + /// Consumes the atomic and returns the contained value. + /// This is safe because passing `self` by value guarantees that no other threads are + /// concurrently accessing the atomic data. + /// # Examples + /// ``` + /// use std::sync::atomic::AtomicUsize; + /// let some_var = AtomicUsize::new(5); + /// assert_eq!(some_var.into_inner(), 5); + /// ``` + fn into_inner(_self: Val) -> usize { let output: usize = std::sync::atomic::AtomicUsize::into_inner( _self.into_inner(), ) .into(); output } - fn new(v: usize) { + /// Creates a new atomic integer. + /// # Examples + /// ``` + /// use std::sync::atomic::AtomicUsize; + /// let atomic_forty_two = AtomicUsize::new(42); + /// ``` + fn new(v: usize) -> Val { let output: Val = std::sync::atomic::AtomicUsize::new( v, ) @@ -231,7 +397,17 @@ impl std::sync::atomic::AtomicUsize { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::utils::Duration { - fn abs_diff(_self: Val, other: Val) { + /// Computes the absolute difference between `self` and `other`. + /// # Examples + /// ``` + /// use std::time::Duration; + /// assert_eq!(Duration::new(100, 0).abs_diff(Duration::new(80, 0)), Duration::new(20, 0)); + /// assert_eq!(Duration::new(100, 400_000_000).abs_diff(Duration::new(110, 0)), Duration::new(9, 600_000_000)); + /// ``` + fn abs_diff( + _self: Val, + other: Val, + ) -> Val { let output: Val = bevy::utils::Duration::abs_diff( _self.into_inner(), other.into_inner(), @@ -239,62 +415,124 @@ impl bevy::utils::Duration { .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn as_micros(_self: Ref) { + /// Returns the total number of whole microseconds contained by this `Duration`. + /// # Examples + /// ``` + /// use std::time::Duration; + /// let duration = Duration::new(5, 730_023_852); + /// assert_eq!(duration.as_micros(), 5_730_023); + /// ``` + fn as_micros(_self: Ref) -> u128 { let output: u128 = bevy::utils::Duration::as_micros(&_self).into(); output } - fn as_millis(_self: Ref) { + /// Returns the total number of whole milliseconds contained by this `Duration`. + /// # Examples + /// ``` + /// use std::time::Duration; + /// let duration = Duration::new(5, 730_023_852); + /// assert_eq!(duration.as_millis(), 5_730); + /// ``` + fn as_millis(_self: Ref) -> u128 { let output: u128 = bevy::utils::Duration::as_millis(&_self).into(); output } - fn as_nanos(_self: Ref) { + /// Returns the total number of nanoseconds contained by this `Duration`. + /// # Examples + /// ``` + /// use std::time::Duration; + /// let duration = Duration::new(5, 730_023_852); + /// assert_eq!(duration.as_nanos(), 5_730_023_852); + /// ``` + fn as_nanos(_self: Ref) -> u128 { let output: u128 = bevy::utils::Duration::as_nanos(&_self).into(); output } - fn as_secs(_self: Ref) { + /// Returns the number of _whole_ seconds contained by this `Duration`. + /// The returned value does not include the fractional (nanosecond) part of the + /// duration, which can be obtained using [`subsec_nanos`]. + /// # Examples + /// ``` + /// use std::time::Duration; + /// let duration = Duration::new(5, 730_023_852); + /// assert_eq!(duration.as_secs(), 5); + /// ``` + /// To determine the total number of seconds represented by the `Duration` + /// including the fractional part, use [`as_secs_f64`] or [`as_secs_f32`] + /// [`as_secs_f64`]: Duration::as_secs_f64 + /// [`as_secs_f32`]: Duration::as_secs_f32 + /// [`subsec_nanos`]: Duration::subsec_nanos + fn as_secs(_self: Ref) -> u64 { let output: u64 = bevy::utils::Duration::as_secs(&_self).into(); output } - fn as_secs_f32(_self: Ref) { + /// Returns the number of seconds contained by this `Duration` as `f32`. + /// The returned value includes the fractional (nanosecond) part of the duration. + /// # Examples + /// ``` + /// use std::time::Duration; + /// let dur = Duration::new(2, 700_000_000); + /// assert_eq!(dur.as_secs_f32(), 2.7); + /// ``` + fn as_secs_f32(_self: Ref) -> f32 { let output: f32 = bevy::utils::Duration::as_secs_f32(&_self).into(); output } - fn as_secs_f64(_self: Ref) { + /// Returns the number of seconds contained by this `Duration` as `f64`. + /// The returned value includes the fractional (nanosecond) part of the duration. + /// # Examples + /// ``` + /// use std::time::Duration; + /// let dur = Duration::new(2, 700_000_000); + /// assert_eq!(dur.as_secs_f64(), 2.7); + /// ``` + fn as_secs_f64(_self: Ref) -> f64 { let output: f64 = bevy::utils::Duration::as_secs_f64(&_self).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn div(_self: Val, rhs: u32) { + fn div(_self: Val, rhs: u32) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } + /// Divides `Duration` by `Duration` and returns `f32`. + /// # Examples + /// ``` + /// use std::time::Duration; + /// let dur1 = Duration::new(2, 700_000_000); + /// let dur2 = Duration::new(5, 400_000_000); + /// assert_eq!(dur1.div_duration_f32(dur2), 0.5); + /// ``` fn div_duration_f32( _self: Val, rhs: Val, - ) { + ) -> f32 { let output: f32 = bevy::utils::Duration::div_duration_f32( _self.into_inner(), rhs.into_inner(), @@ -302,10 +540,18 @@ impl bevy::utils::Duration { .into(); output } + /// Divides `Duration` by `Duration` and returns `f64`. + /// # Examples + /// ``` + /// use std::time::Duration; + /// let dur1 = Duration::new(2, 700_000_000); + /// let dur2 = Duration::new(5, 400_000_000); + /// assert_eq!(dur1.div_duration_f64(dur2), 0.5); + /// ``` fn div_duration_f64( _self: Val, rhs: Val, - ) { + ) -> f64 { let output: f64 = bevy::utils::Duration::div_duration_f64( _self.into_inner(), rhs.into_inner(), @@ -313,7 +559,22 @@ impl bevy::utils::Duration { .into(); output } - fn div_f32(_self: Val, rhs: f32) { + /// Divides `Duration` by `f32`. + /// # Panics + /// This method will panic if result is negative, overflows `Duration` or not finite. + /// # Examples + /// ``` + /// use std::time::Duration; + /// let dur = Duration::new(2, 700_000_000); + /// // note that due to rounding errors result is slightly + /// // different from 0.859_872_611 + /// assert_eq!(dur.div_f32(3.14), Duration::new(0, 859_872_580)); + /// assert_eq!(dur.div_f32(3.14e5), Duration::new(0, 8_599)); + /// ``` + fn div_f32( + _self: Val, + rhs: f32, + ) -> Val { let output: Val = bevy::utils::Duration::div_f32( _self.into_inner(), rhs, @@ -321,7 +582,20 @@ impl bevy::utils::Duration { .into(); output } - fn div_f64(_self: Val, rhs: f64) { + /// Divides `Duration` by `f64`. + /// # Panics + /// This method will panic if result is negative, overflows `Duration` or not finite. + /// # Examples + /// ``` + /// use std::time::Duration; + /// let dur = Duration::new(2, 700_000_000); + /// assert_eq!(dur.div_f64(3.14), Duration::new(0, 859_872_611)); + /// assert_eq!(dur.div_f64(3.14e5), Duration::new(0, 8_599)); + /// ``` + fn div_f64( + _self: Val, + rhs: f64, + ) -> Val { let output: Val = bevy::utils::Duration::div_f64( _self.into_inner(), rhs, @@ -329,63 +603,172 @@ impl bevy::utils::Duration { .into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn from_micros(micros: u64) { + /// Creates a new `Duration` from the specified number of microseconds. + /// # Examples + /// ``` + /// use std::time::Duration; + /// let duration = Duration::from_micros(1_000_002); + /// assert_eq!(1, duration.as_secs()); + /// assert_eq!(2_000, duration.subsec_nanos()); + /// ``` + fn from_micros(micros: u64) -> Val { let output: Val = bevy::utils::Duration::from_micros( micros, ) .into(); output } - fn from_millis(millis: u64) { + /// Creates a new `Duration` from the specified number of milliseconds. + /// # Examples + /// ``` + /// use std::time::Duration; + /// let duration = Duration::from_millis(2_569); + /// assert_eq!(2, duration.as_secs()); + /// assert_eq!(569_000_000, duration.subsec_nanos()); + /// ``` + fn from_millis(millis: u64) -> Val { let output: Val = bevy::utils::Duration::from_millis( millis, ) .into(); output } - fn from_nanos(nanos: u64) { + /// Creates a new `Duration` from the specified number of nanoseconds. + /// Note: Using this on the return value of `as_nanos()` might cause unexpected behavior: + /// `as_nanos()` returns a u128, and can return values that do not fit in u64, e.g. 585 years. + /// Instead, consider using the pattern `Duration::new(d.as_secs(), d.subsec_nanos())` + /// if you cannot copy/clone the Duration directly. + /// # Examples + /// ``` + /// use std::time::Duration; + /// let duration = Duration::from_nanos(1_000_000_123); + /// assert_eq!(1, duration.as_secs()); + /// assert_eq!(123, duration.subsec_nanos()); + /// ``` + fn from_nanos(nanos: u64) -> Val { let output: Val = bevy::utils::Duration::from_nanos(nanos) .into(); output } - fn from_secs(secs: u64) { + /// Creates a new `Duration` from the specified number of whole seconds. + /// # Examples + /// ``` + /// use std::time::Duration; + /// let duration = Duration::from_secs(5); + /// assert_eq!(5, duration.as_secs()); + /// assert_eq!(0, duration.subsec_nanos()); + /// ``` + fn from_secs(secs: u64) -> Val { let output: Val = bevy::utils::Duration::from_secs(secs) .into(); output } - fn from_secs_f32(secs: f32) { + /// Creates a new `Duration` from the specified number of seconds represented + /// as `f32`. + /// # Panics + /// This constructor will panic if `secs` is negative, overflows `Duration` or not finite. + /// # Examples + /// ``` + /// use std::time::Duration; + /// let res = Duration::from_secs_f32(0.0); + /// assert_eq!(res, Duration::new(0, 0)); + /// let res = Duration::from_secs_f32(1e-20); + /// assert_eq!(res, Duration::new(0, 0)); + /// let res = Duration::from_secs_f32(4.2e-7); + /// assert_eq!(res, Duration::new(0, 420)); + /// let res = Duration::from_secs_f32(2.7); + /// assert_eq!(res, Duration::new(2, 700_000_048)); + /// let res = Duration::from_secs_f32(3e10); + /// assert_eq!(res, Duration::new(30_000_001_024, 0)); + /// // subnormal float + /// let res = Duration::from_secs_f32(f32::from_bits(1)); + /// assert_eq!(res, Duration::new(0, 0)); + /// // conversion uses rounding + /// let res = Duration::from_secs_f32(0.999e-9); + /// assert_eq!(res, Duration::new(0, 1)); + /// ``` + fn from_secs_f32(secs: f32) -> Val { let output: Val = bevy::utils::Duration::from_secs_f32( secs, ) .into(); output } - fn from_secs_f64(secs: f64) { + /// Creates a new `Duration` from the specified number of seconds represented + /// as `f64`. + /// # Panics + /// This constructor will panic if `secs` is negative, overflows `Duration` or not finite. + /// # Examples + /// ``` + /// use std::time::Duration; + /// let res = Duration::from_secs_f64(0.0); + /// assert_eq!(res, Duration::new(0, 0)); + /// let res = Duration::from_secs_f64(1e-20); + /// assert_eq!(res, Duration::new(0, 0)); + /// let res = Duration::from_secs_f64(4.2e-7); + /// assert_eq!(res, Duration::new(0, 420)); + /// let res = Duration::from_secs_f64(2.7); + /// assert_eq!(res, Duration::new(2, 700_000_000)); + /// let res = Duration::from_secs_f64(3e10); + /// assert_eq!(res, Duration::new(30_000_000_000, 0)); + /// // subnormal float + /// let res = Duration::from_secs_f64(f64::from_bits(1)); + /// assert_eq!(res, Duration::new(0, 0)); + /// // conversion uses rounding + /// let res = Duration::from_secs_f64(0.999e-9); + /// assert_eq!(res, Duration::new(0, 1)); + /// ``` + fn from_secs_f64(secs: f64) -> Val { let output: Val = bevy::utils::Duration::from_secs_f64( secs, ) .into(); output } - fn is_zero(_self: Ref) { + /// Returns true if this `Duration` spans no time. + /// # Examples + /// ``` + /// use std::time::Duration; + /// assert!(Duration::ZERO.is_zero()); + /// assert!(Duration::new(0, 0).is_zero()); + /// assert!(Duration::from_nanos(0).is_zero()); + /// assert!(Duration::from_secs(0).is_zero()); + /// assert!(!Duration::new(1, 1).is_zero()); + /// assert!(!Duration::from_nanos(1).is_zero()); + /// assert!(!Duration::from_secs(1).is_zero()); + /// ``` + fn is_zero(_self: Ref) -> bool { let output: bool = bevy::utils::Duration::is_zero(&_self).into(); output } - fn mul(_self: Val, rhs: u32) { + fn mul(_self: Val, rhs: u32) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn mul_f32(_self: Val, rhs: f32) { + /// Multiplies `Duration` by `f32`. + /// # Panics + /// This method will panic if result is negative, overflows `Duration` or not finite. + /// # Examples + /// ``` + /// use std::time::Duration; + /// let dur = Duration::new(2, 700_000_000); + /// assert_eq!(dur.mul_f32(3.14), Duration::new(8, 478_000_641)); + /// assert_eq!(dur.mul_f32(3.14e5), Duration::new(847_800, 0)); + /// ``` + fn mul_f32( + _self: Val, + rhs: f32, + ) -> Val { let output: Val = bevy::utils::Duration::mul_f32( _self.into_inner(), rhs, @@ -393,7 +776,20 @@ impl bevy::utils::Duration { .into(); output } - fn mul_f64(_self: Val, rhs: f64) { + /// Multiplies `Duration` by `f64`. + /// # Panics + /// This method will panic if result is negative, overflows `Duration` or not finite. + /// # Examples + /// ``` + /// use std::time::Duration; + /// let dur = Duration::new(2, 700_000_000); + /// assert_eq!(dur.mul_f64(3.14), Duration::new(8, 478_000_000)); + /// assert_eq!(dur.mul_f64(3.14e5), Duration::new(847_800, 0)); + /// ``` + fn mul_f64( + _self: Val, + rhs: f64, + ) -> Val { let output: Val = bevy::utils::Duration::mul_f64( _self.into_inner(), rhs, @@ -401,15 +797,36 @@ impl bevy::utils::Duration { .into(); output } - fn new(secs: u64, nanos: u32) { + /// Creates a new `Duration` from the specified number of whole seconds and + /// additional nanoseconds. + /// If the number of nanoseconds is greater than 1 billion (the number of + /// nanoseconds in a second), then it will carry over into the seconds provided. + /// # Panics + /// This constructor will panic if the carry from the nanoseconds overflows + /// the seconds counter. + /// # Examples + /// ``` + /// use std::time::Duration; + /// let five_seconds = Duration::new(5, 0); + /// ``` + fn new(secs: u64, nanos: u32) -> Val { let output: Val = bevy::utils::Duration::new(secs, nanos) .into(); output } + /// Saturating `Duration` addition. Computes `self + other`, returning [`Duration::MAX`] + /// if overflow occurred. + /// # Examples + /// ``` + /// #![feature(duration_constants)] + /// use std::time::Duration; + /// assert_eq!(Duration::new(0, 0).saturating_add(Duration::new(0, 1)), Duration::new(0, 1)); + /// assert_eq!(Duration::new(1, 0).saturating_add(Duration::new(u64::MAX, 0)), Duration::MAX); + /// ``` fn saturating_add( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::utils::Duration::saturating_add( _self.into_inner(), rhs.into_inner(), @@ -417,7 +834,19 @@ impl bevy::utils::Duration { .into(); output } - fn saturating_mul(_self: Val, rhs: u32) { + /// Saturating `Duration` multiplication. Computes `self * other`, returning + /// [`Duration::MAX`] if overflow occurred. + /// # Examples + /// ``` + /// #![feature(duration_constants)] + /// use std::time::Duration; + /// assert_eq!(Duration::new(0, 500_000_001).saturating_mul(2), Duration::new(1, 2)); + /// assert_eq!(Duration::new(u64::MAX - 1, 0).saturating_mul(2), Duration::MAX); + /// ``` + fn saturating_mul( + _self: Val, + rhs: u32, + ) -> Val { let output: Val = bevy::utils::Duration::saturating_mul( _self.into_inner(), rhs, @@ -425,10 +854,18 @@ impl bevy::utils::Duration { .into(); output } + /// Saturating `Duration` subtraction. Computes `self - other`, returning [`Duration::ZERO`] + /// if the result would be negative or if overflow occurred. + /// # Examples + /// ``` + /// use std::time::Duration; + /// assert_eq!(Duration::new(0, 1).saturating_sub(Duration::new(0, 0)), Duration::new(0, 1)); + /// assert_eq!(Duration::new(0, 0).saturating_sub(Duration::new(0, 1)), Duration::ZERO); + /// ``` fn saturating_sub( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::utils::Duration::saturating_sub( _self.into_inner(), rhs.into_inner(), @@ -436,22 +873,58 @@ impl bevy::utils::Duration { .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn subsec_micros(_self: Ref) { + /// Returns the fractional part of this `Duration`, in whole microseconds. + /// This method does **not** return the length of the duration when + /// represented by microseconds. The returned number always represents a + /// fractional portion of a second (i.e., it is less than one million). + /// # Examples + /// ``` + /// use std::time::Duration; + /// let duration = Duration::from_micros(1_234_567); + /// assert_eq!(duration.as_secs(), 1); + /// assert_eq!(duration.subsec_micros(), 234_567); + /// ``` + fn subsec_micros(_self: Ref) -> u32 { let output: u32 = bevy::utils::Duration::subsec_micros(&_self).into(); output } - fn subsec_millis(_self: Ref) { + /// Returns the fractional part of this `Duration`, in whole milliseconds. + /// This method does **not** return the length of the duration when + /// represented by milliseconds. The returned number always represents a + /// fractional portion of a second (i.e., it is less than one thousand). + /// # Examples + /// ``` + /// use std::time::Duration; + /// let duration = Duration::from_millis(5_432); + /// assert_eq!(duration.as_secs(), 5); + /// assert_eq!(duration.subsec_millis(), 432); + /// ``` + fn subsec_millis(_self: Ref) -> u32 { let output: u32 = bevy::utils::Duration::subsec_millis(&_self).into(); output } - fn subsec_nanos(_self: Ref) { + /// Returns the fractional part of this `Duration`, in nanoseconds. + /// This method does **not** return the length of the duration when + /// represented by nanoseconds. The returned number always represents a + /// fractional portion of a second (i.e., it is less than one billion). + /// # Examples + /// ``` + /// use std::time::Duration; + /// let duration = Duration::from_millis(5_010); + /// assert_eq!(duration.as_secs(), 5); + /// assert_eq!(duration.subsec_nanos(), 10_000_000); + /// ``` + fn subsec_nanos(_self: Ref) -> u32 { let output: u32 = bevy::utils::Duration::subsec_nanos(&_self).into(); output } @@ -462,31 +935,54 @@ impl bevy::utils::Duration { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::utils::Instant { - fn add(_self: Val, other: Val) { + /// # Panics + /// This function may panic if the resulting point in time cannot be represented by the + /// underlying data structure. See [`Instant::checked_add`] for a version without panic. + fn add( + _self: Val, + other: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), other.into_inner()) .into(); output } - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } + /// Returns the amount of time elapsed from another instant to this one, + /// or zero duration if that instant is later than this one. + /// # Panics + /// Previous Rust versions panicked when `earlier` was later than `self`. Currently this + /// method saturates. Future versions may reintroduce the panic in some circumstances. + /// See [Monotonicity]. + /// [Monotonicity]: Instant#monotonicity + /// # Examples + /// ```no_run + /// use std::time::{Duration, Instant}; + /// use std::thread::sleep; + /// let now = Instant::now(); + /// sleep(Duration::new(1, 0)); + /// let new_now = Instant::now(); + /// println!("{:?}", new_now.duration_since(now)); + /// println!("{:?}", now.duration_since(new_now)); // 0ns + /// ``` fn duration_since( _self: Ref, earlier: Val, - ) { + ) -> Val { let output: Val = bevy::utils::Instant::duration_since( &_self, earlier.into_inner(), @@ -494,26 +990,59 @@ impl bevy::utils::Instant { .into(); output } - fn elapsed(_self: Ref) { + /// Returns the amount of time elapsed since this instant. + /// # Panics + /// Previous Rust versions panicked when the current time was earlier than self. Currently this + /// method returns a Duration of zero in that case. Future versions may reintroduce the panic. + /// See [Monotonicity]. + /// [Monotonicity]: Instant#monotonicity + /// # Examples + /// ```no_run + /// use std::thread::sleep; + /// use std::time::{Duration, Instant}; + /// let instant = Instant::now(); + /// let three_secs = Duration::from_secs(3); + /// sleep(three_secs); + /// assert!(instant.elapsed() >= three_secs); + /// ``` + fn elapsed(_self: Ref) -> Val { let output: Val = bevy::utils::Instant::elapsed(&_self) .into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn now() { + /// Returns an instant corresponding to "now". + /// # Examples + /// ``` + /// use std::time::Instant; + /// let now = Instant::now(); + /// ``` + fn now() -> Val { let output: Val = bevy::utils::Instant::now().into(); output } + /// Returns the amount of time elapsed from another instant to this one, + /// or zero duration if that instant is later than this one. + /// # Examples + /// ```no_run + /// use std::time::{Duration, Instant}; + /// use std::thread::sleep; + /// let now = Instant::now(); + /// sleep(Duration::new(1, 0)); + /// let new_now = Instant::now(); + /// println!("{:?}", new_now.saturating_duration_since(now)); + /// println!("{:?}", now.saturating_duration_since(new_now)); // 0ns + /// ``` fn saturating_duration_since( _self: Ref, earlier: Val, - ) { + ) -> Val { let output: Val = bevy::utils::Instant::saturating_duration_since( &_self, earlier.into_inner(), @@ -521,14 +1050,27 @@ impl bevy::utils::Instant { .into(); output } - fn sub(_self: Val, other: Val) { + fn sub( + _self: Val, + other: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), other.into_inner()) .into(); output } - fn sub(_self: Val, other: Val) { + /// Returns the amount of time elapsed from another instant to this one, + /// or zero duration if that instant is later than this one. + /// # Panics + /// Previous Rust versions panicked when `other` was later than `self`. Currently this + /// method saturates. Future versions may reintroduce the panic in some circumstances. + /// See [Monotonicity]. + /// [Monotonicity]: Instant#monotonicity + fn sub( + _self: Val, + other: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), other.into_inner()) @@ -542,21 +1084,21 @@ impl bevy::utils::Instant { bms_core_path = "bevy_mod_scripting_core" )] impl std::ops::RangeFull { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) @@ -570,11 +1112,18 @@ impl std::ops::RangeFull { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::Quat { + /// Returns true if the absolute difference of all elements between `self` and `rhs` + /// is less than or equal to `max_abs_diff`. + /// This can be used to compare if two quaternions contain similar elements. It works + /// best when comparing with a known value. The `max_abs_diff` that should be used used + /// depends on the values being compared against. + /// For more see + /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). fn abs_diff_eq( _self: Val, rhs: Val, max_abs_diff: f32, - ) { + ) -> bool { let output: bool = bevy::math::Quat::abs_diff_eq( _self.into_inner(), rhs.into_inner(), @@ -583,14 +1132,26 @@ impl bevy::math::Quat { .into(); output } - fn add(_self: Val, rhs: Val) { + /// Adds two quaternions. + /// The sum is not guaranteed to be normalized. + /// Note that addition is not the same as combining the rotations represented by the + /// two quaternions! That corresponds to multiplication. + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn angle_between(_self: Val, rhs: Val) { + /// Returns the angle (in radians) for the minimal rotation + /// for transforming this quaternion into another. + /// Both quaternions must be normalized. + /// # Panics + /// Will panic if `self` or `rhs` are not normalized when `glam_assert` is enabled. + fn angle_between(_self: Val, rhs: Val) -> f32 { let output: f32 = bevy::math::Quat::angle_between( _self.into_inner(), rhs.into_inner(), @@ -598,55 +1159,78 @@ impl bevy::math::Quat { .into(); output } - fn as_dquat(_self: Val) { + fn as_dquat(_self: Val) -> Val { let output: Val = bevy::math::Quat::as_dquat( _self.into_inner(), ) .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn conjugate(_self: Val) { + /// Returns the quaternion conjugate of `self`. For a unit quaternion the + /// conjugate is also the inverse. + fn conjugate(_self: Val) -> Val { let output: Val = bevy::math::Quat::conjugate( _self.into_inner(), ) .into(); output } - fn div(_self: Val, rhs: f32) { + /// Divides a quaternion by a scalar value. + /// The quotient is not guaranteed to be normalized. + fn div(_self: Val, rhs: f32) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn dot(_self: Val, rhs: Val) { + /// Computes the dot product of `self` and `rhs`. The dot product is + /// equal to the cosine of the angle between two quaternion rotations. + fn dot(_self: Val, rhs: Val) -> f32 { let output: f32 = bevy::math::Quat::dot(_self.into_inner(), rhs.into_inner()) .into(); output } - fn eq(_self: Ref, rhs: Ref) { + fn eq(_self: Ref, rhs: Ref) -> bool { let output: bool = >::eq(&_self, &rhs) .into(); output } - fn from_affine3(a: Ref) { + /// Creates a quaternion from a 3x3 rotation matrix inside a 3D affine transform. + /// Note if the input affine matrix contain scales, shears, or other non-rotation + /// transformations then the resulting quaternion will be ill-defined. + /// # Panics + /// Will panic if any input affine matrix column is not normalized when `glam_assert` is + /// enabled. + fn from_affine3(a: Ref) -> Val { let output: Val = bevy::math::Quat::from_affine3(&a).into(); output } - fn from_array(a: [f32; 4]) { + /// Creates a rotation quaternion from an array. + /// # Preconditions + /// This function does not check if the input is normalized, it is up to the user to + /// provide normalized input or to normalized the resulting quaternion. + fn from_array(a: [f32; 4]) -> Val { let output: Val = bevy::math::Quat::from_array(a).into(); output } - fn from_axis_angle(axis: Val, angle: f32) { + /// Create a quaternion for a normalized rotation `axis` and `angle` (in radians). + /// The axis must be a unit vector. + /// # Panics + /// Will panic if `axis` is not normalized when `glam_assert` is enabled. + fn from_axis_angle( + axis: Val, + angle: f32, + ) -> Val { let output: Val = bevy::math::Quat::from_axis_angle( axis.into_inner(), angle, @@ -654,7 +1238,13 @@ impl bevy::math::Quat { .into(); output } - fn from_euler(euler: Val, a: f32, b: f32, c: f32) { + /// Creates a quaternion from the given Euler rotation sequence and the angles (in radians). + fn from_euler( + euler: Val, + a: f32, + b: f32, + c: f32, + ) -> Val { let output: Val = bevy::math::Quat::from_euler( euler.into_inner(), a, @@ -664,19 +1254,46 @@ impl bevy::math::Quat { .into(); output } - fn from_mat3(mat: Ref) { + /// Creates a quaternion from a 3x3 rotation matrix. + /// Note if the input matrix contain scales, shears, or other non-rotation transformations then + /// the resulting quaternion will be ill-defined. + /// # Panics + /// Will panic if any input matrix column is not normalized when `glam_assert` is enabled. + fn from_mat3(mat: Ref) -> Val { let output: Val = bevy::math::Quat::from_mat3(&mat).into(); output } - fn from_mat3a(mat: Ref) { + /// Creates a quaternion from a 3x3 SIMD aligned rotation matrix. + /// Note if the input matrix contain scales, shears, or other non-rotation transformations then + /// the resulting quaternion will be ill-defined. + /// # Panics + /// Will panic if any input matrix column is not normalized when `glam_assert` is enabled. + fn from_mat3a(mat: Ref) -> Val { let output: Val = bevy::math::Quat::from_mat3a(&mat).into(); output } - fn from_mat4(mat: Ref) { + /// Creates a quaternion from the upper 3x3 rotation matrix inside a homogeneous 4x4 matrix. + /// Note if the upper 3x3 matrix contain scales, shears, or other non-rotation transformations + /// then the resulting quaternion will be ill-defined. + /// # Panics + /// Will panic if any column of the upper 3x3 rotation matrix is not normalized when + /// `glam_assert` is enabled. + fn from_mat4(mat: Ref) -> Val { let output: Val = bevy::math::Quat::from_mat4(&mat).into(); output } - fn from_rotation_arc(from: Val, to: Val) { + /// Gets the minimal rotation for transforming `from` to `to`. The rotation is in the + /// plane spanned by the two vectors. Will rotate at most 180 degrees. + /// The inputs must be unit vectors. + /// `from_rotation_arc(from, to) * from ≈ to`. + /// For near-singular cases (from≈to and from≈-to) the current implementation + /// is only accurate to about 0.001 (for `f32`). + /// # Panics + /// Will panic if `from` or `to` are not normalized when `glam_assert` is enabled. + fn from_rotation_arc( + from: Val, + to: Val, + ) -> Val { let output: Val = bevy::math::Quat::from_rotation_arc( from.into_inner(), to.into_inner(), @@ -684,7 +1301,18 @@ impl bevy::math::Quat { .into(); output } - fn from_rotation_arc_2d(from: Val, to: Val) { + /// Gets the minimal rotation for transforming `from` to `to`. The resulting rotation is + /// around the z axis. Will rotate at most 180 degrees. + /// The inputs must be unit vectors. + /// `from_rotation_arc_2d(from, to) * from ≈ to`. + /// For near-singular cases (from≈to and from≈-to) the current implementation + /// is only accurate to about 0.001 (for `f32`). + /// # Panics + /// Will panic if `from` or `to` are not normalized when `glam_assert` is enabled. + fn from_rotation_arc_2d( + from: Val, + to: Val, + ) -> Val { let output: Val = bevy::math::Quat::from_rotation_arc_2d( from.into_inner(), to.into_inner(), @@ -692,10 +1320,18 @@ impl bevy::math::Quat { .into(); output } + /// Gets the minimal rotation for transforming `from` to either `to` or `-to`. This means + /// that the resulting quaternion will rotate `from` so that it is colinear with `to`. + /// The rotation is in the plane spanned by the two vectors. Will rotate at most 90 + /// degrees. + /// The inputs must be unit vectors. + /// `to.dot(from_rotation_arc_colinear(from, to) * from).abs() ≈ 1`. + /// # Panics + /// Will panic if `from` or `to` are not normalized when `glam_assert` is enabled. fn from_rotation_arc_colinear( from: Val, to: Val, - ) { + ) -> Val { let output: Val = bevy::math::Quat::from_rotation_arc_colinear( from.into_inner(), to.into_inner(), @@ -703,72 +1339,115 @@ impl bevy::math::Quat { .into(); output } - fn from_rotation_x(angle: f32) { + /// Creates a quaternion from the `angle` (in radians) around the x axis. + fn from_rotation_x(angle: f32) -> Val { let output: Val = bevy::math::Quat::from_rotation_x(angle) .into(); output } - fn from_rotation_y(angle: f32) { + /// Creates a quaternion from the `angle` (in radians) around the y axis. + fn from_rotation_y(angle: f32) -> Val { let output: Val = bevy::math::Quat::from_rotation_y(angle) .into(); output } - fn from_rotation_z(angle: f32) { + /// Creates a quaternion from the `angle` (in radians) around the z axis. + fn from_rotation_z(angle: f32) -> Val { let output: Val = bevy::math::Quat::from_rotation_z(angle) .into(); output } - fn from_scaled_axis(v: Val) { + /// Create a quaternion that rotates `v.length()` radians around `v.normalize()`. + /// `from_scaled_axis(Vec3::ZERO)` results in the identity quaternion. + fn from_scaled_axis(v: Val) -> Val { let output: Val = bevy::math::Quat::from_scaled_axis( v.into_inner(), ) .into(); output } - fn from_vec4(v: Val) { + /// Creates a new rotation quaternion from a 4D vector. + /// # Preconditions + /// This function does not check if the input is normalized, it is up to the user to + /// provide normalized input or to normalized the resulting quaternion. + fn from_vec4(v: Val) -> Val { let output: Val = bevy::math::Quat::from_vec4(v.into_inner()) .into(); output } - fn from_xyzw(x: f32, y: f32, z: f32, w: f32) { + /// Creates a new rotation quaternion. + /// This should generally not be called manually unless you know what you are doing. + /// Use one of the other constructors instead such as `identity` or `from_axis_angle`. + /// `from_xyzw` is mostly used by unit tests and `serde` deserialization. + /// # Preconditions + /// This function does not check if the input is normalized, it is up to the user to + /// provide normalized input or to normalized the resulting quaternion. + fn from_xyzw(x: f32, y: f32, z: f32, w: f32) -> Val { let output: Val = bevy::math::Quat::from_xyzw(x, y, z, w) .into(); output } - fn inverse(_self: Val) { + /// Returns the inverse of a normalized quaternion. + /// Typically quaternion inverse returns the conjugate of a normalized quaternion. + /// Because `self` is assumed to already be unit length this method *does not* normalize + /// before returning the conjugate. + /// # Panics + /// Will panic if `self` is not normalized when `glam_assert` is enabled. + fn inverse(_self: Val) -> Val { let output: Val = bevy::math::Quat::inverse(_self.into_inner()) .into(); output } - fn is_finite(_self: Val) { + /// Returns `true` if, and only if, all elements are finite. + /// If any element is either `NaN`, positive or negative infinity, this will return `false`. + fn is_finite(_self: Val) -> bool { let output: bool = bevy::math::Quat::is_finite(_self.into_inner()).into(); output } - fn is_nan(_self: Val) { + /// Returns `true` if any elements are `NAN`. + fn is_nan(_self: Val) -> bool { let output: bool = bevy::math::Quat::is_nan(_self.into_inner()).into(); output } - fn is_near_identity(_self: Val) { + fn is_near_identity(_self: Val) -> bool { let output: bool = bevy::math::Quat::is_near_identity(_self.into_inner()).into(); output } - fn is_normalized(_self: Val) { + /// Returns whether `self` of length `1.0` or not. + /// Uses a precision threshold of `1e-6`. + fn is_normalized(_self: Val) -> bool { let output: bool = bevy::math::Quat::is_normalized(_self.into_inner()).into(); output } - fn length(_self: Val) { + /// Computes the length of `self`. + fn length(_self: Val) -> f32 { let output: f32 = bevy::math::Quat::length(_self.into_inner()).into(); output } - fn length_recip(_self: Val) { + /// Computes `1.0 / length()`. + /// For valid results, `self` must _not_ be of length zero. + fn length_recip(_self: Val) -> f32 { let output: f32 = bevy::math::Quat::length_recip(_self.into_inner()).into(); output } - fn length_squared(_self: Val) { + /// Computes the squared length of `self`. + /// This is generally faster than `length()` as it avoids a square + /// root operation. + fn length_squared(_self: Val) -> f32 { let output: f32 = bevy::math::Quat::length_squared(_self.into_inner()).into(); output } - fn lerp(_self: Val, end: Val, s: f32) { + /// Performs a linear interpolation between `self` and `rhs` based on + /// the value `s`. + /// When `s` is `0.0`, the result will be equal to `self`. When `s` + /// is `1.0`, the result will be equal to `rhs`. + /// # Panics + /// Will panic if `self` or `end` are not normalized when `glam_assert` is enabled. + fn lerp( + _self: Val, + end: Val, + s: f32, + ) -> Val { let output: Val = bevy::math::Quat::lerp( _self.into_inner(), end.into_inner(), @@ -777,35 +1456,63 @@ impl bevy::math::Quat { .into(); output } - fn mul(_self: Val, rhs: Val) { + /// Multiplies two quaternions. If they each represent a rotation, the result will + /// represent the combined rotation. + /// Note that due to floating point rounding the result may not be perfectly + /// normalized. + /// # Panics + /// Will panic if `self` or `rhs` are not normalized when `glam_assert` is enabled. + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + /// Multiplies a quaternion and a 3D vector, returning the rotated vector. + /// # Panics + /// Will panic if `self` is not normalized when `glam_assert` is enabled. + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: f32) { + /// Multiplies a quaternion by a scalar value. + /// The product is not guaranteed to be normalized. + fn mul(_self: Val, rhs: f32) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn mul_quat(_self: Val, rhs: Val) { + /// Multiplies two quaternions. If they each represent a rotation, the result will + /// represent the combined rotation. + /// Note that due to floating point rounding the result may not be perfectly normalized. + /// # Panics + /// Will panic if `self` or `rhs` are not normalized when `glam_assert` is enabled. + fn mul_quat( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Quat::mul_quat( _self.into_inner(), rhs.into_inner(), @@ -813,7 +1520,13 @@ impl bevy::math::Quat { .into(); output } - fn mul_vec3(_self: Val, rhs: Val) { + /// Multiplies a quaternion and a 3D vector, returning the rotated vector. + /// # Panics + /// Will panic if `self` is not normalized when `glam_assert` is enabled. + fn mul_vec3( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Quat::mul_vec3( _self.into_inner(), rhs.into_inner(), @@ -821,7 +1534,11 @@ impl bevy::math::Quat { .into(); output } - fn mul_vec3a(_self: Val, rhs: Val) { + /// Multiplies a quaternion and a 3D vector, returning the rotated vector. + fn mul_vec3a( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Quat::mul_vec3a( _self.into_inner(), rhs.into_inner(), @@ -829,25 +1546,36 @@ impl bevy::math::Quat { .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } - fn normalize(_self: Val) { + /// Returns `self` normalized to length 1.0. + /// For valid results, `self` must _not_ be of length zero. + /// Panics + /// Will panic if `self` is zero length when `glam_assert` is enabled. + fn normalize(_self: Val) -> Val { let output: Val = bevy::math::Quat::normalize( _self.into_inner(), ) .into(); output } + /// Rotates towards `rhs` up to `max_angle` (in radians). + /// When `max_angle` is `0.0`, the result will be equal to `self`. When `max_angle` is equal to + /// `self.angle_between(rhs)`, the result will be equal to `rhs`. If `max_angle` is negative, + /// rotates towards the exact opposite of `rhs`. Will not go past the target. + /// Both quaternions must be normalized. + /// # Panics + /// Will panic if `self` or `rhs` are not normalized when `glam_assert` is enabled. fn rotate_towards( _self: Ref, rhs: Val, max_angle: f32, - ) { + ) -> Val { let output: Val = bevy::math::Quat::rotate_towards( &_self, rhs.into_inner(), @@ -856,7 +1584,17 @@ impl bevy::math::Quat { .into(); output } - fn slerp(_self: Val, end: Val, s: f32) { + /// Performs a spherical linear interpolation between `self` and `end` + /// based on the value `s`. + /// When `s` is `0.0`, the result will be equal to `self`. When `s` + /// is `1.0`, the result will be equal to `end`. + /// # Panics + /// Will panic if `self` or `end` are not normalized when `glam_assert` is enabled. + fn slerp( + _self: Val, + end: Val, + s: f32, + ) -> Val { let output: Val = bevy::math::Quat::slerp( _self.into_inner(), end.into_inner(), @@ -865,18 +1603,28 @@ impl bevy::math::Quat { .into(); output } - fn sub(_self: Val, rhs: Val) { + /// Subtracts the `rhs` quaternion from `self`. + /// The difference is not guaranteed to be normalized. + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn to_array(_self: Ref) { + /// `[x, y, z, w]` + fn to_array(_self: Ref) -> [f32; 4] { let output: [f32; 4] = bevy::math::Quat::to_array(&_self).into(); output } - fn to_euler(_self: Val, order: Val) { + /// Returns the rotation angles for the given euler rotation sequence. + fn to_euler( + _self: Val, + order: Val, + ) -> (f32, f32, f32) { let output: (f32, f32, f32) = bevy::math::Quat::to_euler( _self.into_inner(), order.into_inner(), @@ -884,14 +1632,16 @@ impl bevy::math::Quat { .into(); output } - fn to_scaled_axis(_self: Val) { + /// Returns the rotation axis scaled by the rotation in radians. + fn to_scaled_axis(_self: Val) -> Val { let output: Val = bevy::math::Quat::to_scaled_axis( _self.into_inner(), ) .into(); output } - fn xyz(_self: Val) { + /// Returns the vector part of the quaternion. + fn xyz(_self: Val) -> Val { let output: Val = bevy::math::Quat::xyz(_self.into_inner()) .into(); output @@ -903,16 +1653,24 @@ impl bevy::math::Quat { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::Vec3 { - fn abs(_self: Val) { + /// Returns a vector containing the absolute value of each element of `self`. + fn abs(_self: Val) -> Val { let output: Val = bevy::math::Vec3::abs(_self.into_inner()) .into(); output } + /// Returns true if the absolute difference of all elements between `self` and `rhs` is + /// less than or equal to `max_abs_diff`. + /// This can be used to compare if two vectors contain similar elements. It works best when + /// comparing with a known value. The `max_abs_diff` that should be used used depends on + /// the values being compared against. + /// For more see + /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). fn abs_diff_eq( _self: Val, rhs: Val, max_abs_diff: f32, - ) { + ) -> bool { let output: bool = bevy::math::Vec3::abs_diff_eq( _self.into_inner(), rhs.into_inner(), @@ -921,28 +1679,36 @@ impl bevy::math::Vec3 { .into(); output } - fn add(_self: Val, rhs: Ref) { + fn add( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::add(_self.into_inner(), &rhs) .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add(_self: Val, rhs: f32) { + fn add(_self: Val, rhs: f32) -> Val { let output: Val = >::add(_self.into_inner(), rhs) .into(); output } - fn angle_between(_self: Val, rhs: Val) { + /// Returns the angle (in radians) between two vectors in the range `[0, +π]`. + /// The inputs do not need to be unit vectors however they must be non-zero. + fn angle_between(_self: Val, rhs: Val) -> f32 { let output: f32 = bevy::math::Vec3::angle_between( _self.into_inner(), rhs.into_inner(), @@ -950,52 +1716,71 @@ impl bevy::math::Vec3 { .into(); output } - fn any_orthogonal_vector(_self: Ref) { + /// Returns some vector that is orthogonal to the given one. + /// The input vector must be finite and non-zero. + /// The output vector is not necessarily unit length. For that use + /// [`Self::any_orthonormal_vector()`] instead. + fn any_orthogonal_vector(_self: Ref) -> Val { let output: Val = bevy::math::Vec3::any_orthogonal_vector( &_self, ) .into(); output } - fn any_orthonormal_vector(_self: Ref) { + /// Returns any unit vector that is orthogonal to the given one. + /// The input vector must be unit length. + /// # Panics + /// Will panic if `self` is not normalized when `glam_assert` is enabled. + fn any_orthonormal_vector(_self: Ref) -> Val { let output: Val = bevy::math::Vec3::any_orthonormal_vector( &_self, ) .into(); output } - fn as_dvec3(_self: Ref) { + /// Casts all elements of `self` to `f64`. + fn as_dvec3(_self: Ref) -> Val { let output: Val = bevy::math::Vec3::as_dvec3(&_self).into(); output } - fn as_i64vec3(_self: Ref) { + /// Casts all elements of `self` to `i64`. + fn as_i64vec3(_self: Ref) -> Val { let output: Val = bevy::math::Vec3::as_i64vec3(&_self) .into(); output } - fn as_ivec3(_self: Ref) { + /// Casts all elements of `self` to `i32`. + fn as_ivec3(_self: Ref) -> Val { let output: Val = bevy::math::Vec3::as_ivec3(&_self).into(); output } - fn as_u64vec3(_self: Ref) { + /// Casts all elements of `self` to `u64`. + fn as_u64vec3(_self: Ref) -> Val { let output: Val = bevy::math::Vec3::as_u64vec3(&_self) .into(); output } - fn as_uvec3(_self: Ref) { + /// Casts all elements of `self` to `u32`. + fn as_uvec3(_self: Ref) -> Val { let output: Val = bevy::math::Vec3::as_uvec3(&_self).into(); output } - fn ceil(_self: Val) { + /// Returns a vector containing the smallest integer greater than or equal to a number for + /// each element of `self`. + fn ceil(_self: Val) -> Val { let output: Val = bevy::math::Vec3::ceil(_self.into_inner()) .into(); output } + /// Component-wise clamping of values, similar to [`f32::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( _self: Val, min: Val, max: Val, - ) { + ) -> Val { let output: Val = bevy::math::Vec3::clamp( _self.into_inner(), min.into_inner(), @@ -1004,7 +1789,14 @@ impl bevy::math::Vec3 { .into(); output } - fn clamp_length(_self: Val, min: f32, max: f32) { + /// Returns a vector with a length no less than `min` and no more than `max`. + /// # Panics + /// Will panic if `min` is greater than `max`, or if either `min` or `max` is negative, when `glam_assert` is enabled. + fn clamp_length( + _self: Val, + min: f32, + max: f32, + ) -> Val { let output: Val = bevy::math::Vec3::clamp_length( _self.into_inner(), min, @@ -1013,7 +1805,13 @@ impl bevy::math::Vec3 { .into(); output } - fn clamp_length_max(_self: Val, max: f32) { + /// Returns a vector with a length no more than `max`. + /// # Panics + /// Will panic if `max` is negative when `glam_assert` is enabled. + fn clamp_length_max( + _self: Val, + max: f32, + ) -> Val { let output: Val = bevy::math::Vec3::clamp_length_max( _self.into_inner(), max, @@ -1021,7 +1819,13 @@ impl bevy::math::Vec3 { .into(); output } - fn clamp_length_min(_self: Val, min: f32) { + /// Returns a vector with a length no less than `min`. + /// # Panics + /// Will panic if `min` is negative when `glam_assert` is enabled. + fn clamp_length_min( + _self: Val, + min: f32, + ) -> Val { let output: Val = bevy::math::Vec3::clamp_length_min( _self.into_inner(), min, @@ -1029,14 +1833,21 @@ impl bevy::math::Vec3 { .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn cmpeq(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3::cmpeq( _self.into_inner(), rhs.into_inner(), @@ -1044,7 +1855,14 @@ impl bevy::math::Vec3 { .into(); output } - fn cmpge(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3::cmpge( _self.into_inner(), rhs.into_inner(), @@ -1052,7 +1870,14 @@ impl bevy::math::Vec3 { .into(); output } - fn cmpgt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3::cmpgt( _self.into_inner(), rhs.into_inner(), @@ -1060,7 +1885,14 @@ impl bevy::math::Vec3 { .into(); output } - fn cmple(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3::cmple( _self.into_inner(), rhs.into_inner(), @@ -1068,7 +1900,14 @@ impl bevy::math::Vec3 { .into(); output } - fn cmplt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3::cmplt( _self.into_inner(), rhs.into_inner(), @@ -1076,7 +1915,14 @@ impl bevy::math::Vec3 { .into(); output } - fn cmpne(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3::cmpne( _self.into_inner(), rhs.into_inner(), @@ -1084,7 +1930,11 @@ impl bevy::math::Vec3 { .into(); output } - fn copysign(_self: Val, rhs: Val) { + /// Returns a vector with signs of `rhs` and the magnitudes of `self`. + fn copysign( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3::copysign( _self.into_inner(), rhs.into_inner(), @@ -1092,7 +1942,11 @@ impl bevy::math::Vec3 { .into(); output } - fn cross(_self: Val, rhs: Val) { + /// Computes the cross product of `self` and `rhs`. + fn cross( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3::cross( _self.into_inner(), rhs.into_inner(), @@ -1100,7 +1954,8 @@ impl bevy::math::Vec3 { .into(); output } - fn distance(_self: Val, rhs: Val) { + /// Computes the Euclidean distance between two points in space. + fn distance(_self: Val, rhs: Val) -> f32 { let output: f32 = bevy::math::Vec3::distance( _self.into_inner(), rhs.into_inner(), @@ -1108,7 +1963,11 @@ impl bevy::math::Vec3 { .into(); output } - fn distance_squared(_self: Val, rhs: Val) { + /// Compute the squared euclidean distance between two points in space. + fn distance_squared( + _self: Val, + rhs: Val, + ) -> f32 { let output: f32 = bevy::math::Vec3::distance_squared( _self.into_inner(), rhs.into_inner(), @@ -1116,28 +1975,38 @@ impl bevy::math::Vec3 { .into(); output } - fn div(_self: Val, rhs: Ref) { + fn div( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::div(_self.into_inner(), &rhs) .into(); output } - fn div(_self: Val, rhs: Val) { + fn div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::div(_self.into_inner(), rhs.into_inner()) .into(); output } - fn div(_self: Val, rhs: f32) { + fn div(_self: Val, rhs: f32) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn div_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. + fn div_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3::div_euclid( _self.into_inner(), rhs.into_inner(), @@ -1145,12 +2014,17 @@ impl bevy::math::Vec3 { .into(); output } - fn dot(_self: Val, rhs: Val) { + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> f32 { let output: f32 = bevy::math::Vec3::dot(_self.into_inner(), rhs.into_inner()) .into(); output } - fn dot_into_vec(_self: Val, rhs: Val) { + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3::dot_into_vec( _self.into_inner(), rhs.into_inner(), @@ -1158,27 +2032,34 @@ impl bevy::math::Vec3 { .into(); output } - fn element_product(_self: Val) { + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> f32 { let output: f32 = bevy::math::Vec3::element_product(_self.into_inner()).into(); output } - fn element_sum(_self: Val) { + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> f32 { let output: f32 = bevy::math::Vec3::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn exp(_self: Val) { + /// Returns a vector containing `e^self` (the exponential function) for each element of + /// `self`. + fn exp(_self: Val) -> Val { let output: Val = bevy::math::Vec3::exp(_self.into_inner()) .into(); output } - fn extend(_self: Val, w: f32) { + /// Creates a 4D vector from `self` and the given `w` value. + fn extend(_self: Val, w: f32) -> Val { let output: Val = bevy::math::Vec3::extend( _self.into_inner(), w, @@ -1186,71 +2067,107 @@ impl bevy::math::Vec3 { .into(); output } - fn floor(_self: Val) { + /// Returns a vector containing the largest integer less than or equal to a number for each + /// element of `self`. + fn floor(_self: Val) -> Val { let output: Val = bevy::math::Vec3::floor(_self.into_inner()) .into(); output } - fn fract(_self: Val) { + /// Returns a vector containing the fractional part of the vector as `self - self.trunc()`. + /// Note that this differs from the GLSL implementation of `fract` which returns + /// `self - self.floor()`. + /// Note that this is fast but not precise for large numbers. + fn fract(_self: Val) -> Val { let output: Val = bevy::math::Vec3::fract(_self.into_inner()) .into(); output } - fn fract_gl(_self: Val) { + /// Returns a vector containing the fractional part of the vector as `self - self.floor()`. + /// Note that this differs from the Rust implementation of `fract` which returns + /// `self - self.trunc()`. + /// Note that this is fast but not precise for large numbers. + fn fract_gl(_self: Val) -> Val { let output: Val = bevy::math::Vec3::fract_gl( _self.into_inner(), ) .into(); output } - fn from_array(a: [f32; 3]) { + /// Creates a new vector from an array. + fn from_array(a: [f32; 3]) -> Val { let output: Val = bevy::math::Vec3::from_array(a).into(); output } - fn is_finite(_self: Val) { + /// Returns `true` if, and only if, all elements are finite. If any element is either + /// `NaN`, positive or negative infinity, this will return `false`. + fn is_finite(_self: Val) -> bool { let output: bool = bevy::math::Vec3::is_finite(_self.into_inner()).into(); output } - fn is_finite_mask(_self: Val) { + /// Performs `is_finite` on each element of self, returning a vector mask of the results. + /// In other words, this computes `[x.is_finite(), y.is_finite(), ...]`. + fn is_finite_mask(_self: Val) -> Val { let output: Val = bevy::math::Vec3::is_finite_mask( _self.into_inner(), ) .into(); output } - fn is_nan(_self: Val) { + /// Returns `true` if any elements are `NaN`. + fn is_nan(_self: Val) -> bool { let output: bool = bevy::math::Vec3::is_nan(_self.into_inner()).into(); output } - fn is_nan_mask(_self: Val) { + /// Performs `is_nan` on each element of self, returning a vector mask of the results. + /// In other words, this computes `[x.is_nan(), y.is_nan(), ...]`. + fn is_nan_mask(_self: Val) -> Val { let output: Val = bevy::math::Vec3::is_nan_mask( _self.into_inner(), ) .into(); output } - fn is_negative_bitmask(_self: Val) { + /// Returns a bitmask with the lowest 3 bits set to the sign bits from the elements of `self`. + /// A negative element results in a `1` bit and a positive element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn is_negative_bitmask(_self: Val) -> u32 { let output: u32 = bevy::math::Vec3::is_negative_bitmask(_self.into_inner()) .into(); output } - fn is_normalized(_self: Val) { + /// Returns whether `self` is length `1.0` or not. + /// Uses a precision threshold of approximately `1e-4`. + fn is_normalized(_self: Val) -> bool { let output: bool = bevy::math::Vec3::is_normalized(_self.into_inner()).into(); output } - fn length(_self: Val) { + /// Computes the length of `self`. + fn length(_self: Val) -> f32 { let output: f32 = bevy::math::Vec3::length(_self.into_inner()).into(); output } - fn length_recip(_self: Val) { + /// Computes `1.0 / length()`. + /// For valid results, `self` must _not_ be of length zero. + fn length_recip(_self: Val) -> f32 { let output: f32 = bevy::math::Vec3::length_recip(_self.into_inner()).into(); output } - fn length_squared(_self: Val) { + /// Computes the squared length of `self`. + /// This is faster than `length()` as it avoids a square root operation. + fn length_squared(_self: Val) -> f32 { let output: f32 = bevy::math::Vec3::length_squared(_self.into_inner()).into(); output } - fn lerp(_self: Val, rhs: Val, s: f32) { + /// Performs a linear interpolation between `self` and `rhs` based on the value `s`. + /// When `s` is `0.0`, the result will be equal to `self`. When `s` is `1.0`, the result + /// will be equal to `rhs`. When `s` is outside of range `[0, 1]`, the result is linearly + /// extrapolated. + fn lerp( + _self: Val, + rhs: Val, + s: f32, + ) -> Val { let output: Val = bevy::math::Vec3::lerp( _self.into_inner(), rhs.into_inner(), @@ -1259,7 +2176,12 @@ impl bevy::math::Vec3 { .into(); output } - fn max(_self: Val, rhs: Val) { + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3::max( _self.into_inner(), rhs.into_inner(), @@ -1267,11 +2189,20 @@ impl bevy::math::Vec3 { .into(); output } - fn max_element(_self: Val) { + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> f32 { let output: f32 = bevy::math::Vec3::max_element(_self.into_inner()).into(); output } - fn midpoint(_self: Val, rhs: Val) { + /// Calculates the midpoint between `self` and `rhs`. + /// The midpoint is the average of, or halfway point between, two vectors. + /// `a.midpoint(b)` should yield the same result as `a.lerp(b, 0.5)` + /// while being slightly cheaper to compute. + fn midpoint( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3::midpoint( _self.into_inner(), rhs.into_inner(), @@ -1279,7 +2210,12 @@ impl bevy::math::Vec3 { .into(); output } - fn min(_self: Val, rhs: Val) { + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3::min( _self.into_inner(), rhs.into_inner(), @@ -1287,11 +2223,20 @@ impl bevy::math::Vec3 { .into(); output } - fn min_element(_self: Val) { + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> f32 { let output: f32 = bevy::math::Vec3::min_element(_self.into_inner()).into(); output } - fn move_towards(_self: Ref, rhs: Val, d: f32) { + /// Moves towards `rhs` based on the value `d`. + /// When `d` is `0.0`, the result will be equal to `self`. When `d` is equal to + /// `self.distance(rhs)`, the result will be equal to `rhs`. Will not go past `rhs`. + fn move_towards( + _self: Ref, + rhs: Val, + d: f32, + ) -> Val { let output: Val = bevy::math::Vec3::move_towards( &_self, rhs.into_inner(), @@ -1300,32 +2245,44 @@ impl bevy::math::Vec3 { .into(); output } - fn mul(_self: Val, rhs: Ref) { + fn mul( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::mul(_self.into_inner(), &rhs) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: f32) { + fn mul(_self: Val, rhs: f32) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } + /// Fused multiply-add. Computes `(self * a) + b` element-wise with only one rounding + /// error, yielding a more accurate result than an unfused multiply-add. + /// Using `mul_add` *may* be more performant than an unfused multiply-add if the target + /// architecture has a dedicated fma CPU instruction. However, this is not always true, + /// and will be heavily dependant on designing algorithms with specific target hardware in + /// mind. fn mul_add( _self: Val, a: Val, b: Val, - ) { + ) -> Val { let output: Val = bevy::math::Vec3::mul_add( _self.into_inner(), a.into_inner(), @@ -1334,25 +2291,39 @@ impl bevy::math::Vec3 { .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } - fn new(x: f32, y: f32, z: f32) { + /// Creates a new vector. + fn new(x: f32, y: f32, z: f32) -> Val { let output: Val = bevy::math::Vec3::new(x, y, z).into(); output } - fn normalize(_self: Val) { + /// Returns `self` normalized to length 1.0. + /// For valid results, `self` must be finite and _not_ of length zero, nor very close to zero. + /// See also [`Self::try_normalize()`] and [`Self::normalize_or_zero()`]. + /// Panics + /// Will panic if the resulting normalized vector is not finite when `glam_assert` is enabled. + fn normalize(_self: Val) -> Val { let output: Val = bevy::math::Vec3::normalize( _self.into_inner(), ) .into(); output } - fn normalize_or(_self: Val, fallback: Val) { + /// Returns `self` normalized to length 1.0 if possible, else returns a + /// fallback value. + /// In particular, if the input is zero (or very close to zero), or non-finite, + /// the result of this operation will be the fallback value. + /// See also [`Self::try_normalize()`]. + fn normalize_or( + _self: Val, + fallback: Val, + ) -> Val { let output: Val = bevy::math::Vec3::normalize_or( _self.into_inner(), fallback.into_inner(), @@ -1360,19 +2331,31 @@ impl bevy::math::Vec3 { .into(); output } - fn normalize_or_zero(_self: Val) { + /// Returns `self` normalized to length 1.0 if possible, else returns zero. + /// In particular, if the input is zero (or very close to zero), or non-finite, + /// the result of this operation will be zero. + /// See also [`Self::try_normalize()`]. + fn normalize_or_zero(_self: Val) -> Val { let output: Val = bevy::math::Vec3::normalize_or_zero( _self.into_inner(), ) .into(); output } - fn powf(_self: Val, n: f32) { + /// Returns a vector containing each element of `self` raised to the power of `n`. + fn powf(_self: Val, n: f32) -> Val { let output: Val = bevy::math::Vec3::powf(_self.into_inner(), n) .into(); output } - fn project_onto(_self: Val, rhs: Val) { + /// Returns the vector projection of `self` onto `rhs`. + /// `rhs` must be of non-zero length. + /// # Panics + /// Will panic if `rhs` is zero length when `glam_assert` is enabled. + fn project_onto( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3::project_onto( _self.into_inner(), rhs.into_inner(), @@ -1380,10 +2363,14 @@ impl bevy::math::Vec3 { .into(); output } + /// Returns the vector projection of `self` onto `rhs`. + /// `rhs` must be normalized. + /// # Panics + /// Will panic if `rhs` is not normalized when `glam_assert` is enabled. fn project_onto_normalized( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::Vec3::project_onto_normalized( _self.into_inner(), rhs.into_inner(), @@ -1391,12 +2378,21 @@ impl bevy::math::Vec3 { .into(); output } - fn recip(_self: Val) { + /// Returns a vector containing the reciprocal `1.0/n` of each element of `self`. + fn recip(_self: Val) -> Val { let output: Val = bevy::math::Vec3::recip(_self.into_inner()) .into(); output } - fn reflect(_self: Val, normal: Val) { + /// Returns the reflection vector for a given incident vector `self` and surface normal + /// `normal`. + /// `normal` must be normalized. + /// # Panics + /// Will panic if `normal` is not normalized when `glam_assert` is enabled. + fn reflect( + _self: Val, + normal: Val, + ) -> Val { let output: Val = bevy::math::Vec3::reflect( _self.into_inner(), normal.into_inner(), @@ -1404,7 +2400,17 @@ impl bevy::math::Vec3 { .into(); output } - fn refract(_self: Val, normal: Val, eta: f32) { + /// Returns the refraction direction for a given incident vector `self`, surface normal + /// `normal` and ratio of indices of refraction, `eta`. When total internal reflection occurs, + /// a zero vector will be returned. + /// `self` and `normal` must be normalized. + /// # Panics + /// Will panic if `self` or `normal` is not normalized when `glam_assert` is enabled. + fn refract( + _self: Val, + normal: Val, + eta: f32, + ) -> Val { let output: Val = bevy::math::Vec3::refract( _self.into_inner(), normal.into_inner(), @@ -1413,7 +2419,16 @@ impl bevy::math::Vec3 { .into(); output } - fn reject_from(_self: Val, rhs: Val) { + /// Returns the vector rejection of `self` from `rhs`. + /// The vector rejection is the vector perpendicular to the projection of `self` onto + /// `rhs`, in rhs words the result of `self - self.project_onto(rhs)`. + /// `rhs` must be of non-zero length. + /// # Panics + /// Will panic if `rhs` has a length of zero when `glam_assert` is enabled. + fn reject_from( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3::reject_from( _self.into_inner(), rhs.into_inner(), @@ -1421,7 +2436,16 @@ impl bevy::math::Vec3 { .into(); output } - fn reject_from_normalized(_self: Val, rhs: Val) { + /// Returns the vector rejection of `self` from `rhs`. + /// The vector rejection is the vector perpendicular to the projection of `self` onto + /// `rhs`, in rhs words the result of `self - self.project_onto(rhs)`. + /// `rhs` must be normalized. + /// # Panics + /// Will panic if `rhs` is not normalized when `glam_assert` is enabled. + fn reject_from_normalized( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3::reject_from_normalized( _self.into_inner(), rhs.into_inner(), @@ -1429,28 +2453,39 @@ impl bevy::math::Vec3 { .into(); output } - fn rem(_self: Val, rhs: Ref) { + fn rem( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::rem(_self.into_inner(), &rhs) .into(); output } - fn rem(_self: Val, rhs: Val) { + fn rem( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) .into(); output } - fn rem(_self: Val, rhs: f32) { + fn rem(_self: Val, rhs: f32) -> Val { let output: Val = >::rem(_self.into_inner(), rhs) .into(); output } - fn rem_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. + /// [Euclidean division]: f32::rem_euclid + fn rem_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3::rem_euclid( _self.into_inner(), rhs.into_inner(), @@ -1458,16 +2493,22 @@ impl bevy::math::Vec3 { .into(); output } - fn round(_self: Val) { + /// Returns a vector containing the nearest integer to a number for each element of `self`. + /// Round half-way cases away from 0.0. + fn round(_self: Val) -> Val { let output: Val = bevy::math::Vec3::round(_self.into_inner()) .into(); output } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. fn select( mask: Val, if_true: Val, if_false: Val, - ) { + ) -> Val { let output: Val = bevy::math::Vec3::select( mask.into_inner(), if_true.into_inner(), @@ -1476,53 +2517,70 @@ impl bevy::math::Vec3 { .into(); output } - fn signum(_self: Val) { + /// Returns a vector with elements representing the sign of `self`. + /// - `1.0` if the number is positive, `+0.0` or `INFINITY` + /// - `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY` + /// - `NAN` if the number is `NAN` + fn signum(_self: Val) -> Val { let output: Val = bevy::math::Vec3::signum(_self.into_inner()) .into(); output } - fn splat(v: f32) { + /// Creates a vector with all elements set to `v`. + fn splat(v: f32) -> Val { let output: Val = bevy::math::Vec3::splat(v).into(); output } - fn sub(_self: Val, rhs: Ref) { + fn sub( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::sub(_self.into_inner(), &rhs) .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub(_self: Val, rhs: f32) { + fn sub(_self: Val, rhs: f32) -> Val { let output: Val = >::sub(_self.into_inner(), rhs) .into(); output } - fn to_array(_self: Ref) { + /// `[x, y, z]` + fn to_array(_self: Ref) -> [f32; 3] { let output: [f32; 3] = bevy::math::Vec3::to_array(&_self).into(); output } - fn trunc(_self: Val) { + /// Returns a vector containing the integer part each element of `self`. This means numbers are + /// always truncated towards zero. + fn trunc(_self: Val) -> Val { let output: Val = bevy::math::Vec3::trunc(_self.into_inner()) .into(); output } - fn truncate(_self: Val) { + /// Creates a 2D vector from the `x` and `y` elements of `self`, discarding `z`. + /// Truncation may also be performed by using [`self.xy()`][crate::swizzles::Vec3Swizzles::xy()]. + fn truncate(_self: Val) -> Val { let output: Val = bevy::math::Vec3::truncate( _self.into_inner(), ) .into(); output } - fn with_x(_self: Val, x: f32) { + /// Creates a 3D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: f32) -> Val { let output: Val = bevy::math::Vec3::with_x( _self.into_inner(), x, @@ -1530,7 +2588,8 @@ impl bevy::math::Vec3 { .into(); output } - fn with_y(_self: Val, y: f32) { + /// Creates a 3D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: f32) -> Val { let output: Val = bevy::math::Vec3::with_y( _self.into_inner(), y, @@ -1538,7 +2597,8 @@ impl bevy::math::Vec3 { .into(); output } - fn with_z(_self: Val, z: f32) { + /// Creates a 3D vector from `self` with the given value of `z`. + fn with_z(_self: Val, z: f32) -> Val { let output: Val = bevy::math::Vec3::with_z( _self.into_inner(), z, @@ -1553,66 +2613,82 @@ impl bevy::math::Vec3 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::IVec2 { - fn abs(_self: Val) { + /// Returns a vector containing the absolute value of each element of `self`. + fn abs(_self: Val) -> Val { let output: Val = bevy::math::IVec2::abs(_self.into_inner()) .into(); output } - fn add(_self: Val, rhs: Ref) { + fn add( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::add(_self.into_inner(), &rhs) .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add(_self: Val, rhs: i32) { + fn add(_self: Val, rhs: i32) -> Val { let output: Val = >::add(_self.into_inner(), rhs) .into(); output } - fn as_dvec2(_self: Ref) { + /// Casts all elements of `self` to `f64`. + fn as_dvec2(_self: Ref) -> Val { let output: Val = bevy::math::IVec2::as_dvec2(&_self).into(); output } - fn as_i64vec2(_self: Ref) { + /// Casts all elements of `self` to `i64`. + fn as_i64vec2(_self: Ref) -> Val { let output: Val = bevy::math::IVec2::as_i64vec2(&_self) .into(); output } - fn as_u64vec2(_self: Ref) { + /// Casts all elements of `self` to `u64`. + fn as_u64vec2(_self: Ref) -> Val { let output: Val = bevy::math::IVec2::as_u64vec2(&_self) .into(); output } - fn as_uvec2(_self: Ref) { + /// Casts all elements of `self` to `u32`. + fn as_uvec2(_self: Ref) -> Val { let output: Val = bevy::math::IVec2::as_uvec2(&_self).into(); output } - fn as_vec2(_self: Ref) { + /// Casts all elements of `self` to `f32`. + fn as_vec2(_self: Ref) -> Val { let output: Val = bevy::math::IVec2::as_vec2(&_self).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } + /// Component-wise clamping of values, similar to [`i32::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( _self: Val, min: Val, max: Val, - ) { + ) -> Val { let output: Val = bevy::math::IVec2::clamp( _self.into_inner(), min.into_inner(), @@ -1621,14 +2697,21 @@ impl bevy::math::IVec2 { .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn cmpeq(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec2::cmpeq( _self.into_inner(), rhs.into_inner(), @@ -1636,7 +2719,14 @@ impl bevy::math::IVec2 { .into(); output } - fn cmpge(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec2::cmpge( _self.into_inner(), rhs.into_inner(), @@ -1644,7 +2734,14 @@ impl bevy::math::IVec2 { .into(); output } - fn cmpgt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec2::cmpgt( _self.into_inner(), rhs.into_inner(), @@ -1652,7 +2749,14 @@ impl bevy::math::IVec2 { .into(); output } - fn cmple(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec2::cmple( _self.into_inner(), rhs.into_inner(), @@ -1660,7 +2764,14 @@ impl bevy::math::IVec2 { .into(); output } - fn cmplt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec2::cmplt( _self.into_inner(), rhs.into_inner(), @@ -1668,7 +2779,14 @@ impl bevy::math::IVec2 { .into(); output } - fn cmpne(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec2::cmpne( _self.into_inner(), rhs.into_inner(), @@ -1676,7 +2794,11 @@ impl bevy::math::IVec2 { .into(); output } - fn distance_squared(_self: Val, rhs: Val) { + /// Compute the squared euclidean distance between two points in space. + fn distance_squared( + _self: Val, + rhs: Val, + ) -> i32 { let output: i32 = bevy::math::IVec2::distance_squared( _self.into_inner(), rhs.into_inner(), @@ -1684,28 +2806,40 @@ impl bevy::math::IVec2 { .into(); output } - fn div(_self: Val, rhs: Ref) { + fn div( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::div(_self.into_inner(), &rhs) .into(); output } - fn div(_self: Val, rhs: Val) { + fn div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::div(_self.into_inner(), rhs.into_inner()) .into(); output } - fn div(_self: Val, rhs: i32) { + fn div(_self: Val, rhs: i32) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn div_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + fn div_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec2::div_euclid( _self.into_inner(), rhs.into_inner(), @@ -1713,12 +2847,17 @@ impl bevy::math::IVec2 { .into(); output } - fn dot(_self: Val, rhs: Val) { + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> i32 { let output: i32 = bevy::math::IVec2::dot(_self.into_inner(), rhs.into_inner()) .into(); output } - fn dot_into_vec(_self: Val, rhs: Val) { + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec2::dot_into_vec( _self.into_inner(), rhs.into_inner(), @@ -1726,22 +2865,27 @@ impl bevy::math::IVec2 { .into(); output } - fn element_product(_self: Val) { + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> i32 { let output: i32 = bevy::math::IVec2::element_product(_self.into_inner()).into(); output } - fn element_sum(_self: Val) { + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> i32 { let output: i32 = bevy::math::IVec2::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn extend(_self: Val, z: i32) { + /// Creates a 3D vector from `self` and the given `z` value. + fn extend(_self: Val, z: i32) -> Val { let output: Val = bevy::math::IVec2::extend( _self.into_inner(), z, @@ -1749,20 +2893,30 @@ impl bevy::math::IVec2 { .into(); output } - fn from_array(a: [i32; 2]) { + /// Creates a new vector from an array. + fn from_array(a: [i32; 2]) -> Val { let output: Val = bevy::math::IVec2::from_array(a).into(); output } - fn is_negative_bitmask(_self: Val) { + /// Returns a bitmask with the lowest 2 bits set to the sign bits from the elements of `self`. + /// A negative element results in a `1` bit and a positive element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn is_negative_bitmask(_self: Val) -> u32 { let output: u32 = bevy::math::IVec2::is_negative_bitmask(_self.into_inner()) .into(); output } - fn length_squared(_self: Val) { + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> i32 { let output: i32 = bevy::math::IVec2::length_squared(_self.into_inner()).into(); output } - fn max(_self: Val, rhs: Val) { + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec2::max( _self.into_inner(), rhs.into_inner(), @@ -1770,11 +2924,18 @@ impl bevy::math::IVec2 { .into(); output } - fn max_element(_self: Val) { + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> i32 { let output: i32 = bevy::math::IVec2::max_element(_self.into_inner()).into(); output } - fn min(_self: Val, rhs: Val) { + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec2::min( _self.into_inner(), rhs.into_inner(), @@ -1782,48 +2943,60 @@ impl bevy::math::IVec2 { .into(); output } - fn min_element(_self: Val) { + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> i32 { let output: i32 = bevy::math::IVec2::min_element(_self.into_inner()).into(); output } - fn mul(_self: Val, rhs: Ref) { + fn mul( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::mul(_self.into_inner(), &rhs) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: i32) { + fn mul(_self: Val, rhs: i32) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } - fn new(x: i32, y: i32) { + /// Creates a new vector. + fn new(x: i32, y: i32) -> Val { let output: Val = bevy::math::IVec2::new(x, y).into(); output } - fn perp(_self: Val) { + /// Returns a vector that is equal to `self` rotated by 90 degrees. + fn perp(_self: Val) -> Val { let output: Val = bevy::math::IVec2::perp(_self.into_inner()) .into(); output } - fn perp_dot(_self: Val, rhs: Val) { + /// The perpendicular dot product of `self` and `rhs`. + /// Also known as the wedge product, 2D cross product, and determinant. + fn perp_dot(_self: Val, rhs: Val) -> i32 { let output: i32 = bevy::math::IVec2::perp_dot( _self.into_inner(), rhs.into_inner(), @@ -1831,28 +3004,41 @@ impl bevy::math::IVec2 { .into(); output } - fn rem(_self: Val, rhs: Ref) { + fn rem( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::rem(_self.into_inner(), &rhs) .into(); output } - fn rem(_self: Val, rhs: Val) { + fn rem( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) .into(); output } - fn rem(_self: Val, rhs: i32) { + fn rem(_self: Val, rhs: i32) -> Val { let output: Val = >::rem(_self.into_inner(), rhs) .into(); output } - fn rem_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + /// [Euclidean division]: i32::rem_euclid + fn rem_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec2::rem_euclid( _self.into_inner(), rhs.into_inner(), @@ -1860,7 +3046,13 @@ impl bevy::math::IVec2 { .into(); output } - fn rotate(_self: Val, rhs: Val) { + /// Returns `rhs` rotated by the angle of `self`. If `self` is normalized, + /// then this just rotation. This is what you usually want. Otherwise, + /// it will be like a rotation with a multiplication by `self`'s length. + fn rotate( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec2::rotate( _self.into_inner(), rhs.into_inner(), @@ -1868,7 +3060,12 @@ impl bevy::math::IVec2 { .into(); output } - fn saturating_add(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec2::saturating_add( _self.into_inner(), rhs.into_inner(), @@ -1876,10 +3073,11 @@ impl bevy::math::IVec2 { .into(); output } + /// In other words this computes `[self.x.saturating_add_unsigned(rhs.x), self.y.saturating_add_unsigned(rhs.y), ..]`. fn saturating_add_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::IVec2::saturating_add_unsigned( _self.into_inner(), rhs.into_inner(), @@ -1887,7 +3085,12 @@ impl bevy::math::IVec2 { .into(); output } - fn saturating_div(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec2::saturating_div( _self.into_inner(), rhs.into_inner(), @@ -1895,7 +3098,12 @@ impl bevy::math::IVec2 { .into(); output } - fn saturating_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec2::saturating_mul( _self.into_inner(), rhs.into_inner(), @@ -1903,7 +3111,12 @@ impl bevy::math::IVec2 { .into(); output } - fn saturating_sub(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec2::saturating_sub( _self.into_inner(), rhs.into_inner(), @@ -1911,10 +3124,12 @@ impl bevy::math::IVec2 { .into(); output } + /// Returns a vector containing the saturating subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.saturating_sub_unsigned(rhs.x), self.y.saturating_sub_unsigned(rhs.y), ..]`. fn saturating_sub_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::IVec2::saturating_sub_unsigned( _self.into_inner(), rhs.into_inner(), @@ -1922,11 +3137,15 @@ impl bevy::math::IVec2 { .into(); output } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. fn select( mask: Val, if_true: Val, if_false: Val, - ) { + ) -> Val { let output: Val = bevy::math::IVec2::select( mask.into_inner(), if_true.into_inner(), @@ -1935,43 +3154,56 @@ impl bevy::math::IVec2 { .into(); output } - fn signum(_self: Val) { + /// Returns a vector with elements representing the sign of `self`. + /// - `0` if the number is zero + /// - `1` if the number is positive + /// - `-1` if the number is negative + fn signum(_self: Val) -> Val { let output: Val = bevy::math::IVec2::signum( _self.into_inner(), ) .into(); output } - fn splat(v: i32) { + /// Creates a vector with all elements set to `v`. + fn splat(v: i32) -> Val { let output: Val = bevy::math::IVec2::splat(v).into(); output } - fn sub(_self: Val, rhs: Ref) { + fn sub( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::sub(_self.into_inner(), &rhs) .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub(_self: Val, rhs: i32) { + fn sub(_self: Val, rhs: i32) -> Val { let output: Val = >::sub(_self.into_inner(), rhs) .into(); output } - fn to_array(_self: Ref) { + /// `[x, y]` + fn to_array(_self: Ref) -> [i32; 2] { let output: [i32; 2] = bevy::math::IVec2::to_array(&_self).into(); output } - fn with_x(_self: Val, x: i32) { + /// Creates a 2D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: i32) -> Val { let output: Val = bevy::math::IVec2::with_x( _self.into_inner(), x, @@ -1979,7 +3211,8 @@ impl bevy::math::IVec2 { .into(); output } - fn with_y(_self: Val, y: i32) { + /// Creates a 2D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: i32) -> Val { let output: Val = bevy::math::IVec2::with_y( _self.into_inner(), y, @@ -1987,7 +3220,12 @@ impl bevy::math::IVec2 { .into(); output } - fn wrapping_add(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec2::wrapping_add( _self.into_inner(), rhs.into_inner(), @@ -1995,10 +3233,12 @@ impl bevy::math::IVec2 { .into(); output } + /// Returns a vector containing the wrapping addition of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_unsigned(rhs.x), self.y.wrapping_add_unsigned(rhs.y), ..]`. fn wrapping_add_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::IVec2::wrapping_add_unsigned( _self.into_inner(), rhs.into_inner(), @@ -2006,7 +3246,12 @@ impl bevy::math::IVec2 { .into(); output } - fn wrapping_div(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec2::wrapping_div( _self.into_inner(), rhs.into_inner(), @@ -2014,7 +3259,12 @@ impl bevy::math::IVec2 { .into(); output } - fn wrapping_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec2::wrapping_mul( _self.into_inner(), rhs.into_inner(), @@ -2022,7 +3272,12 @@ impl bevy::math::IVec2 { .into(); output } - fn wrapping_sub(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec2::wrapping_sub( _self.into_inner(), rhs.into_inner(), @@ -2030,10 +3285,12 @@ impl bevy::math::IVec2 { .into(); output } + /// Returns a vector containing the wrapping subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_sub_unsigned(rhs.x), self.y.wrapping_sub_unsigned(rhs.y), ..]`. fn wrapping_sub_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::IVec2::wrapping_sub_unsigned( _self.into_inner(), rhs.into_inner(), @@ -2048,70 +3305,87 @@ impl bevy::math::IVec2 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::IVec3 { - fn abs(_self: Val) { + /// Returns a vector containing the absolute value of each element of `self`. + fn abs(_self: Val) -> Val { let output: Val = bevy::math::IVec3::abs(_self.into_inner()) .into(); output } - fn add(_self: Val, rhs: Ref) { + fn add( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::add(_self.into_inner(), &rhs) .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add(_self: Val, rhs: i32) { + fn add(_self: Val, rhs: i32) -> Val { let output: Val = >::add(_self.into_inner(), rhs) .into(); output } - fn as_dvec3(_self: Ref) { + /// Casts all elements of `self` to `f64`. + fn as_dvec3(_self: Ref) -> Val { let output: Val = bevy::math::IVec3::as_dvec3(&_self).into(); output } - fn as_i64vec3(_self: Ref) { + /// Casts all elements of `self` to `i64`. + fn as_i64vec3(_self: Ref) -> Val { let output: Val = bevy::math::IVec3::as_i64vec3(&_self) .into(); output } - fn as_u64vec3(_self: Ref) { + /// Casts all elements of `self` to `u64`. + fn as_u64vec3(_self: Ref) -> Val { let output: Val = bevy::math::IVec3::as_u64vec3(&_self) .into(); output } - fn as_uvec3(_self: Ref) { + /// Casts all elements of `self` to `u32`. + fn as_uvec3(_self: Ref) -> Val { let output: Val = bevy::math::IVec3::as_uvec3(&_self).into(); output } - fn as_vec3(_self: Ref) { + /// Casts all elements of `self` to `f32`. + fn as_vec3(_self: Ref) -> Val { let output: Val = bevy::math::IVec3::as_vec3(&_self).into(); output } - fn as_vec3a(_self: Ref) { + /// Casts all elements of `self` to `f32`. + fn as_vec3a(_self: Ref) -> Val { let output: Val = bevy::math::IVec3::as_vec3a(&_self).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } + /// Component-wise clamping of values, similar to [`i32::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( _self: Val, min: Val, max: Val, - ) { + ) -> Val { let output: Val = bevy::math::IVec3::clamp( _self.into_inner(), min.into_inner(), @@ -2120,14 +3394,21 @@ impl bevy::math::IVec3 { .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn cmpeq(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec3::cmpeq( _self.into_inner(), rhs.into_inner(), @@ -2135,7 +3416,14 @@ impl bevy::math::IVec3 { .into(); output } - fn cmpge(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec3::cmpge( _self.into_inner(), rhs.into_inner(), @@ -2143,7 +3431,14 @@ impl bevy::math::IVec3 { .into(); output } - fn cmpgt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec3::cmpgt( _self.into_inner(), rhs.into_inner(), @@ -2151,7 +3446,14 @@ impl bevy::math::IVec3 { .into(); output } - fn cmple(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec3::cmple( _self.into_inner(), rhs.into_inner(), @@ -2159,7 +3461,14 @@ impl bevy::math::IVec3 { .into(); output } - fn cmplt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec3::cmplt( _self.into_inner(), rhs.into_inner(), @@ -2167,7 +3476,14 @@ impl bevy::math::IVec3 { .into(); output } - fn cmpne(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec3::cmpne( _self.into_inner(), rhs.into_inner(), @@ -2175,7 +3491,11 @@ impl bevy::math::IVec3 { .into(); output } - fn cross(_self: Val, rhs: Val) { + /// Computes the cross product of `self` and `rhs`. + fn cross( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec3::cross( _self.into_inner(), rhs.into_inner(), @@ -2183,7 +3503,11 @@ impl bevy::math::IVec3 { .into(); output } - fn distance_squared(_self: Val, rhs: Val) { + /// Compute the squared euclidean distance between two points in space. + fn distance_squared( + _self: Val, + rhs: Val, + ) -> i32 { let output: i32 = bevy::math::IVec3::distance_squared( _self.into_inner(), rhs.into_inner(), @@ -2191,28 +3515,40 @@ impl bevy::math::IVec3 { .into(); output } - fn div(_self: Val, rhs: Ref) { + fn div( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::div(_self.into_inner(), &rhs) .into(); output } - fn div(_self: Val, rhs: Val) { + fn div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::div(_self.into_inner(), rhs.into_inner()) .into(); output } - fn div(_self: Val, rhs: i32) { + fn div(_self: Val, rhs: i32) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn div_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + fn div_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec3::div_euclid( _self.into_inner(), rhs.into_inner(), @@ -2220,12 +3556,17 @@ impl bevy::math::IVec3 { .into(); output } - fn dot(_self: Val, rhs: Val) { + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> i32 { let output: i32 = bevy::math::IVec3::dot(_self.into_inner(), rhs.into_inner()) .into(); output } - fn dot_into_vec(_self: Val, rhs: Val) { + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec3::dot_into_vec( _self.into_inner(), rhs.into_inner(), @@ -2233,22 +3574,27 @@ impl bevy::math::IVec3 { .into(); output } - fn element_product(_self: Val) { + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> i32 { let output: i32 = bevy::math::IVec3::element_product(_self.into_inner()).into(); output } - fn element_sum(_self: Val) { + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> i32 { let output: i32 = bevy::math::IVec3::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn extend(_self: Val, w: i32) { + /// Creates a 4D vector from `self` and the given `w` value. + fn extend(_self: Val, w: i32) -> Val { let output: Val = bevy::math::IVec3::extend( _self.into_inner(), w, @@ -2256,20 +3602,30 @@ impl bevy::math::IVec3 { .into(); output } - fn from_array(a: [i32; 3]) { + /// Creates a new vector from an array. + fn from_array(a: [i32; 3]) -> Val { let output: Val = bevy::math::IVec3::from_array(a).into(); output } - fn is_negative_bitmask(_self: Val) { + /// Returns a bitmask with the lowest 3 bits set to the sign bits from the elements of `self`. + /// A negative element results in a `1` bit and a positive element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn is_negative_bitmask(_self: Val) -> u32 { let output: u32 = bevy::math::IVec3::is_negative_bitmask(_self.into_inner()) .into(); output } - fn length_squared(_self: Val) { + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> i32 { let output: i32 = bevy::math::IVec3::length_squared(_self.into_inner()).into(); output } - fn max(_self: Val, rhs: Val) { + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec3::max( _self.into_inner(), rhs.into_inner(), @@ -2277,11 +3633,18 @@ impl bevy::math::IVec3 { .into(); output } - fn max_element(_self: Val) { + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> i32 { let output: i32 = bevy::math::IVec3::max_element(_self.into_inner()).into(); output } - fn min(_self: Val, rhs: Val) { + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec3::min( _self.into_inner(), rhs.into_inner(), @@ -2289,64 +3652,86 @@ impl bevy::math::IVec3 { .into(); output } - fn min_element(_self: Val) { + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> i32 { let output: i32 = bevy::math::IVec3::min_element(_self.into_inner()).into(); output } - fn mul(_self: Val, rhs: Ref) { + fn mul( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::mul(_self.into_inner(), &rhs) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: i32) { + fn mul(_self: Val, rhs: i32) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } - fn new(x: i32, y: i32, z: i32) { + /// Creates a new vector. + fn new(x: i32, y: i32, z: i32) -> Val { let output: Val = bevy::math::IVec3::new(x, y, z).into(); output } - fn rem(_self: Val, rhs: Ref) { + fn rem( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::rem(_self.into_inner(), &rhs) .into(); output } - fn rem(_self: Val, rhs: Val) { + fn rem( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) .into(); output } - fn rem(_self: Val, rhs: i32) { + fn rem(_self: Val, rhs: i32) -> Val { let output: Val = >::rem(_self.into_inner(), rhs) .into(); output } - fn rem_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + /// [Euclidean division]: i32::rem_euclid + fn rem_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec3::rem_euclid( _self.into_inner(), rhs.into_inner(), @@ -2354,7 +3739,12 @@ impl bevy::math::IVec3 { .into(); output } - fn saturating_add(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec3::saturating_add( _self.into_inner(), rhs.into_inner(), @@ -2362,10 +3752,11 @@ impl bevy::math::IVec3 { .into(); output } + /// In other words this computes `[self.x.saturating_add_unsigned(rhs.x), self.y.saturating_add_unsigned(rhs.y), ..]`. fn saturating_add_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::IVec3::saturating_add_unsigned( _self.into_inner(), rhs.into_inner(), @@ -2373,7 +3764,12 @@ impl bevy::math::IVec3 { .into(); output } - fn saturating_div(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec3::saturating_div( _self.into_inner(), rhs.into_inner(), @@ -2381,7 +3777,12 @@ impl bevy::math::IVec3 { .into(); output } - fn saturating_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec3::saturating_mul( _self.into_inner(), rhs.into_inner(), @@ -2389,7 +3790,12 @@ impl bevy::math::IVec3 { .into(); output } - fn saturating_sub(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec3::saturating_sub( _self.into_inner(), rhs.into_inner(), @@ -2397,10 +3803,12 @@ impl bevy::math::IVec3 { .into(); output } + /// Returns a vector containing the saturating subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.saturating_sub_unsigned(rhs.x), self.y.saturating_sub_unsigned(rhs.y), ..]`. fn saturating_sub_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::IVec3::saturating_sub_unsigned( _self.into_inner(), rhs.into_inner(), @@ -2408,11 +3816,15 @@ impl bevy::math::IVec3 { .into(); output } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. fn select( mask: Val, if_true: Val, if_false: Val, - ) { + ) -> Val { let output: Val = bevy::math::IVec3::select( mask.into_inner(), if_true.into_inner(), @@ -2421,50 +3833,65 @@ impl bevy::math::IVec3 { .into(); output } - fn signum(_self: Val) { + /// Returns a vector with elements representing the sign of `self`. + /// - `0` if the number is zero + /// - `1` if the number is positive + /// - `-1` if the number is negative + fn signum(_self: Val) -> Val { let output: Val = bevy::math::IVec3::signum( _self.into_inner(), ) .into(); output } - fn splat(v: i32) { + /// Creates a vector with all elements set to `v`. + fn splat(v: i32) -> Val { let output: Val = bevy::math::IVec3::splat(v).into(); output } - fn sub(_self: Val, rhs: Ref) { + fn sub( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::sub(_self.into_inner(), &rhs) .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub(_self: Val, rhs: i32) { + fn sub(_self: Val, rhs: i32) -> Val { let output: Val = >::sub(_self.into_inner(), rhs) .into(); output } - fn to_array(_self: Ref) { + /// `[x, y, z]` + fn to_array(_self: Ref) -> [i32; 3] { let output: [i32; 3] = bevy::math::IVec3::to_array(&_self).into(); output } - fn truncate(_self: Val) { + /// Creates a 2D vector from the `x` and `y` elements of `self`, discarding `z`. + /// Truncation may also be performed by using [`self.xy()`][crate::swizzles::Vec3Swizzles::xy()]. + fn truncate(_self: Val) -> Val { let output: Val = bevy::math::IVec3::truncate( _self.into_inner(), ) .into(); output } - fn with_x(_self: Val, x: i32) { + /// Creates a 3D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: i32) -> Val { let output: Val = bevy::math::IVec3::with_x( _self.into_inner(), x, @@ -2472,7 +3899,8 @@ impl bevy::math::IVec3 { .into(); output } - fn with_y(_self: Val, y: i32) { + /// Creates a 3D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: i32) -> Val { let output: Val = bevy::math::IVec3::with_y( _self.into_inner(), y, @@ -2480,7 +3908,8 @@ impl bevy::math::IVec3 { .into(); output } - fn with_z(_self: Val, z: i32) { + /// Creates a 3D vector from `self` with the given value of `z`. + fn with_z(_self: Val, z: i32) -> Val { let output: Val = bevy::math::IVec3::with_z( _self.into_inner(), z, @@ -2488,7 +3917,12 @@ impl bevy::math::IVec3 { .into(); output } - fn wrapping_add(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec3::wrapping_add( _self.into_inner(), rhs.into_inner(), @@ -2496,10 +3930,12 @@ impl bevy::math::IVec3 { .into(); output } + /// Returns a vector containing the wrapping addition of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_unsigned(rhs.x), self.y.wrapping_add_unsigned(rhs.y), ..]`. fn wrapping_add_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::IVec3::wrapping_add_unsigned( _self.into_inner(), rhs.into_inner(), @@ -2507,7 +3943,12 @@ impl bevy::math::IVec3 { .into(); output } - fn wrapping_div(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec3::wrapping_div( _self.into_inner(), rhs.into_inner(), @@ -2515,7 +3956,12 @@ impl bevy::math::IVec3 { .into(); output } - fn wrapping_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec3::wrapping_mul( _self.into_inner(), rhs.into_inner(), @@ -2523,7 +3969,12 @@ impl bevy::math::IVec3 { .into(); output } - fn wrapping_sub(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec3::wrapping_sub( _self.into_inner(), rhs.into_inner(), @@ -2531,10 +3982,12 @@ impl bevy::math::IVec3 { .into(); output } + /// Returns a vector containing the wrapping subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_sub_unsigned(rhs.x), self.y.wrapping_sub_unsigned(rhs.y), ..]`. fn wrapping_sub_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::IVec3::wrapping_sub_unsigned( _self.into_inner(), rhs.into_inner(), @@ -2549,66 +4002,82 @@ impl bevy::math::IVec3 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::IVec4 { - fn abs(_self: Val) { + /// Returns a vector containing the absolute value of each element of `self`. + fn abs(_self: Val) -> Val { let output: Val = bevy::math::IVec4::abs(_self.into_inner()) .into(); output } - fn add(_self: Val, rhs: Ref) { + fn add( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::add(_self.into_inner(), &rhs) .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add(_self: Val, rhs: i32) { + fn add(_self: Val, rhs: i32) -> Val { let output: Val = >::add(_self.into_inner(), rhs) .into(); output } - fn as_dvec4(_self: Ref) { + /// Casts all elements of `self` to `f64`. + fn as_dvec4(_self: Ref) -> Val { let output: Val = bevy::math::IVec4::as_dvec4(&_self).into(); output } - fn as_i64vec4(_self: Ref) { + /// Casts all elements of `self` to `i64`. + fn as_i64vec4(_self: Ref) -> Val { let output: Val = bevy::math::IVec4::as_i64vec4(&_self) .into(); output } - fn as_u64vec4(_self: Ref) { + /// Casts all elements of `self` to `u64`. + fn as_u64vec4(_self: Ref) -> Val { let output: Val = bevy::math::IVec4::as_u64vec4(&_self) .into(); output } - fn as_uvec4(_self: Ref) { + /// Casts all elements of `self` to `u32`. + fn as_uvec4(_self: Ref) -> Val { let output: Val = bevy::math::IVec4::as_uvec4(&_self).into(); output } - fn as_vec4(_self: Ref) { + /// Casts all elements of `self` to `f32`. + fn as_vec4(_self: Ref) -> Val { let output: Val = bevy::math::IVec4::as_vec4(&_self).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } + /// Component-wise clamping of values, similar to [`i32::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( _self: Val, min: Val, max: Val, - ) { + ) -> Val { let output: Val = bevy::math::IVec4::clamp( _self.into_inner(), min.into_inner(), @@ -2617,14 +4086,21 @@ impl bevy::math::IVec4 { .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn cmpeq(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec4::cmpeq( _self.into_inner(), rhs.into_inner(), @@ -2632,7 +4108,14 @@ impl bevy::math::IVec4 { .into(); output } - fn cmpge(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec4::cmpge( _self.into_inner(), rhs.into_inner(), @@ -2640,7 +4123,14 @@ impl bevy::math::IVec4 { .into(); output } - fn cmpgt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec4::cmpgt( _self.into_inner(), rhs.into_inner(), @@ -2648,7 +4138,14 @@ impl bevy::math::IVec4 { .into(); output } - fn cmple(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec4::cmple( _self.into_inner(), rhs.into_inner(), @@ -2656,7 +4153,14 @@ impl bevy::math::IVec4 { .into(); output } - fn cmplt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec4::cmplt( _self.into_inner(), rhs.into_inner(), @@ -2664,7 +4168,14 @@ impl bevy::math::IVec4 { .into(); output } - fn cmpne(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec4::cmpne( _self.into_inner(), rhs.into_inner(), @@ -2672,7 +4183,11 @@ impl bevy::math::IVec4 { .into(); output } - fn distance_squared(_self: Val, rhs: Val) { + /// Compute the squared euclidean distance between two points in space. + fn distance_squared( + _self: Val, + rhs: Val, + ) -> i32 { let output: i32 = bevy::math::IVec4::distance_squared( _self.into_inner(), rhs.into_inner(), @@ -2680,28 +4195,40 @@ impl bevy::math::IVec4 { .into(); output } - fn div(_self: Val, rhs: Ref) { + fn div( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::div(_self.into_inner(), &rhs) .into(); output } - fn div(_self: Val, rhs: Val) { + fn div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::div(_self.into_inner(), rhs.into_inner()) .into(); output } - fn div(_self: Val, rhs: i32) { + fn div(_self: Val, rhs: i32) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn div_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + fn div_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec4::div_euclid( _self.into_inner(), rhs.into_inner(), @@ -2709,12 +4236,17 @@ impl bevy::math::IVec4 { .into(); output } - fn dot(_self: Val, rhs: Val) { + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> i32 { let output: i32 = bevy::math::IVec4::dot(_self.into_inner(), rhs.into_inner()) .into(); output } - fn dot_into_vec(_self: Val, rhs: Val) { + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec4::dot_into_vec( _self.into_inner(), rhs.into_inner(), @@ -2722,35 +4254,49 @@ impl bevy::math::IVec4 { .into(); output } - fn element_product(_self: Val) { + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> i32 { let output: i32 = bevy::math::IVec4::element_product(_self.into_inner()).into(); output } - fn element_sum(_self: Val) { + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> i32 { let output: i32 = bevy::math::IVec4::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn from_array(a: [i32; 4]) { + /// Creates a new vector from an array. + fn from_array(a: [i32; 4]) -> Val { let output: Val = bevy::math::IVec4::from_array(a).into(); output } - fn is_negative_bitmask(_self: Val) { + /// Returns a bitmask with the lowest 4 bits set to the sign bits from the elements of `self`. + /// A negative element results in a `1` bit and a positive element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn is_negative_bitmask(_self: Val) -> u32 { let output: u32 = bevy::math::IVec4::is_negative_bitmask(_self.into_inner()) .into(); output } - fn length_squared(_self: Val) { + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> i32 { let output: i32 = bevy::math::IVec4::length_squared(_self.into_inner()).into(); output } - fn max(_self: Val, rhs: Val) { + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec4::max( _self.into_inner(), rhs.into_inner(), @@ -2758,11 +4304,18 @@ impl bevy::math::IVec4 { .into(); output } - fn max_element(_self: Val) { + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> i32 { let output: i32 = bevy::math::IVec4::max_element(_self.into_inner()).into(); output } - fn min(_self: Val, rhs: Val) { + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec4::min( _self.into_inner(), rhs.into_inner(), @@ -2770,64 +4323,86 @@ impl bevy::math::IVec4 { .into(); output } - fn min_element(_self: Val) { + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> i32 { let output: i32 = bevy::math::IVec4::min_element(_self.into_inner()).into(); output } - fn mul(_self: Val, rhs: Ref) { + fn mul( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::mul(_self.into_inner(), &rhs) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: i32) { + fn mul(_self: Val, rhs: i32) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } - fn new(x: i32, y: i32, z: i32, w: i32) { + /// Creates a new vector. + fn new(x: i32, y: i32, z: i32, w: i32) -> Val { let output: Val = bevy::math::IVec4::new(x, y, z, w).into(); output } - fn rem(_self: Val, rhs: Ref) { + fn rem( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::rem(_self.into_inner(), &rhs) .into(); output } - fn rem(_self: Val, rhs: Val) { + fn rem( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) .into(); output } - fn rem(_self: Val, rhs: i32) { + fn rem(_self: Val, rhs: i32) -> Val { let output: Val = >::rem(_self.into_inner(), rhs) .into(); output } - fn rem_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + /// [Euclidean division]: i32::rem_euclid + fn rem_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec4::rem_euclid( _self.into_inner(), rhs.into_inner(), @@ -2835,7 +4410,12 @@ impl bevy::math::IVec4 { .into(); output } - fn saturating_add(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec4::saturating_add( _self.into_inner(), rhs.into_inner(), @@ -2843,10 +4423,11 @@ impl bevy::math::IVec4 { .into(); output } + /// In other words this computes `[self.x.saturating_add_unsigned(rhs.x), self.y.saturating_add_unsigned(rhs.y), ..]`. fn saturating_add_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::IVec4::saturating_add_unsigned( _self.into_inner(), rhs.into_inner(), @@ -2854,7 +4435,12 @@ impl bevy::math::IVec4 { .into(); output } - fn saturating_div(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec4::saturating_div( _self.into_inner(), rhs.into_inner(), @@ -2862,7 +4448,12 @@ impl bevy::math::IVec4 { .into(); output } - fn saturating_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec4::saturating_mul( _self.into_inner(), rhs.into_inner(), @@ -2870,18 +4461,25 @@ impl bevy::math::IVec4 { .into(); output } - fn saturating_sub(_self: Val, rhs: Val) { - let output: Val = bevy::math::IVec4::saturating_sub( - _self.into_inner(), + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::IVec4::saturating_sub( + _self.into_inner(), rhs.into_inner(), ) .into(); output } + /// Returns a vector containing the saturating subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.saturating_sub_unsigned(rhs.x), self.y.saturating_sub_unsigned(rhs.y), ..]`. fn saturating_sub_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::IVec4::saturating_sub_unsigned( _self.into_inner(), rhs.into_inner(), @@ -2889,11 +4487,15 @@ impl bevy::math::IVec4 { .into(); output } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. fn select( mask: Val, if_true: Val, if_false: Val, - ) { + ) -> Val { let output: Val = bevy::math::IVec4::select( mask.into_inner(), if_true.into_inner(), @@ -2902,50 +4504,65 @@ impl bevy::math::IVec4 { .into(); output } - fn signum(_self: Val) { + /// Returns a vector with elements representing the sign of `self`. + /// - `0` if the number is zero + /// - `1` if the number is positive + /// - `-1` if the number is negative + fn signum(_self: Val) -> Val { let output: Val = bevy::math::IVec4::signum( _self.into_inner(), ) .into(); output } - fn splat(v: i32) { + /// Creates a vector with all elements set to `v`. + fn splat(v: i32) -> Val { let output: Val = bevy::math::IVec4::splat(v).into(); output } - fn sub(_self: Val, rhs: Ref) { + fn sub( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::sub(_self.into_inner(), &rhs) .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub(_self: Val, rhs: i32) { + fn sub(_self: Val, rhs: i32) -> Val { let output: Val = >::sub(_self.into_inner(), rhs) .into(); output } - fn to_array(_self: Ref) { + /// `[x, y, z, w]` + fn to_array(_self: Ref) -> [i32; 4] { let output: [i32; 4] = bevy::math::IVec4::to_array(&_self).into(); output } - fn truncate(_self: Val) { + /// Creates a 3D vector from the `x`, `y` and `z` elements of `self`, discarding `w`. + /// Truncation to [`IVec3`] may also be performed by using [`self.xyz()`][crate::swizzles::Vec4Swizzles::xyz()]. + fn truncate(_self: Val) -> Val { let output: Val = bevy::math::IVec4::truncate( _self.into_inner(), ) .into(); output } - fn with_w(_self: Val, w: i32) { + /// Creates a 4D vector from `self` with the given value of `w`. + fn with_w(_self: Val, w: i32) -> Val { let output: Val = bevy::math::IVec4::with_w( _self.into_inner(), w, @@ -2953,7 +4570,8 @@ impl bevy::math::IVec4 { .into(); output } - fn with_x(_self: Val, x: i32) { + /// Creates a 4D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: i32) -> Val { let output: Val = bevy::math::IVec4::with_x( _self.into_inner(), x, @@ -2961,7 +4579,8 @@ impl bevy::math::IVec4 { .into(); output } - fn with_y(_self: Val, y: i32) { + /// Creates a 4D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: i32) -> Val { let output: Val = bevy::math::IVec4::with_y( _self.into_inner(), y, @@ -2969,7 +4588,8 @@ impl bevy::math::IVec4 { .into(); output } - fn with_z(_self: Val, z: i32) { + /// Creates a 4D vector from `self` with the given value of `z`. + fn with_z(_self: Val, z: i32) -> Val { let output: Val = bevy::math::IVec4::with_z( _self.into_inner(), z, @@ -2977,7 +4597,12 @@ impl bevy::math::IVec4 { .into(); output } - fn wrapping_add(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec4::wrapping_add( _self.into_inner(), rhs.into_inner(), @@ -2985,10 +4610,12 @@ impl bevy::math::IVec4 { .into(); output } + /// Returns a vector containing the wrapping addition of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_unsigned(rhs.x), self.y.wrapping_add_unsigned(rhs.y), ..]`. fn wrapping_add_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::IVec4::wrapping_add_unsigned( _self.into_inner(), rhs.into_inner(), @@ -2996,7 +4623,12 @@ impl bevy::math::IVec4 { .into(); output } - fn wrapping_div(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec4::wrapping_div( _self.into_inner(), rhs.into_inner(), @@ -3004,7 +4636,12 @@ impl bevy::math::IVec4 { .into(); output } - fn wrapping_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec4::wrapping_mul( _self.into_inner(), rhs.into_inner(), @@ -3012,7 +4649,12 @@ impl bevy::math::IVec4 { .into(); output } - fn wrapping_sub(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::IVec4::wrapping_sub( _self.into_inner(), rhs.into_inner(), @@ -3020,10 +4662,12 @@ impl bevy::math::IVec4 { .into(); output } + /// Returns a vector containing the wrapping subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_sub_unsigned(rhs.x), self.y.wrapping_sub_unsigned(rhs.y), ..]`. fn wrapping_sub_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::IVec4::wrapping_sub_unsigned( _self.into_inner(), rhs.into_inner(), @@ -3038,70 +4682,86 @@ impl bevy::math::IVec4 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::I64Vec2 { - fn abs(_self: Val) { + /// Returns a vector containing the absolute value of each element of `self`. + fn abs(_self: Val) -> Val { let output: Val = bevy::math::I64Vec2::abs( _self.into_inner(), ) .into(); output } - fn add(_self: Val, rhs: Ref) { + fn add( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::add(_self.into_inner(), &rhs) .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add(_self: Val, rhs: i64) { + fn add(_self: Val, rhs: i64) -> Val { let output: Val = >::add(_self.into_inner(), rhs) .into(); output } - fn as_dvec2(_self: Ref) { + /// Casts all elements of `self` to `f64`. + fn as_dvec2(_self: Ref) -> Val { let output: Val = bevy::math::I64Vec2::as_dvec2(&_self) .into(); output } - fn as_ivec2(_self: Ref) { + /// Casts all elements of `self` to `i32`. + fn as_ivec2(_self: Ref) -> Val { let output: Val = bevy::math::I64Vec2::as_ivec2(&_self) .into(); output } - fn as_u64vec2(_self: Ref) { + /// Casts all elements of `self` to `u64`. + fn as_u64vec2(_self: Ref) -> Val { let output: Val = bevy::math::I64Vec2::as_u64vec2(&_self) .into(); output } - fn as_uvec2(_self: Ref) { + /// Casts all elements of `self` to `u32`. + fn as_uvec2(_self: Ref) -> Val { let output: Val = bevy::math::I64Vec2::as_uvec2(&_self) .into(); output } - fn as_vec2(_self: Ref) { + /// Casts all elements of `self` to `f32`. + fn as_vec2(_self: Ref) -> Val { let output: Val = bevy::math::I64Vec2::as_vec2(&_self).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } + /// Component-wise clamping of values, similar to [`i64::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( _self: Val, min: Val, max: Val, - ) { + ) -> Val { let output: Val = bevy::math::I64Vec2::clamp( _self.into_inner(), min.into_inner(), @@ -3110,14 +4770,21 @@ impl bevy::math::I64Vec2 { .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn cmpeq(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec2::cmpeq( _self.into_inner(), rhs.into_inner(), @@ -3125,7 +4792,14 @@ impl bevy::math::I64Vec2 { .into(); output } - fn cmpge(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec2::cmpge( _self.into_inner(), rhs.into_inner(), @@ -3133,7 +4807,14 @@ impl bevy::math::I64Vec2 { .into(); output } - fn cmpgt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec2::cmpgt( _self.into_inner(), rhs.into_inner(), @@ -3141,7 +4822,14 @@ impl bevy::math::I64Vec2 { .into(); output } - fn cmple(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec2::cmple( _self.into_inner(), rhs.into_inner(), @@ -3149,7 +4837,14 @@ impl bevy::math::I64Vec2 { .into(); output } - fn cmplt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec2::cmplt( _self.into_inner(), rhs.into_inner(), @@ -3157,7 +4852,14 @@ impl bevy::math::I64Vec2 { .into(); output } - fn cmpne(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec2::cmpne( _self.into_inner(), rhs.into_inner(), @@ -3165,7 +4867,11 @@ impl bevy::math::I64Vec2 { .into(); output } - fn distance_squared(_self: Val, rhs: Val) { + /// Compute the squared euclidean distance between two points in space. + fn distance_squared( + _self: Val, + rhs: Val, + ) -> i64 { let output: i64 = bevy::math::I64Vec2::distance_squared( _self.into_inner(), rhs.into_inner(), @@ -3173,28 +4879,40 @@ impl bevy::math::I64Vec2 { .into(); output } - fn div(_self: Val, rhs: Ref) { + fn div( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::div(_self.into_inner(), &rhs) .into(); output } - fn div(_self: Val, rhs: Val) { + fn div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::div(_self.into_inner(), rhs.into_inner()) .into(); output } - fn div(_self: Val, rhs: i64) { + fn div(_self: Val, rhs: i64) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn div_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + fn div_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec2::div_euclid( _self.into_inner(), rhs.into_inner(), @@ -3202,12 +4920,17 @@ impl bevy::math::I64Vec2 { .into(); output } - fn dot(_self: Val, rhs: Val) { + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> i64 { let output: i64 = bevy::math::I64Vec2::dot(_self.into_inner(), rhs.into_inner()) .into(); output } - fn dot_into_vec(_self: Val, rhs: Val) { + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec2::dot_into_vec( _self.into_inner(), rhs.into_inner(), @@ -3215,23 +4938,28 @@ impl bevy::math::I64Vec2 { .into(); output } - fn element_product(_self: Val) { + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> i64 { let output: i64 = bevy::math::I64Vec2::element_product(_self.into_inner()) .into(); output } - fn element_sum(_self: Val) { + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> i64 { let output: i64 = bevy::math::I64Vec2::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn extend(_self: Val, z: i64) { + /// Creates a 3D vector from `self` and the given `z` value. + fn extend(_self: Val, z: i64) -> Val { let output: Val = bevy::math::I64Vec2::extend( _self.into_inner(), z, @@ -3239,20 +4967,30 @@ impl bevy::math::I64Vec2 { .into(); output } - fn from_array(a: [i64; 2]) { + /// Creates a new vector from an array. + fn from_array(a: [i64; 2]) -> Val { let output: Val = bevy::math::I64Vec2::from_array(a).into(); output } - fn is_negative_bitmask(_self: Val) { + /// Returns a bitmask with the lowest 2 bits set to the sign bits from the elements of `self`. + /// A negative element results in a `1` bit and a positive element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn is_negative_bitmask(_self: Val) -> u32 { let output: u32 = bevy::math::I64Vec2::is_negative_bitmask(_self.into_inner()) .into(); output } - fn length_squared(_self: Val) { + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> i64 { let output: i64 = bevy::math::I64Vec2::length_squared(_self.into_inner()).into(); output } - fn max(_self: Val, rhs: Val) { + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec2::max( _self.into_inner(), rhs.into_inner(), @@ -3260,11 +4998,18 @@ impl bevy::math::I64Vec2 { .into(); output } - fn max_element(_self: Val) { + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> i64 { let output: i64 = bevy::math::I64Vec2::max_element(_self.into_inner()).into(); output } - fn min(_self: Val, rhs: Val) { + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec2::min( _self.into_inner(), rhs.into_inner(), @@ -3272,50 +5017,62 @@ impl bevy::math::I64Vec2 { .into(); output } - fn min_element(_self: Val) { + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> i64 { let output: i64 = bevy::math::I64Vec2::min_element(_self.into_inner()).into(); output } - fn mul(_self: Val, rhs: Ref) { + fn mul( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::mul(_self.into_inner(), &rhs) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: i64) { + fn mul(_self: Val, rhs: i64) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } - fn new(x: i64, y: i64) { + /// Creates a new vector. + fn new(x: i64, y: i64) -> Val { let output: Val = bevy::math::I64Vec2::new(x, y).into(); output } - fn perp(_self: Val) { + /// Returns a vector that is equal to `self` rotated by 90 degrees. + fn perp(_self: Val) -> Val { let output: Val = bevy::math::I64Vec2::perp( _self.into_inner(), ) .into(); output } - fn perp_dot(_self: Val, rhs: Val) { + /// The perpendicular dot product of `self` and `rhs`. + /// Also known as the wedge product, 2D cross product, and determinant. + fn perp_dot(_self: Val, rhs: Val) -> i64 { let output: i64 = bevy::math::I64Vec2::perp_dot( _self.into_inner(), rhs.into_inner(), @@ -3323,28 +5080,41 @@ impl bevy::math::I64Vec2 { .into(); output } - fn rem(_self: Val, rhs: Ref) { + fn rem( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::rem(_self.into_inner(), &rhs) .into(); output } - fn rem(_self: Val, rhs: Val) { + fn rem( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) .into(); output } - fn rem(_self: Val, rhs: i64) { + fn rem(_self: Val, rhs: i64) -> Val { let output: Val = >::rem(_self.into_inner(), rhs) .into(); output } - fn rem_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + /// [Euclidean division]: i64::rem_euclid + fn rem_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec2::rem_euclid( _self.into_inner(), rhs.into_inner(), @@ -3352,7 +5122,13 @@ impl bevy::math::I64Vec2 { .into(); output } - fn rotate(_self: Val, rhs: Val) { + /// Returns `rhs` rotated by the angle of `self`. If `self` is normalized, + /// then this just rotation. This is what you usually want. Otherwise, + /// it will be like a rotation with a multiplication by `self`'s length. + fn rotate( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec2::rotate( _self.into_inner(), rhs.into_inner(), @@ -3360,7 +5136,12 @@ impl bevy::math::I64Vec2 { .into(); output } - fn saturating_add(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec2::saturating_add( _self.into_inner(), rhs.into_inner(), @@ -3368,10 +5149,11 @@ impl bevy::math::I64Vec2 { .into(); output } + /// In other words this computes `[self.x.saturating_add_unsigned(rhs.x), self.y.saturating_add_unsigned(rhs.y), ..]`. fn saturating_add_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::I64Vec2::saturating_add_unsigned( _self.into_inner(), rhs.into_inner(), @@ -3379,7 +5161,12 @@ impl bevy::math::I64Vec2 { .into(); output } - fn saturating_div(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec2::saturating_div( _self.into_inner(), rhs.into_inner(), @@ -3387,7 +5174,12 @@ impl bevy::math::I64Vec2 { .into(); output } - fn saturating_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec2::saturating_mul( _self.into_inner(), rhs.into_inner(), @@ -3395,7 +5187,12 @@ impl bevy::math::I64Vec2 { .into(); output } - fn saturating_sub(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec2::saturating_sub( _self.into_inner(), rhs.into_inner(), @@ -3403,10 +5200,12 @@ impl bevy::math::I64Vec2 { .into(); output } + /// Returns a vector containing the saturating subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.saturating_sub_unsigned(rhs.x), self.y.saturating_sub_unsigned(rhs.y), ..]`. fn saturating_sub_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::I64Vec2::saturating_sub_unsigned( _self.into_inner(), rhs.into_inner(), @@ -3414,11 +5213,15 @@ impl bevy::math::I64Vec2 { .into(); output } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. fn select( mask: Val, if_true: Val, if_false: Val, - ) { + ) -> Val { let output: Val = bevy::math::I64Vec2::select( mask.into_inner(), if_true.into_inner(), @@ -3427,43 +5230,56 @@ impl bevy::math::I64Vec2 { .into(); output } - fn signum(_self: Val) { + /// Returns a vector with elements representing the sign of `self`. + /// - `0` if the number is zero + /// - `1` if the number is positive + /// - `-1` if the number is negative + fn signum(_self: Val) -> Val { let output: Val = bevy::math::I64Vec2::signum( _self.into_inner(), ) .into(); output } - fn splat(v: i64) { + /// Creates a vector with all elements set to `v`. + fn splat(v: i64) -> Val { let output: Val = bevy::math::I64Vec2::splat(v).into(); output } - fn sub(_self: Val, rhs: Ref) { + fn sub( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::sub(_self.into_inner(), &rhs) .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub(_self: Val, rhs: i64) { + fn sub(_self: Val, rhs: i64) -> Val { let output: Val = >::sub(_self.into_inner(), rhs) .into(); output } - fn to_array(_self: Ref) { + /// `[x, y]` + fn to_array(_self: Ref) -> [i64; 2] { let output: [i64; 2] = bevy::math::I64Vec2::to_array(&_self).into(); output } - fn with_x(_self: Val, x: i64) { + /// Creates a 2D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: i64) -> Val { let output: Val = bevy::math::I64Vec2::with_x( _self.into_inner(), x, @@ -3471,7 +5287,8 @@ impl bevy::math::I64Vec2 { .into(); output } - fn with_y(_self: Val, y: i64) { + /// Creates a 2D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: i64) -> Val { let output: Val = bevy::math::I64Vec2::with_y( _self.into_inner(), y, @@ -3479,7 +5296,12 @@ impl bevy::math::I64Vec2 { .into(); output } - fn wrapping_add(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec2::wrapping_add( _self.into_inner(), rhs.into_inner(), @@ -3487,10 +5309,12 @@ impl bevy::math::I64Vec2 { .into(); output } + /// Returns a vector containing the wrapping addition of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_unsigned(rhs.x), self.y.wrapping_add_unsigned(rhs.y), ..]`. fn wrapping_add_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::I64Vec2::wrapping_add_unsigned( _self.into_inner(), rhs.into_inner(), @@ -3498,7 +5322,12 @@ impl bevy::math::I64Vec2 { .into(); output } - fn wrapping_div(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec2::wrapping_div( _self.into_inner(), rhs.into_inner(), @@ -3506,7 +5335,12 @@ impl bevy::math::I64Vec2 { .into(); output } - fn wrapping_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec2::wrapping_mul( _self.into_inner(), rhs.into_inner(), @@ -3514,7 +5348,12 @@ impl bevy::math::I64Vec2 { .into(); output } - fn wrapping_sub(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec2::wrapping_sub( _self.into_inner(), rhs.into_inner(), @@ -3522,10 +5361,12 @@ impl bevy::math::I64Vec2 { .into(); output } + /// Returns a vector containing the wrapping subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_sub_unsigned(rhs.x), self.y.wrapping_sub_unsigned(rhs.y), ..]`. fn wrapping_sub_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::I64Vec2::wrapping_sub_unsigned( _self.into_inner(), rhs.into_inner(), @@ -3540,75 +5381,92 @@ impl bevy::math::I64Vec2 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::I64Vec3 { - fn abs(_self: Val) { + /// Returns a vector containing the absolute value of each element of `self`. + fn abs(_self: Val) -> Val { let output: Val = bevy::math::I64Vec3::abs( _self.into_inner(), ) .into(); output } - fn add(_self: Val, rhs: Ref) { + fn add( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::add(_self.into_inner(), &rhs) .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add(_self: Val, rhs: i64) { + fn add(_self: Val, rhs: i64) -> Val { let output: Val = >::add(_self.into_inner(), rhs) .into(); output } - fn as_dvec3(_self: Ref) { + /// Casts all elements of `self` to `f64`. + fn as_dvec3(_self: Ref) -> Val { let output: Val = bevy::math::I64Vec3::as_dvec3(&_self) .into(); output } - fn as_ivec3(_self: Ref) { + /// Casts all elements of `self` to `i32`. + fn as_ivec3(_self: Ref) -> Val { let output: Val = bevy::math::I64Vec3::as_ivec3(&_self) .into(); output } - fn as_u64vec3(_self: Ref) { + /// Casts all elements of `self` to `u64`. + fn as_u64vec3(_self: Ref) -> Val { let output: Val = bevy::math::I64Vec3::as_u64vec3(&_self) .into(); output } - fn as_uvec3(_self: Ref) { + /// Casts all elements of `self` to `u32`. + fn as_uvec3(_self: Ref) -> Val { let output: Val = bevy::math::I64Vec3::as_uvec3(&_self) .into(); output } - fn as_vec3(_self: Ref) { + /// Casts all elements of `self` to `f32`. + fn as_vec3(_self: Ref) -> Val { let output: Val = bevy::math::I64Vec3::as_vec3(&_self).into(); output } - fn as_vec3a(_self: Ref) { + /// Casts all elements of `self` to `f32`. + fn as_vec3a(_self: Ref) -> Val { let output: Val = bevy::math::I64Vec3::as_vec3a(&_self) .into(); output } - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } + /// Component-wise clamping of values, similar to [`i64::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( _self: Val, min: Val, max: Val, - ) { + ) -> Val { let output: Val = bevy::math::I64Vec3::clamp( _self.into_inner(), min.into_inner(), @@ -3617,14 +5475,21 @@ impl bevy::math::I64Vec3 { .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn cmpeq(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec3::cmpeq( _self.into_inner(), rhs.into_inner(), @@ -3632,7 +5497,14 @@ impl bevy::math::I64Vec3 { .into(); output } - fn cmpge(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec3::cmpge( _self.into_inner(), rhs.into_inner(), @@ -3640,7 +5512,14 @@ impl bevy::math::I64Vec3 { .into(); output } - fn cmpgt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec3::cmpgt( _self.into_inner(), rhs.into_inner(), @@ -3648,7 +5527,14 @@ impl bevy::math::I64Vec3 { .into(); output } - fn cmple(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec3::cmple( _self.into_inner(), rhs.into_inner(), @@ -3656,7 +5542,14 @@ impl bevy::math::I64Vec3 { .into(); output } - fn cmplt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec3::cmplt( _self.into_inner(), rhs.into_inner(), @@ -3664,7 +5557,14 @@ impl bevy::math::I64Vec3 { .into(); output } - fn cmpne(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec3::cmpne( _self.into_inner(), rhs.into_inner(), @@ -3672,7 +5572,11 @@ impl bevy::math::I64Vec3 { .into(); output } - fn cross(_self: Val, rhs: Val) { + /// Computes the cross product of `self` and `rhs`. + fn cross( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec3::cross( _self.into_inner(), rhs.into_inner(), @@ -3680,7 +5584,11 @@ impl bevy::math::I64Vec3 { .into(); output } - fn distance_squared(_self: Val, rhs: Val) { + /// Compute the squared euclidean distance between two points in space. + fn distance_squared( + _self: Val, + rhs: Val, + ) -> i64 { let output: i64 = bevy::math::I64Vec3::distance_squared( _self.into_inner(), rhs.into_inner(), @@ -3688,28 +5596,40 @@ impl bevy::math::I64Vec3 { .into(); output } - fn div(_self: Val, rhs: Ref) { + fn div( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::div(_self.into_inner(), &rhs) .into(); output } - fn div(_self: Val, rhs: Val) { + fn div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::div(_self.into_inner(), rhs.into_inner()) .into(); output } - fn div(_self: Val, rhs: i64) { + fn div(_self: Val, rhs: i64) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn div_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + fn div_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec3::div_euclid( _self.into_inner(), rhs.into_inner(), @@ -3717,12 +5637,17 @@ impl bevy::math::I64Vec3 { .into(); output } - fn dot(_self: Val, rhs: Val) { + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> i64 { let output: i64 = bevy::math::I64Vec3::dot(_self.into_inner(), rhs.into_inner()) .into(); output } - fn dot_into_vec(_self: Val, rhs: Val) { + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec3::dot_into_vec( _self.into_inner(), rhs.into_inner(), @@ -3730,23 +5655,28 @@ impl bevy::math::I64Vec3 { .into(); output } - fn element_product(_self: Val) { + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> i64 { let output: i64 = bevy::math::I64Vec3::element_product(_self.into_inner()) .into(); output } - fn element_sum(_self: Val) { + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> i64 { let output: i64 = bevy::math::I64Vec3::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn extend(_self: Val, w: i64) { + /// Creates a 4D vector from `self` and the given `w` value. + fn extend(_self: Val, w: i64) -> Val { let output: Val = bevy::math::I64Vec3::extend( _self.into_inner(), w, @@ -3754,20 +5684,30 @@ impl bevy::math::I64Vec3 { .into(); output } - fn from_array(a: [i64; 3]) { + /// Creates a new vector from an array. + fn from_array(a: [i64; 3]) -> Val { let output: Val = bevy::math::I64Vec3::from_array(a).into(); output } - fn is_negative_bitmask(_self: Val) { + /// Returns a bitmask with the lowest 3 bits set to the sign bits from the elements of `self`. + /// A negative element results in a `1` bit and a positive element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn is_negative_bitmask(_self: Val) -> u32 { let output: u32 = bevy::math::I64Vec3::is_negative_bitmask(_self.into_inner()) .into(); output } - fn length_squared(_self: Val) { + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> i64 { let output: i64 = bevy::math::I64Vec3::length_squared(_self.into_inner()).into(); output } - fn max(_self: Val, rhs: Val) { + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec3::max( _self.into_inner(), rhs.into_inner(), @@ -3775,11 +5715,18 @@ impl bevy::math::I64Vec3 { .into(); output } - fn max_element(_self: Val) { + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> i64 { let output: i64 = bevy::math::I64Vec3::max_element(_self.into_inner()).into(); output } - fn min(_self: Val, rhs: Val) { + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec3::min( _self.into_inner(), rhs.into_inner(), @@ -3787,64 +5734,86 @@ impl bevy::math::I64Vec3 { .into(); output } - fn min_element(_self: Val) { + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> i64 { let output: i64 = bevy::math::I64Vec3::min_element(_self.into_inner()).into(); output } - fn mul(_self: Val, rhs: Ref) { + fn mul( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::mul(_self.into_inner(), &rhs) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: i64) { + fn mul(_self: Val, rhs: i64) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } - fn new(x: i64, y: i64, z: i64) { + /// Creates a new vector. + fn new(x: i64, y: i64, z: i64) -> Val { let output: Val = bevy::math::I64Vec3::new(x, y, z).into(); output } - fn rem(_self: Val, rhs: Ref) { + fn rem( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::rem(_self.into_inner(), &rhs) .into(); output } - fn rem(_self: Val, rhs: Val) { + fn rem( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) .into(); output } - fn rem(_self: Val, rhs: i64) { + fn rem(_self: Val, rhs: i64) -> Val { let output: Val = >::rem(_self.into_inner(), rhs) .into(); output } - fn rem_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + /// [Euclidean division]: i64::rem_euclid + fn rem_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec3::rem_euclid( _self.into_inner(), rhs.into_inner(), @@ -3852,7 +5821,12 @@ impl bevy::math::I64Vec3 { .into(); output } - fn saturating_add(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec3::saturating_add( _self.into_inner(), rhs.into_inner(), @@ -3860,10 +5834,11 @@ impl bevy::math::I64Vec3 { .into(); output } + /// In other words this computes `[self.x.saturating_add_unsigned(rhs.x), self.y.saturating_add_unsigned(rhs.y), ..]`. fn saturating_add_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::I64Vec3::saturating_add_unsigned( _self.into_inner(), rhs.into_inner(), @@ -3871,7 +5846,12 @@ impl bevy::math::I64Vec3 { .into(); output } - fn saturating_div(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec3::saturating_div( _self.into_inner(), rhs.into_inner(), @@ -3879,7 +5859,12 @@ impl bevy::math::I64Vec3 { .into(); output } - fn saturating_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec3::saturating_mul( _self.into_inner(), rhs.into_inner(), @@ -3887,7 +5872,12 @@ impl bevy::math::I64Vec3 { .into(); output } - fn saturating_sub(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec3::saturating_sub( _self.into_inner(), rhs.into_inner(), @@ -3895,10 +5885,12 @@ impl bevy::math::I64Vec3 { .into(); output } + /// Returns a vector containing the saturating subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.saturating_sub_unsigned(rhs.x), self.y.saturating_sub_unsigned(rhs.y), ..]`. fn saturating_sub_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::I64Vec3::saturating_sub_unsigned( _self.into_inner(), rhs.into_inner(), @@ -3906,11 +5898,15 @@ impl bevy::math::I64Vec3 { .into(); output } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. fn select( mask: Val, if_true: Val, if_false: Val, - ) { + ) -> Val { let output: Val = bevy::math::I64Vec3::select( mask.into_inner(), if_true.into_inner(), @@ -3919,50 +5915,65 @@ impl bevy::math::I64Vec3 { .into(); output } - fn signum(_self: Val) { + /// Returns a vector with elements representing the sign of `self`. + /// - `0` if the number is zero + /// - `1` if the number is positive + /// - `-1` if the number is negative + fn signum(_self: Val) -> Val { let output: Val = bevy::math::I64Vec3::signum( _self.into_inner(), ) .into(); output } - fn splat(v: i64) { + /// Creates a vector with all elements set to `v`. + fn splat(v: i64) -> Val { let output: Val = bevy::math::I64Vec3::splat(v).into(); output } - fn sub(_self: Val, rhs: Ref) { + fn sub( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::sub(_self.into_inner(), &rhs) .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub(_self: Val, rhs: i64) { + fn sub(_self: Val, rhs: i64) -> Val { let output: Val = >::sub(_self.into_inner(), rhs) .into(); output } - fn to_array(_self: Ref) { + /// `[x, y, z]` + fn to_array(_self: Ref) -> [i64; 3] { let output: [i64; 3] = bevy::math::I64Vec3::to_array(&_self).into(); output } - fn truncate(_self: Val) { + /// Creates a 2D vector from the `x` and `y` elements of `self`, discarding `z`. + /// Truncation may also be performed by using [`self.xy()`][crate::swizzles::Vec3Swizzles::xy()]. + fn truncate(_self: Val) -> Val { let output: Val = bevy::math::I64Vec3::truncate( _self.into_inner(), ) .into(); output } - fn with_x(_self: Val, x: i64) { + /// Creates a 3D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: i64) -> Val { let output: Val = bevy::math::I64Vec3::with_x( _self.into_inner(), x, @@ -3970,7 +5981,8 @@ impl bevy::math::I64Vec3 { .into(); output } - fn with_y(_self: Val, y: i64) { + /// Creates a 3D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: i64) -> Val { let output: Val = bevy::math::I64Vec3::with_y( _self.into_inner(), y, @@ -3978,7 +5990,8 @@ impl bevy::math::I64Vec3 { .into(); output } - fn with_z(_self: Val, z: i64) { + /// Creates a 3D vector from `self` with the given value of `z`. + fn with_z(_self: Val, z: i64) -> Val { let output: Val = bevy::math::I64Vec3::with_z( _self.into_inner(), z, @@ -3986,7 +5999,12 @@ impl bevy::math::I64Vec3 { .into(); output } - fn wrapping_add(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec3::wrapping_add( _self.into_inner(), rhs.into_inner(), @@ -3994,10 +6012,12 @@ impl bevy::math::I64Vec3 { .into(); output } + /// Returns a vector containing the wrapping addition of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_unsigned(rhs.x), self.y.wrapping_add_unsigned(rhs.y), ..]`. fn wrapping_add_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::I64Vec3::wrapping_add_unsigned( _self.into_inner(), rhs.into_inner(), @@ -4005,7 +6025,12 @@ impl bevy::math::I64Vec3 { .into(); output } - fn wrapping_div(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec3::wrapping_div( _self.into_inner(), rhs.into_inner(), @@ -4013,7 +6038,12 @@ impl bevy::math::I64Vec3 { .into(); output } - fn wrapping_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec3::wrapping_mul( _self.into_inner(), rhs.into_inner(), @@ -4021,7 +6051,12 @@ impl bevy::math::I64Vec3 { .into(); output } - fn wrapping_sub(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec3::wrapping_sub( _self.into_inner(), rhs.into_inner(), @@ -4029,10 +6064,12 @@ impl bevy::math::I64Vec3 { .into(); output } + /// Returns a vector containing the wrapping subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_sub_unsigned(rhs.x), self.y.wrapping_sub_unsigned(rhs.y), ..]`. fn wrapping_sub_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::I64Vec3::wrapping_sub_unsigned( _self.into_inner(), rhs.into_inner(), @@ -4047,70 +6084,86 @@ impl bevy::math::I64Vec3 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::I64Vec4 { - fn abs(_self: Val) { + /// Returns a vector containing the absolute value of each element of `self`. + fn abs(_self: Val) -> Val { let output: Val = bevy::math::I64Vec4::abs( _self.into_inner(), ) .into(); output } - fn add(_self: Val, rhs: Ref) { + fn add( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::add(_self.into_inner(), &rhs) .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add(_self: Val, rhs: i64) { + fn add(_self: Val, rhs: i64) -> Val { let output: Val = >::add(_self.into_inner(), rhs) .into(); output } - fn as_dvec4(_self: Ref) { + /// Casts all elements of `self` to `f64`. + fn as_dvec4(_self: Ref) -> Val { let output: Val = bevy::math::I64Vec4::as_dvec4(&_self) .into(); output } - fn as_ivec4(_self: Ref) { + /// Casts all elements of `self` to `i32`. + fn as_ivec4(_self: Ref) -> Val { let output: Val = bevy::math::I64Vec4::as_ivec4(&_self) .into(); output } - fn as_u64vec4(_self: Ref) { + /// Casts all elements of `self` to `u64`. + fn as_u64vec4(_self: Ref) -> Val { let output: Val = bevy::math::I64Vec4::as_u64vec4(&_self) .into(); output } - fn as_uvec4(_self: Ref) { + /// Casts all elements of `self` to `u32`. + fn as_uvec4(_self: Ref) -> Val { let output: Val = bevy::math::I64Vec4::as_uvec4(&_self) .into(); output } - fn as_vec4(_self: Ref) { + /// Casts all elements of `self` to `f32`. + fn as_vec4(_self: Ref) -> Val { let output: Val = bevy::math::I64Vec4::as_vec4(&_self).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } + /// Component-wise clamping of values, similar to [`i64::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( _self: Val, min: Val, max: Val, - ) { + ) -> Val { let output: Val = bevy::math::I64Vec4::clamp( _self.into_inner(), min.into_inner(), @@ -4119,14 +6172,21 @@ impl bevy::math::I64Vec4 { .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn cmpeq(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec4::cmpeq( _self.into_inner(), rhs.into_inner(), @@ -4134,7 +6194,14 @@ impl bevy::math::I64Vec4 { .into(); output } - fn cmpge(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec4::cmpge( _self.into_inner(), rhs.into_inner(), @@ -4142,7 +6209,14 @@ impl bevy::math::I64Vec4 { .into(); output } - fn cmpgt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec4::cmpgt( _self.into_inner(), rhs.into_inner(), @@ -4150,7 +6224,14 @@ impl bevy::math::I64Vec4 { .into(); output } - fn cmple(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec4::cmple( _self.into_inner(), rhs.into_inner(), @@ -4158,7 +6239,14 @@ impl bevy::math::I64Vec4 { .into(); output } - fn cmplt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec4::cmplt( _self.into_inner(), rhs.into_inner(), @@ -4166,7 +6254,14 @@ impl bevy::math::I64Vec4 { .into(); output } - fn cmpne(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec4::cmpne( _self.into_inner(), rhs.into_inner(), @@ -4174,7 +6269,11 @@ impl bevy::math::I64Vec4 { .into(); output } - fn distance_squared(_self: Val, rhs: Val) { + /// Compute the squared euclidean distance between two points in space. + fn distance_squared( + _self: Val, + rhs: Val, + ) -> i64 { let output: i64 = bevy::math::I64Vec4::distance_squared( _self.into_inner(), rhs.into_inner(), @@ -4182,28 +6281,40 @@ impl bevy::math::I64Vec4 { .into(); output } - fn div(_self: Val, rhs: Ref) { + fn div( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::div(_self.into_inner(), &rhs) .into(); output } - fn div(_self: Val, rhs: Val) { + fn div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::div(_self.into_inner(), rhs.into_inner()) .into(); output } - fn div(_self: Val, rhs: i64) { + fn div(_self: Val, rhs: i64) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn div_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + fn div_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec4::div_euclid( _self.into_inner(), rhs.into_inner(), @@ -4211,12 +6322,17 @@ impl bevy::math::I64Vec4 { .into(); output } - fn dot(_self: Val, rhs: Val) { + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> i64 { let output: i64 = bevy::math::I64Vec4::dot(_self.into_inner(), rhs.into_inner()) .into(); output } - fn dot_into_vec(_self: Val, rhs: Val) { + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec4::dot_into_vec( _self.into_inner(), rhs.into_inner(), @@ -4224,36 +6340,50 @@ impl bevy::math::I64Vec4 { .into(); output } - fn element_product(_self: Val) { + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> i64 { let output: i64 = bevy::math::I64Vec4::element_product(_self.into_inner()) .into(); output } - fn element_sum(_self: Val) { + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> i64 { let output: i64 = bevy::math::I64Vec4::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn from_array(a: [i64; 4]) { + /// Creates a new vector from an array. + fn from_array(a: [i64; 4]) -> Val { let output: Val = bevy::math::I64Vec4::from_array(a).into(); output } - fn is_negative_bitmask(_self: Val) { + /// Returns a bitmask with the lowest 4 bits set to the sign bits from the elements of `self`. + /// A negative element results in a `1` bit and a positive element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn is_negative_bitmask(_self: Val) -> u32 { let output: u32 = bevy::math::I64Vec4::is_negative_bitmask(_self.into_inner()) .into(); output } - fn length_squared(_self: Val) { + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> i64 { let output: i64 = bevy::math::I64Vec4::length_squared(_self.into_inner()).into(); output } - fn max(_self: Val, rhs: Val) { + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec4::max( _self.into_inner(), rhs.into_inner(), @@ -4261,11 +6391,18 @@ impl bevy::math::I64Vec4 { .into(); output } - fn max_element(_self: Val) { + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> i64 { let output: i64 = bevy::math::I64Vec4::max_element(_self.into_inner()).into(); output } - fn min(_self: Val, rhs: Val) { + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec4::min( _self.into_inner(), rhs.into_inner(), @@ -4273,65 +6410,87 @@ impl bevy::math::I64Vec4 { .into(); output } - fn min_element(_self: Val) { + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> i64 { let output: i64 = bevy::math::I64Vec4::min_element(_self.into_inner()).into(); output } - fn mul(_self: Val, rhs: Ref) { + fn mul( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::mul(_self.into_inner(), &rhs) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: i64) { + fn mul(_self: Val, rhs: i64) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } - fn new(x: i64, y: i64, z: i64, w: i64) { + /// Creates a new vector. + fn new(x: i64, y: i64, z: i64, w: i64) -> Val { let output: Val = bevy::math::I64Vec4::new(x, y, z, w) .into(); output } - fn rem(_self: Val, rhs: Ref) { + fn rem( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::rem(_self.into_inner(), &rhs) .into(); output } - fn rem(_self: Val, rhs: Val) { + fn rem( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) .into(); output } - fn rem(_self: Val, rhs: i64) { + fn rem(_self: Val, rhs: i64) -> Val { let output: Val = >::rem(_self.into_inner(), rhs) .into(); output } - fn rem_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + /// [Euclidean division]: i64::rem_euclid + fn rem_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec4::rem_euclid( _self.into_inner(), rhs.into_inner(), @@ -4339,7 +6498,12 @@ impl bevy::math::I64Vec4 { .into(); output } - fn saturating_add(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec4::saturating_add( _self.into_inner(), rhs.into_inner(), @@ -4347,10 +6511,11 @@ impl bevy::math::I64Vec4 { .into(); output } + /// In other words this computes `[self.x.saturating_add_unsigned(rhs.x), self.y.saturating_add_unsigned(rhs.y), ..]`. fn saturating_add_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::I64Vec4::saturating_add_unsigned( _self.into_inner(), rhs.into_inner(), @@ -4358,7 +6523,12 @@ impl bevy::math::I64Vec4 { .into(); output } - fn saturating_div(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec4::saturating_div( _self.into_inner(), rhs.into_inner(), @@ -4366,7 +6536,12 @@ impl bevy::math::I64Vec4 { .into(); output } - fn saturating_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec4::saturating_mul( _self.into_inner(), rhs.into_inner(), @@ -4374,7 +6549,12 @@ impl bevy::math::I64Vec4 { .into(); output } - fn saturating_sub(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec4::saturating_sub( _self.into_inner(), rhs.into_inner(), @@ -4382,10 +6562,12 @@ impl bevy::math::I64Vec4 { .into(); output } + /// Returns a vector containing the saturating subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.saturating_sub_unsigned(rhs.x), self.y.saturating_sub_unsigned(rhs.y), ..]`. fn saturating_sub_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::I64Vec4::saturating_sub_unsigned( _self.into_inner(), rhs.into_inner(), @@ -4393,11 +6575,15 @@ impl bevy::math::I64Vec4 { .into(); output } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. fn select( mask: Val, if_true: Val, if_false: Val, - ) { + ) -> Val { let output: Val = bevy::math::I64Vec4::select( mask.into_inner(), if_true.into_inner(), @@ -4406,50 +6592,65 @@ impl bevy::math::I64Vec4 { .into(); output } - fn signum(_self: Val) { + /// Returns a vector with elements representing the sign of `self`. + /// - `0` if the number is zero + /// - `1` if the number is positive + /// - `-1` if the number is negative + fn signum(_self: Val) -> Val { let output: Val = bevy::math::I64Vec4::signum( _self.into_inner(), ) .into(); output } - fn splat(v: i64) { + /// Creates a vector with all elements set to `v`. + fn splat(v: i64) -> Val { let output: Val = bevy::math::I64Vec4::splat(v).into(); output } - fn sub(_self: Val, rhs: Ref) { + fn sub( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::sub(_self.into_inner(), &rhs) .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub(_self: Val, rhs: i64) { + fn sub(_self: Val, rhs: i64) -> Val { let output: Val = >::sub(_self.into_inner(), rhs) .into(); output } - fn to_array(_self: Ref) { + /// `[x, y, z, w]` + fn to_array(_self: Ref) -> [i64; 4] { let output: [i64; 4] = bevy::math::I64Vec4::to_array(&_self).into(); output } - fn truncate(_self: Val) { + /// Creates a 3D vector from the `x`, `y` and `z` elements of `self`, discarding `w`. + /// Truncation to [`I64Vec3`] may also be performed by using [`self.xyz()`][crate::swizzles::Vec4Swizzles::xyz()]. + fn truncate(_self: Val) -> Val { let output: Val = bevy::math::I64Vec4::truncate( _self.into_inner(), ) .into(); output } - fn with_w(_self: Val, w: i64) { + /// Creates a 4D vector from `self` with the given value of `w`. + fn with_w(_self: Val, w: i64) -> Val { let output: Val = bevy::math::I64Vec4::with_w( _self.into_inner(), w, @@ -4457,7 +6658,8 @@ impl bevy::math::I64Vec4 { .into(); output } - fn with_x(_self: Val, x: i64) { + /// Creates a 4D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: i64) -> Val { let output: Val = bevy::math::I64Vec4::with_x( _self.into_inner(), x, @@ -4465,7 +6667,8 @@ impl bevy::math::I64Vec4 { .into(); output } - fn with_y(_self: Val, y: i64) { + /// Creates a 4D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: i64) -> Val { let output: Val = bevy::math::I64Vec4::with_y( _self.into_inner(), y, @@ -4473,7 +6676,8 @@ impl bevy::math::I64Vec4 { .into(); output } - fn with_z(_self: Val, z: i64) { + /// Creates a 4D vector from `self` with the given value of `z`. + fn with_z(_self: Val, z: i64) -> Val { let output: Val = bevy::math::I64Vec4::with_z( _self.into_inner(), z, @@ -4481,7 +6685,12 @@ impl bevy::math::I64Vec4 { .into(); output } - fn wrapping_add(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec4::wrapping_add( _self.into_inner(), rhs.into_inner(), @@ -4489,10 +6698,12 @@ impl bevy::math::I64Vec4 { .into(); output } + /// Returns a vector containing the wrapping addition of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_unsigned(rhs.x), self.y.wrapping_add_unsigned(rhs.y), ..]`. fn wrapping_add_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::I64Vec4::wrapping_add_unsigned( _self.into_inner(), rhs.into_inner(), @@ -4500,7 +6711,12 @@ impl bevy::math::I64Vec4 { .into(); output } - fn wrapping_div(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec4::wrapping_div( _self.into_inner(), rhs.into_inner(), @@ -4508,7 +6724,12 @@ impl bevy::math::I64Vec4 { .into(); output } - fn wrapping_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec4::wrapping_mul( _self.into_inner(), rhs.into_inner(), @@ -4516,7 +6737,12 @@ impl bevy::math::I64Vec4 { .into(); output } - fn wrapping_sub(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::I64Vec4::wrapping_sub( _self.into_inner(), rhs.into_inner(), @@ -4524,10 +6750,12 @@ impl bevy::math::I64Vec4 { .into(); output } + /// Returns a vector containing the wrapping subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_sub_unsigned(rhs.x), self.y.wrapping_sub_unsigned(rhs.y), ..]`. fn wrapping_sub_unsigned( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::I64Vec4::wrapping_sub_unsigned( _self.into_inner(), rhs.into_inner(), @@ -4542,61 +6770,76 @@ impl bevy::math::I64Vec4 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::UVec2 { - fn add(_self: Val, rhs: Ref) { + fn add( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::add(_self.into_inner(), &rhs) .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add(_self: Val, rhs: u32) { + fn add(_self: Val, rhs: u32) -> Val { let output: Val = >::add(_self.into_inner(), rhs) .into(); output } - fn as_dvec2(_self: Ref) { + /// Casts all elements of `self` to `f64`. + fn as_dvec2(_self: Ref) -> Val { let output: Val = bevy::math::UVec2::as_dvec2(&_self).into(); output } - fn as_i64vec2(_self: Ref) { + /// Casts all elements of `self` to `i64`. + fn as_i64vec2(_self: Ref) -> Val { let output: Val = bevy::math::UVec2::as_i64vec2(&_self) .into(); output } - fn as_ivec2(_self: Ref) { + /// Casts all elements of `self` to `i32`. + fn as_ivec2(_self: Ref) -> Val { let output: Val = bevy::math::UVec2::as_ivec2(&_self).into(); output } - fn as_u64vec2(_self: Ref) { + /// Casts all elements of `self` to `u64`. + fn as_u64vec2(_self: Ref) -> Val { let output: Val = bevy::math::UVec2::as_u64vec2(&_self) .into(); output } - fn as_vec2(_self: Ref) { + /// Casts all elements of `self` to `f32`. + fn as_vec2(_self: Ref) -> Val { let output: Val = bevy::math::UVec2::as_vec2(&_self).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } + /// Component-wise clamping of values, similar to [`u32::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( _self: Val, min: Val, max: Val, - ) { + ) -> Val { let output: Val = bevy::math::UVec2::clamp( _self.into_inner(), min.into_inner(), @@ -4605,14 +6848,21 @@ impl bevy::math::UVec2 { .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn cmpeq(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec2::cmpeq( _self.into_inner(), rhs.into_inner(), @@ -4620,7 +6870,14 @@ impl bevy::math::UVec2 { .into(); output } - fn cmpge(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec2::cmpge( _self.into_inner(), rhs.into_inner(), @@ -4628,7 +6885,14 @@ impl bevy::math::UVec2 { .into(); output } - fn cmpgt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec2::cmpgt( _self.into_inner(), rhs.into_inner(), @@ -4636,7 +6900,14 @@ impl bevy::math::UVec2 { .into(); output } - fn cmple(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec2::cmple( _self.into_inner(), rhs.into_inner(), @@ -4644,7 +6915,14 @@ impl bevy::math::UVec2 { .into(); output } - fn cmplt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec2::cmplt( _self.into_inner(), rhs.into_inner(), @@ -4652,7 +6930,14 @@ impl bevy::math::UVec2 { .into(); output } - fn cmpne(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec2::cmpne( _self.into_inner(), rhs.into_inner(), @@ -4660,33 +6945,44 @@ impl bevy::math::UVec2 { .into(); output } - fn div(_self: Val, rhs: Ref) { + fn div( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::div(_self.into_inner(), &rhs) .into(); output } - fn div(_self: Val, rhs: Val) { + fn div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::div(_self.into_inner(), rhs.into_inner()) .into(); output } - fn div(_self: Val, rhs: u32) { + fn div(_self: Val, rhs: u32) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn dot(_self: Val, rhs: Val) { + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> u32 { let output: u32 = bevy::math::UVec2::dot(_self.into_inner(), rhs.into_inner()) .into(); output } - fn dot_into_vec(_self: Val, rhs: Val) { + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec2::dot_into_vec( _self.into_inner(), rhs.into_inner(), @@ -4694,22 +6990,27 @@ impl bevy::math::UVec2 { .into(); output } - fn element_product(_self: Val) { + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> u32 { let output: u32 = bevy::math::UVec2::element_product(_self.into_inner()).into(); output } - fn element_sum(_self: Val) { + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> u32 { let output: u32 = bevy::math::UVec2::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn extend(_self: Val, z: u32) { + /// Creates a 3D vector from `self` and the given `z` value. + fn extend(_self: Val, z: u32) -> Val { let output: Val = bevy::math::UVec2::extend( _self.into_inner(), z, @@ -4717,15 +7018,22 @@ impl bevy::math::UVec2 { .into(); output } - fn from_array(a: [u32; 2]) { + /// Creates a new vector from an array. + fn from_array(a: [u32; 2]) -> Val { let output: Val = bevy::math::UVec2::from_array(a).into(); output } - fn length_squared(_self: Val) { + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> u32 { let output: u32 = bevy::math::UVec2::length_squared(_self.into_inner()).into(); output } - fn max(_self: Val, rhs: Val) { + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec2::max( _self.into_inner(), rhs.into_inner(), @@ -4733,11 +7041,18 @@ impl bevy::math::UVec2 { .into(); output } - fn max_element(_self: Val) { + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> u32 { let output: u32 = bevy::math::UVec2::max_element(_self.into_inner()).into(); output } - fn min(_self: Val, rhs: Val) { + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec2::min( _self.into_inner(), rhs.into_inner(), @@ -4745,57 +7060,77 @@ impl bevy::math::UVec2 { .into(); output } - fn min_element(_self: Val) { + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> u32 { let output: u32 = bevy::math::UVec2::min_element(_self.into_inner()).into(); output } - fn mul(_self: Val, rhs: Ref) { + fn mul( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::mul(_self.into_inner(), &rhs) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: u32) { + fn mul(_self: Val, rhs: u32) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn new(x: u32, y: u32) { + /// Creates a new vector. + fn new(x: u32, y: u32) -> Val { let output: Val = bevy::math::UVec2::new(x, y).into(); output } - fn rem(_self: Val, rhs: Ref) { + fn rem( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::rem(_self.into_inner(), &rhs) .into(); output } - fn rem(_self: Val, rhs: Val) { + fn rem( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) .into(); output } - fn rem(_self: Val, rhs: u32) { + fn rem(_self: Val, rhs: u32) -> Val { let output: Val = >::rem(_self.into_inner(), rhs) .into(); output } - fn saturating_add(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec2::saturating_add( _self.into_inner(), rhs.into_inner(), @@ -4803,10 +7138,12 @@ impl bevy::math::UVec2 { .into(); output } + /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`. fn saturating_add_signed( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::UVec2::saturating_add_signed( _self.into_inner(), rhs.into_inner(), @@ -4814,7 +7151,12 @@ impl bevy::math::UVec2 { .into(); output } - fn saturating_div(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec2::saturating_div( _self.into_inner(), rhs.into_inner(), @@ -4822,7 +7164,12 @@ impl bevy::math::UVec2 { .into(); output } - fn saturating_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec2::saturating_mul( _self.into_inner(), rhs.into_inner(), @@ -4830,7 +7177,12 @@ impl bevy::math::UVec2 { .into(); output } - fn saturating_sub(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec2::saturating_sub( _self.into_inner(), rhs.into_inner(), @@ -4838,11 +7190,15 @@ impl bevy::math::UVec2 { .into(); output } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. fn select( mask: Val, if_true: Val, if_false: Val, - ) { + ) -> Val { let output: Val = bevy::math::UVec2::select( mask.into_inner(), if_true.into_inner(), @@ -4851,36 +7207,45 @@ impl bevy::math::UVec2 { .into(); output } - fn splat(v: u32) { + /// Creates a vector with all elements set to `v`. + fn splat(v: u32) -> Val { let output: Val = bevy::math::UVec2::splat(v).into(); output } - fn sub(_self: Val, rhs: Ref) { + fn sub( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::sub(_self.into_inner(), &rhs) .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub(_self: Val, rhs: u32) { + fn sub(_self: Val, rhs: u32) -> Val { let output: Val = >::sub(_self.into_inner(), rhs) .into(); output } - fn to_array(_self: Ref) { + /// `[x, y]` + fn to_array(_self: Ref) -> [u32; 2] { let output: [u32; 2] = bevy::math::UVec2::to_array(&_self).into(); output } - fn with_x(_self: Val, x: u32) { + /// Creates a 2D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: u32) -> Val { let output: Val = bevy::math::UVec2::with_x( _self.into_inner(), x, @@ -4888,7 +7253,8 @@ impl bevy::math::UVec2 { .into(); output } - fn with_y(_self: Val, y: u32) { + /// Creates a 2D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: u32) -> Val { let output: Val = bevy::math::UVec2::with_y( _self.into_inner(), y, @@ -4896,7 +7262,12 @@ impl bevy::math::UVec2 { .into(); output } - fn wrapping_add(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec2::wrapping_add( _self.into_inner(), rhs.into_inner(), @@ -4904,7 +7275,12 @@ impl bevy::math::UVec2 { .into(); output } - fn wrapping_add_signed(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_signed(rhs.x), self.y.wrapping_add_signed(rhs.y), ..]`. + fn wrapping_add_signed( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec2::wrapping_add_signed( _self.into_inner(), rhs.into_inner(), @@ -4912,7 +7288,12 @@ impl bevy::math::UVec2 { .into(); output } - fn wrapping_div(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec2::wrapping_div( _self.into_inner(), rhs.into_inner(), @@ -4920,7 +7301,12 @@ impl bevy::math::UVec2 { .into(); output } - fn wrapping_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec2::wrapping_mul( _self.into_inner(), rhs.into_inner(), @@ -4928,7 +7314,12 @@ impl bevy::math::UVec2 { .into(); output } - fn wrapping_sub(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec2::wrapping_sub( _self.into_inner(), rhs.into_inner(), @@ -4943,65 +7334,81 @@ impl bevy::math::UVec2 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::UVec3 { - fn add(_self: Val, rhs: Ref) { + fn add( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::add(_self.into_inner(), &rhs) .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add(_self: Val, rhs: u32) { + fn add(_self: Val, rhs: u32) -> Val { let output: Val = >::add(_self.into_inner(), rhs) .into(); output } - fn as_dvec3(_self: Ref) { + /// Casts all elements of `self` to `f64`. + fn as_dvec3(_self: Ref) -> Val { let output: Val = bevy::math::UVec3::as_dvec3(&_self).into(); output } - fn as_i64vec3(_self: Ref) { + /// Casts all elements of `self` to `i64`. + fn as_i64vec3(_self: Ref) -> Val { let output: Val = bevy::math::UVec3::as_i64vec3(&_self) .into(); output } - fn as_ivec3(_self: Ref) { + /// Casts all elements of `self` to `i32`. + fn as_ivec3(_self: Ref) -> Val { let output: Val = bevy::math::UVec3::as_ivec3(&_self).into(); output } - fn as_u64vec3(_self: Ref) { + /// Casts all elements of `self` to `u64`. + fn as_u64vec3(_self: Ref) -> Val { let output: Val = bevy::math::UVec3::as_u64vec3(&_self) .into(); output } - fn as_vec3(_self: Ref) { + /// Casts all elements of `self` to `f32`. + fn as_vec3(_self: Ref) -> Val { let output: Val = bevy::math::UVec3::as_vec3(&_self).into(); output } - fn as_vec3a(_self: Ref) { + /// Casts all elements of `self` to `f32`. + fn as_vec3a(_self: Ref) -> Val { let output: Val = bevy::math::UVec3::as_vec3a(&_self).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } + /// Component-wise clamping of values, similar to [`u32::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( _self: Val, min: Val, max: Val, - ) { + ) -> Val { let output: Val = bevy::math::UVec3::clamp( _self.into_inner(), min.into_inner(), @@ -5010,14 +7417,21 @@ impl bevy::math::UVec3 { .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn cmpeq(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec3::cmpeq( _self.into_inner(), rhs.into_inner(), @@ -5025,7 +7439,14 @@ impl bevy::math::UVec3 { .into(); output } - fn cmpge(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec3::cmpge( _self.into_inner(), rhs.into_inner(), @@ -5033,7 +7454,14 @@ impl bevy::math::UVec3 { .into(); output } - fn cmpgt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec3::cmpgt( _self.into_inner(), rhs.into_inner(), @@ -5041,7 +7469,14 @@ impl bevy::math::UVec3 { .into(); output } - fn cmple(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec3::cmple( _self.into_inner(), rhs.into_inner(), @@ -5049,7 +7484,14 @@ impl bevy::math::UVec3 { .into(); output } - fn cmplt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec3::cmplt( _self.into_inner(), rhs.into_inner(), @@ -5057,7 +7499,14 @@ impl bevy::math::UVec3 { .into(); output } - fn cmpne(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec3::cmpne( _self.into_inner(), rhs.into_inner(), @@ -5065,7 +7514,11 @@ impl bevy::math::UVec3 { .into(); output } - fn cross(_self: Val, rhs: Val) { + /// Computes the cross product of `self` and `rhs`. + fn cross( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec3::cross( _self.into_inner(), rhs.into_inner(), @@ -5073,33 +7526,44 @@ impl bevy::math::UVec3 { .into(); output } - fn div(_self: Val, rhs: Ref) { + fn div( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::div(_self.into_inner(), &rhs) .into(); output } - fn div(_self: Val, rhs: Val) { + fn div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::div(_self.into_inner(), rhs.into_inner()) .into(); output } - fn div(_self: Val, rhs: u32) { + fn div(_self: Val, rhs: u32) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn dot(_self: Val, rhs: Val) { + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> u32 { let output: u32 = bevy::math::UVec3::dot(_self.into_inner(), rhs.into_inner()) .into(); output } - fn dot_into_vec(_self: Val, rhs: Val) { + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec3::dot_into_vec( _self.into_inner(), rhs.into_inner(), @@ -5107,22 +7571,27 @@ impl bevy::math::UVec3 { .into(); output } - fn element_product(_self: Val) { + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> u32 { let output: u32 = bevy::math::UVec3::element_product(_self.into_inner()).into(); output } - fn element_sum(_self: Val) { + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> u32 { let output: u32 = bevy::math::UVec3::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn extend(_self: Val, w: u32) { + /// Creates a 4D vector from `self` and the given `w` value. + fn extend(_self: Val, w: u32) -> Val { let output: Val = bevy::math::UVec3::extend( _self.into_inner(), w, @@ -5130,15 +7599,22 @@ impl bevy::math::UVec3 { .into(); output } - fn from_array(a: [u32; 3]) { + /// Creates a new vector from an array. + fn from_array(a: [u32; 3]) -> Val { let output: Val = bevy::math::UVec3::from_array(a).into(); output } - fn length_squared(_self: Val) { + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> u32 { let output: u32 = bevy::math::UVec3::length_squared(_self.into_inner()).into(); output } - fn max(_self: Val, rhs: Val) { + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec3::max( _self.into_inner(), rhs.into_inner(), @@ -5146,11 +7622,18 @@ impl bevy::math::UVec3 { .into(); output } - fn max_element(_self: Val) { + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> u32 { let output: u32 = bevy::math::UVec3::max_element(_self.into_inner()).into(); output } - fn min(_self: Val, rhs: Val) { + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec3::min( _self.into_inner(), rhs.into_inner(), @@ -5158,57 +7641,77 @@ impl bevy::math::UVec3 { .into(); output } - fn min_element(_self: Val) { + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> u32 { let output: u32 = bevy::math::UVec3::min_element(_self.into_inner()).into(); output } - fn mul(_self: Val, rhs: Ref) { + fn mul( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::mul(_self.into_inner(), &rhs) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: u32) { + fn mul(_self: Val, rhs: u32) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn new(x: u32, y: u32, z: u32) { + /// Creates a new vector. + fn new(x: u32, y: u32, z: u32) -> Val { let output: Val = bevy::math::UVec3::new(x, y, z).into(); output } - fn rem(_self: Val, rhs: Ref) { + fn rem( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::rem(_self.into_inner(), &rhs) .into(); output } - fn rem(_self: Val, rhs: Val) { + fn rem( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) .into(); output } - fn rem(_self: Val, rhs: u32) { + fn rem(_self: Val, rhs: u32) -> Val { let output: Val = >::rem(_self.into_inner(), rhs) .into(); output } - fn saturating_add(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec3::saturating_add( _self.into_inner(), rhs.into_inner(), @@ -5216,10 +7719,12 @@ impl bevy::math::UVec3 { .into(); output } + /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`. fn saturating_add_signed( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::UVec3::saturating_add_signed( _self.into_inner(), rhs.into_inner(), @@ -5227,7 +7732,12 @@ impl bevy::math::UVec3 { .into(); output } - fn saturating_div(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec3::saturating_div( _self.into_inner(), rhs.into_inner(), @@ -5235,7 +7745,12 @@ impl bevy::math::UVec3 { .into(); output } - fn saturating_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec3::saturating_mul( _self.into_inner(), rhs.into_inner(), @@ -5243,7 +7758,12 @@ impl bevy::math::UVec3 { .into(); output } - fn saturating_sub(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec3::saturating_sub( _self.into_inner(), rhs.into_inner(), @@ -5251,11 +7771,15 @@ impl bevy::math::UVec3 { .into(); output } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. fn select( mask: Val, if_true: Val, if_false: Val, - ) { + ) -> Val { let output: Val = bevy::math::UVec3::select( mask.into_inner(), if_true.into_inner(), @@ -5264,43 +7788,54 @@ impl bevy::math::UVec3 { .into(); output } - fn splat(v: u32) { + /// Creates a vector with all elements set to `v`. + fn splat(v: u32) -> Val { let output: Val = bevy::math::UVec3::splat(v).into(); output } - fn sub(_self: Val, rhs: Ref) { + fn sub( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::sub(_self.into_inner(), &rhs) .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub(_self: Val, rhs: u32) { + fn sub(_self: Val, rhs: u32) -> Val { let output: Val = >::sub(_self.into_inner(), rhs) .into(); output } - fn to_array(_self: Ref) { + /// `[x, y, z]` + fn to_array(_self: Ref) -> [u32; 3] { let output: [u32; 3] = bevy::math::UVec3::to_array(&_self).into(); output } - fn truncate(_self: Val) { + /// Creates a 2D vector from the `x` and `y` elements of `self`, discarding `z`. + /// Truncation may also be performed by using [`self.xy()`][crate::swizzles::Vec3Swizzles::xy()]. + fn truncate(_self: Val) -> Val { let output: Val = bevy::math::UVec3::truncate( _self.into_inner(), ) .into(); output } - fn with_x(_self: Val, x: u32) { + /// Creates a 3D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: u32) -> Val { let output: Val = bevy::math::UVec3::with_x( _self.into_inner(), x, @@ -5308,7 +7843,8 @@ impl bevy::math::UVec3 { .into(); output } - fn with_y(_self: Val, y: u32) { + /// Creates a 3D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: u32) -> Val { let output: Val = bevy::math::UVec3::with_y( _self.into_inner(), y, @@ -5316,7 +7852,8 @@ impl bevy::math::UVec3 { .into(); output } - fn with_z(_self: Val, z: u32) { + /// Creates a 3D vector from `self` with the given value of `z`. + fn with_z(_self: Val, z: u32) -> Val { let output: Val = bevy::math::UVec3::with_z( _self.into_inner(), z, @@ -5324,7 +7861,12 @@ impl bevy::math::UVec3 { .into(); output } - fn wrapping_add(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec3::wrapping_add( _self.into_inner(), rhs.into_inner(), @@ -5332,7 +7874,12 @@ impl bevy::math::UVec3 { .into(); output } - fn wrapping_add_signed(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_signed(rhs.x), self.y.wrapping_add_signed(rhs.y), ..]`. + fn wrapping_add_signed( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec3::wrapping_add_signed( _self.into_inner(), rhs.into_inner(), @@ -5340,7 +7887,12 @@ impl bevy::math::UVec3 { .into(); output } - fn wrapping_div(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec3::wrapping_div( _self.into_inner(), rhs.into_inner(), @@ -5348,7 +7900,12 @@ impl bevy::math::UVec3 { .into(); output } - fn wrapping_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec3::wrapping_mul( _self.into_inner(), rhs.into_inner(), @@ -5356,7 +7913,12 @@ impl bevy::math::UVec3 { .into(); output } - fn wrapping_sub(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec3::wrapping_sub( _self.into_inner(), rhs.into_inner(), @@ -5371,61 +7933,76 @@ impl bevy::math::UVec3 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::UVec4 { - fn add(_self: Val, rhs: Ref) { + fn add( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::add(_self.into_inner(), &rhs) .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add(_self: Val, rhs: u32) { + fn add(_self: Val, rhs: u32) -> Val { let output: Val = >::add(_self.into_inner(), rhs) .into(); output } - fn as_dvec4(_self: Ref) { + /// Casts all elements of `self` to `f64`. + fn as_dvec4(_self: Ref) -> Val { let output: Val = bevy::math::UVec4::as_dvec4(&_self).into(); output } - fn as_i64vec4(_self: Ref) { + /// Casts all elements of `self` to `i64`. + fn as_i64vec4(_self: Ref) -> Val { let output: Val = bevy::math::UVec4::as_i64vec4(&_self) .into(); output } - fn as_ivec4(_self: Ref) { + /// Casts all elements of `self` to `i32`. + fn as_ivec4(_self: Ref) -> Val { let output: Val = bevy::math::UVec4::as_ivec4(&_self).into(); output } - fn as_u64vec4(_self: Ref) { + /// Casts all elements of `self` to `u64`. + fn as_u64vec4(_self: Ref) -> Val { let output: Val = bevy::math::UVec4::as_u64vec4(&_self) .into(); output } - fn as_vec4(_self: Ref) { + /// Casts all elements of `self` to `f32`. + fn as_vec4(_self: Ref) -> Val { let output: Val = bevy::math::UVec4::as_vec4(&_self).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } + /// Component-wise clamping of values, similar to [`u32::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( _self: Val, min: Val, max: Val, - ) { + ) -> Val { let output: Val = bevy::math::UVec4::clamp( _self.into_inner(), min.into_inner(), @@ -5434,14 +8011,21 @@ impl bevy::math::UVec4 { .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn cmpeq(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec4::cmpeq( _self.into_inner(), rhs.into_inner(), @@ -5449,7 +8033,14 @@ impl bevy::math::UVec4 { .into(); output } - fn cmpge(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec4::cmpge( _self.into_inner(), rhs.into_inner(), @@ -5457,7 +8048,14 @@ impl bevy::math::UVec4 { .into(); output } - fn cmpgt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec4::cmpgt( _self.into_inner(), rhs.into_inner(), @@ -5465,7 +8063,14 @@ impl bevy::math::UVec4 { .into(); output } - fn cmple(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec4::cmple( _self.into_inner(), rhs.into_inner(), @@ -5473,7 +8078,14 @@ impl bevy::math::UVec4 { .into(); output } - fn cmplt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec4::cmplt( _self.into_inner(), rhs.into_inner(), @@ -5481,7 +8093,14 @@ impl bevy::math::UVec4 { .into(); output } - fn cmpne(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec4::cmpne( _self.into_inner(), rhs.into_inner(), @@ -5489,33 +8108,44 @@ impl bevy::math::UVec4 { .into(); output } - fn div(_self: Val, rhs: Ref) { + fn div( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::div(_self.into_inner(), &rhs) .into(); output } - fn div(_self: Val, rhs: Val) { + fn div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::div(_self.into_inner(), rhs.into_inner()) .into(); output } - fn div(_self: Val, rhs: u32) { + fn div(_self: Val, rhs: u32) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn dot(_self: Val, rhs: Val) { + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> u32 { let output: u32 = bevy::math::UVec4::dot(_self.into_inner(), rhs.into_inner()) .into(); output } - fn dot_into_vec(_self: Val, rhs: Val) { + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec4::dot_into_vec( _self.into_inner(), rhs.into_inner(), @@ -5523,30 +8153,41 @@ impl bevy::math::UVec4 { .into(); output } - fn element_product(_self: Val) { + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> u32 { let output: u32 = bevy::math::UVec4::element_product(_self.into_inner()).into(); output } - fn element_sum(_self: Val) { + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> u32 { let output: u32 = bevy::math::UVec4::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn from_array(a: [u32; 4]) { + /// Creates a new vector from an array. + fn from_array(a: [u32; 4]) -> Val { let output: Val = bevy::math::UVec4::from_array(a).into(); output } - fn length_squared(_self: Val) { + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> u32 { let output: u32 = bevy::math::UVec4::length_squared(_self.into_inner()).into(); output } - fn max(_self: Val, rhs: Val) { + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec4::max( _self.into_inner(), rhs.into_inner(), @@ -5554,11 +8195,18 @@ impl bevy::math::UVec4 { .into(); output } - fn max_element(_self: Val) { + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> u32 { let output: u32 = bevy::math::UVec4::max_element(_self.into_inner()).into(); output } - fn min(_self: Val, rhs: Val) { + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec4::min( _self.into_inner(), rhs.into_inner(), @@ -5566,57 +8214,77 @@ impl bevy::math::UVec4 { .into(); output } - fn min_element(_self: Val) { + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> u32 { let output: u32 = bevy::math::UVec4::min_element(_self.into_inner()).into(); output } - fn mul(_self: Val, rhs: Ref) { + fn mul( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::mul(_self.into_inner(), &rhs) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: u32) { + fn mul(_self: Val, rhs: u32) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn new(x: u32, y: u32, z: u32, w: u32) { + /// Creates a new vector. + fn new(x: u32, y: u32, z: u32, w: u32) -> Val { let output: Val = bevy::math::UVec4::new(x, y, z, w).into(); output } - fn rem(_self: Val, rhs: Ref) { + fn rem( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::rem(_self.into_inner(), &rhs) .into(); output } - fn rem(_self: Val, rhs: Val) { + fn rem( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) .into(); output } - fn rem(_self: Val, rhs: u32) { + fn rem(_self: Val, rhs: u32) -> Val { let output: Val = >::rem(_self.into_inner(), rhs) .into(); output } - fn saturating_add(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec4::saturating_add( _self.into_inner(), rhs.into_inner(), @@ -5624,10 +8292,12 @@ impl bevy::math::UVec4 { .into(); output } + /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`. fn saturating_add_signed( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::UVec4::saturating_add_signed( _self.into_inner(), rhs.into_inner(), @@ -5635,7 +8305,12 @@ impl bevy::math::UVec4 { .into(); output } - fn saturating_div(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec4::saturating_div( _self.into_inner(), rhs.into_inner(), @@ -5643,7 +8318,12 @@ impl bevy::math::UVec4 { .into(); output } - fn saturating_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec4::saturating_mul( _self.into_inner(), rhs.into_inner(), @@ -5651,7 +8331,12 @@ impl bevy::math::UVec4 { .into(); output } - fn saturating_sub(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec4::saturating_sub( _self.into_inner(), rhs.into_inner(), @@ -5659,11 +8344,15 @@ impl bevy::math::UVec4 { .into(); output } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. fn select( mask: Val, if_true: Val, if_false: Val, - ) { + ) -> Val { let output: Val = bevy::math::UVec4::select( mask.into_inner(), if_true.into_inner(), @@ -5672,43 +8361,54 @@ impl bevy::math::UVec4 { .into(); output } - fn splat(v: u32) { + /// Creates a vector with all elements set to `v`. + fn splat(v: u32) -> Val { let output: Val = bevy::math::UVec4::splat(v).into(); output } - fn sub(_self: Val, rhs: Ref) { + fn sub( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::sub(_self.into_inner(), &rhs) .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub(_self: Val, rhs: u32) { + fn sub(_self: Val, rhs: u32) -> Val { let output: Val = >::sub(_self.into_inner(), rhs) .into(); output } - fn to_array(_self: Ref) { + /// `[x, y, z, w]` + fn to_array(_self: Ref) -> [u32; 4] { let output: [u32; 4] = bevy::math::UVec4::to_array(&_self).into(); output } - fn truncate(_self: Val) { + /// Creates a 3D vector from the `x`, `y` and `z` elements of `self`, discarding `w`. + /// Truncation to [`UVec3`] may also be performed by using [`self.xyz()`][crate::swizzles::Vec4Swizzles::xyz()]. + fn truncate(_self: Val) -> Val { let output: Val = bevy::math::UVec4::truncate( _self.into_inner(), ) .into(); output } - fn with_w(_self: Val, w: u32) { + /// Creates a 4D vector from `self` with the given value of `w`. + fn with_w(_self: Val, w: u32) -> Val { let output: Val = bevy::math::UVec4::with_w( _self.into_inner(), w, @@ -5716,7 +8416,8 @@ impl bevy::math::UVec4 { .into(); output } - fn with_x(_self: Val, x: u32) { + /// Creates a 4D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: u32) -> Val { let output: Val = bevy::math::UVec4::with_x( _self.into_inner(), x, @@ -5724,7 +8425,8 @@ impl bevy::math::UVec4 { .into(); output } - fn with_y(_self: Val, y: u32) { + /// Creates a 4D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: u32) -> Val { let output: Val = bevy::math::UVec4::with_y( _self.into_inner(), y, @@ -5732,7 +8434,8 @@ impl bevy::math::UVec4 { .into(); output } - fn with_z(_self: Val, z: u32) { + /// Creates a 4D vector from `self` with the given value of `z`. + fn with_z(_self: Val, z: u32) -> Val { let output: Val = bevy::math::UVec4::with_z( _self.into_inner(), z, @@ -5740,7 +8443,12 @@ impl bevy::math::UVec4 { .into(); output } - fn wrapping_add(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec4::wrapping_add( _self.into_inner(), rhs.into_inner(), @@ -5748,7 +8456,12 @@ impl bevy::math::UVec4 { .into(); output } - fn wrapping_add_signed(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_signed(rhs.x), self.y.wrapping_add_signed(rhs.y), ..]`. + fn wrapping_add_signed( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec4::wrapping_add_signed( _self.into_inner(), rhs.into_inner(), @@ -5756,7 +8469,12 @@ impl bevy::math::UVec4 { .into(); output } - fn wrapping_div(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec4::wrapping_div( _self.into_inner(), rhs.into_inner(), @@ -5764,7 +8482,12 @@ impl bevy::math::UVec4 { .into(); output } - fn wrapping_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec4::wrapping_mul( _self.into_inner(), rhs.into_inner(), @@ -5772,7 +8495,12 @@ impl bevy::math::UVec4 { .into(); output } - fn wrapping_sub(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::UVec4::wrapping_sub( _self.into_inner(), rhs.into_inner(), @@ -5787,63 +8515,78 @@ impl bevy::math::UVec4 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::U64Vec2 { - fn add(_self: Val, rhs: Ref) { + fn add( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::add(_self.into_inner(), &rhs) .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add(_self: Val, rhs: u64) { + fn add(_self: Val, rhs: u64) -> Val { let output: Val = >::add(_self.into_inner(), rhs) .into(); output } - fn as_dvec2(_self: Ref) { + /// Casts all elements of `self` to `f64`. + fn as_dvec2(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec2::as_dvec2(&_self) .into(); output } - fn as_i64vec2(_self: Ref) { + /// Casts all elements of `self` to `i64`. + fn as_i64vec2(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec2::as_i64vec2(&_self) .into(); output } - fn as_ivec2(_self: Ref) { + /// Casts all elements of `self` to `i32`. + fn as_ivec2(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec2::as_ivec2(&_self) .into(); output } - fn as_uvec2(_self: Ref) { + /// Casts all elements of `self` to `u32`. + fn as_uvec2(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec2::as_uvec2(&_self) .into(); output } - fn as_vec2(_self: Ref) { + /// Casts all elements of `self` to `f32`. + fn as_vec2(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec2::as_vec2(&_self).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } + /// Component-wise clamping of values, similar to [`u64::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( _self: Val, min: Val, max: Val, - ) { + ) -> Val { let output: Val = bevy::math::U64Vec2::clamp( _self.into_inner(), min.into_inner(), @@ -5852,14 +8595,21 @@ impl bevy::math::U64Vec2 { .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn cmpeq(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec2::cmpeq( _self.into_inner(), rhs.into_inner(), @@ -5867,7 +8617,14 @@ impl bevy::math::U64Vec2 { .into(); output } - fn cmpge(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec2::cmpge( _self.into_inner(), rhs.into_inner(), @@ -5875,7 +8632,14 @@ impl bevy::math::U64Vec2 { .into(); output } - fn cmpgt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec2::cmpgt( _self.into_inner(), rhs.into_inner(), @@ -5883,7 +8647,14 @@ impl bevy::math::U64Vec2 { .into(); output } - fn cmple(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec2::cmple( _self.into_inner(), rhs.into_inner(), @@ -5891,7 +8662,14 @@ impl bevy::math::U64Vec2 { .into(); output } - fn cmplt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec2::cmplt( _self.into_inner(), rhs.into_inner(), @@ -5899,7 +8677,14 @@ impl bevy::math::U64Vec2 { .into(); output } - fn cmpne(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec2::cmpne( _self.into_inner(), rhs.into_inner(), @@ -5907,33 +8692,44 @@ impl bevy::math::U64Vec2 { .into(); output } - fn div(_self: Val, rhs: Ref) { + fn div( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::div(_self.into_inner(), &rhs) .into(); output } - fn div(_self: Val, rhs: Val) { + fn div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::div(_self.into_inner(), rhs.into_inner()) .into(); output } - fn div(_self: Val, rhs: u64) { + fn div(_self: Val, rhs: u64) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn dot(_self: Val, rhs: Val) { + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> u64 { let output: u64 = bevy::math::U64Vec2::dot(_self.into_inner(), rhs.into_inner()) .into(); output } - fn dot_into_vec(_self: Val, rhs: Val) { + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec2::dot_into_vec( _self.into_inner(), rhs.into_inner(), @@ -5941,23 +8737,28 @@ impl bevy::math::U64Vec2 { .into(); output } - fn element_product(_self: Val) { + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> u64 { let output: u64 = bevy::math::U64Vec2::element_product(_self.into_inner()) .into(); output } - fn element_sum(_self: Val) { + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> u64 { let output: u64 = bevy::math::U64Vec2::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn extend(_self: Val, z: u64) { + /// Creates a 3D vector from `self` and the given `z` value. + fn extend(_self: Val, z: u64) -> Val { let output: Val = bevy::math::U64Vec2::extend( _self.into_inner(), z, @@ -5965,15 +8766,22 @@ impl bevy::math::U64Vec2 { .into(); output } - fn from_array(a: [u64; 2]) { + /// Creates a new vector from an array. + fn from_array(a: [u64; 2]) -> Val { let output: Val = bevy::math::U64Vec2::from_array(a).into(); output } - fn length_squared(_self: Val) { + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> u64 { let output: u64 = bevy::math::U64Vec2::length_squared(_self.into_inner()).into(); output } - fn max(_self: Val, rhs: Val) { + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec2::max( _self.into_inner(), rhs.into_inner(), @@ -5981,11 +8789,18 @@ impl bevy::math::U64Vec2 { .into(); output } - fn max_element(_self: Val) { + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> u64 { let output: u64 = bevy::math::U64Vec2::max_element(_self.into_inner()).into(); output } - fn min(_self: Val, rhs: Val) { + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec2::min( _self.into_inner(), rhs.into_inner(), @@ -5993,57 +8808,77 @@ impl bevy::math::U64Vec2 { .into(); output } - fn min_element(_self: Val) { + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> u64 { let output: u64 = bevy::math::U64Vec2::min_element(_self.into_inner()).into(); output } - fn mul(_self: Val, rhs: Ref) { + fn mul( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::mul(_self.into_inner(), &rhs) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: u64) { + fn mul(_self: Val, rhs: u64) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn new(x: u64, y: u64) { + /// Creates a new vector. + fn new(x: u64, y: u64) -> Val { let output: Val = bevy::math::U64Vec2::new(x, y).into(); output } - fn rem(_self: Val, rhs: Ref) { + fn rem( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::rem(_self.into_inner(), &rhs) .into(); output } - fn rem(_self: Val, rhs: Val) { + fn rem( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) .into(); output } - fn rem(_self: Val, rhs: u64) { + fn rem(_self: Val, rhs: u64) -> Val { let output: Val = >::rem(_self.into_inner(), rhs) .into(); output } - fn saturating_add(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec2::saturating_add( _self.into_inner(), rhs.into_inner(), @@ -6051,10 +8886,12 @@ impl bevy::math::U64Vec2 { .into(); output } + /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`. fn saturating_add_signed( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::U64Vec2::saturating_add_signed( _self.into_inner(), rhs.into_inner(), @@ -6062,7 +8899,12 @@ impl bevy::math::U64Vec2 { .into(); output } - fn saturating_div(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec2::saturating_div( _self.into_inner(), rhs.into_inner(), @@ -6070,7 +8912,12 @@ impl bevy::math::U64Vec2 { .into(); output } - fn saturating_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec2::saturating_mul( _self.into_inner(), rhs.into_inner(), @@ -6078,7 +8925,12 @@ impl bevy::math::U64Vec2 { .into(); output } - fn saturating_sub(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec2::saturating_sub( _self.into_inner(), rhs.into_inner(), @@ -6086,11 +8938,15 @@ impl bevy::math::U64Vec2 { .into(); output } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. fn select( mask: Val, if_true: Val, if_false: Val, - ) { + ) -> Val { let output: Val = bevy::math::U64Vec2::select( mask.into_inner(), if_true.into_inner(), @@ -6099,36 +8955,45 @@ impl bevy::math::U64Vec2 { .into(); output } - fn splat(v: u64) { + /// Creates a vector with all elements set to `v`. + fn splat(v: u64) -> Val { let output: Val = bevy::math::U64Vec2::splat(v).into(); output } - fn sub(_self: Val, rhs: Ref) { + fn sub( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::sub(_self.into_inner(), &rhs) .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub(_self: Val, rhs: u64) { + fn sub(_self: Val, rhs: u64) -> Val { let output: Val = >::sub(_self.into_inner(), rhs) .into(); output } - fn to_array(_self: Ref) { + /// `[x, y]` + fn to_array(_self: Ref) -> [u64; 2] { let output: [u64; 2] = bevy::math::U64Vec2::to_array(&_self).into(); output } - fn with_x(_self: Val, x: u64) { + /// Creates a 2D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: u64) -> Val { let output: Val = bevy::math::U64Vec2::with_x( _self.into_inner(), x, @@ -6136,7 +9001,8 @@ impl bevy::math::U64Vec2 { .into(); output } - fn with_y(_self: Val, y: u64) { + /// Creates a 2D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: u64) -> Val { let output: Val = bevy::math::U64Vec2::with_y( _self.into_inner(), y, @@ -6144,7 +9010,12 @@ impl bevy::math::U64Vec2 { .into(); output } - fn wrapping_add(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec2::wrapping_add( _self.into_inner(), rhs.into_inner(), @@ -6152,10 +9023,12 @@ impl bevy::math::U64Vec2 { .into(); output } + /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_signed(rhs.x), self.y.wrapping_add_signed(rhs.y), ..]`. fn wrapping_add_signed( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::U64Vec2::wrapping_add_signed( _self.into_inner(), rhs.into_inner(), @@ -6163,7 +9036,12 @@ impl bevy::math::U64Vec2 { .into(); output } - fn wrapping_div(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec2::wrapping_div( _self.into_inner(), rhs.into_inner(), @@ -6171,7 +9049,12 @@ impl bevy::math::U64Vec2 { .into(); output } - fn wrapping_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec2::wrapping_mul( _self.into_inner(), rhs.into_inner(), @@ -6179,7 +9062,12 @@ impl bevy::math::U64Vec2 { .into(); output } - fn wrapping_sub(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec2::wrapping_sub( _self.into_inner(), rhs.into_inner(), @@ -6194,68 +9082,84 @@ impl bevy::math::U64Vec2 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::U64Vec3 { - fn add(_self: Val, rhs: Ref) { + fn add( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::add(_self.into_inner(), &rhs) .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add(_self: Val, rhs: u64) { + fn add(_self: Val, rhs: u64) -> Val { let output: Val = >::add(_self.into_inner(), rhs) .into(); output } - fn as_dvec3(_self: Ref) { + /// Casts all elements of `self` to `f64`. + fn as_dvec3(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec3::as_dvec3(&_self) .into(); output } - fn as_i64vec3(_self: Ref) { + /// Casts all elements of `self` to `i64`. + fn as_i64vec3(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec3::as_i64vec3(&_self) .into(); output } - fn as_ivec3(_self: Ref) { + /// Casts all elements of `self` to `i32`. + fn as_ivec3(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec3::as_ivec3(&_self) .into(); output } - fn as_uvec3(_self: Ref) { + /// Casts all elements of `self` to `u32`. + fn as_uvec3(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec3::as_uvec3(&_self) .into(); output } - fn as_vec3(_self: Ref) { + /// Casts all elements of `self` to `f32`. + fn as_vec3(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec3::as_vec3(&_self).into(); output } - fn as_vec3a(_self: Ref) { + /// Casts all elements of `self` to `f32`. + fn as_vec3a(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec3::as_vec3a(&_self) .into(); output } - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } + /// Component-wise clamping of values, similar to [`u64::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( _self: Val, min: Val, max: Val, - ) { + ) -> Val { let output: Val = bevy::math::U64Vec3::clamp( _self.into_inner(), min.into_inner(), @@ -6264,14 +9168,21 @@ impl bevy::math::U64Vec3 { .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn cmpeq(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec3::cmpeq( _self.into_inner(), rhs.into_inner(), @@ -6279,7 +9190,14 @@ impl bevy::math::U64Vec3 { .into(); output } - fn cmpge(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec3::cmpge( _self.into_inner(), rhs.into_inner(), @@ -6287,7 +9205,14 @@ impl bevy::math::U64Vec3 { .into(); output } - fn cmpgt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec3::cmpgt( _self.into_inner(), rhs.into_inner(), @@ -6295,7 +9220,14 @@ impl bevy::math::U64Vec3 { .into(); output } - fn cmple(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec3::cmple( _self.into_inner(), rhs.into_inner(), @@ -6303,7 +9235,14 @@ impl bevy::math::U64Vec3 { .into(); output } - fn cmplt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec3::cmplt( _self.into_inner(), rhs.into_inner(), @@ -6311,7 +9250,14 @@ impl bevy::math::U64Vec3 { .into(); output } - fn cmpne(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec3::cmpne( _self.into_inner(), rhs.into_inner(), @@ -6319,7 +9265,11 @@ impl bevy::math::U64Vec3 { .into(); output } - fn cross(_self: Val, rhs: Val) { + /// Computes the cross product of `self` and `rhs`. + fn cross( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec3::cross( _self.into_inner(), rhs.into_inner(), @@ -6327,33 +9277,44 @@ impl bevy::math::U64Vec3 { .into(); output } - fn div(_self: Val, rhs: Ref) { + fn div( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::div(_self.into_inner(), &rhs) .into(); output } - fn div(_self: Val, rhs: Val) { + fn div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::div(_self.into_inner(), rhs.into_inner()) .into(); output } - fn div(_self: Val, rhs: u64) { + fn div(_self: Val, rhs: u64) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn dot(_self: Val, rhs: Val) { + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> u64 { let output: u64 = bevy::math::U64Vec3::dot(_self.into_inner(), rhs.into_inner()) .into(); output } - fn dot_into_vec(_self: Val, rhs: Val) { + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec3::dot_into_vec( _self.into_inner(), rhs.into_inner(), @@ -6361,23 +9322,28 @@ impl bevy::math::U64Vec3 { .into(); output } - fn element_product(_self: Val) { + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> u64 { let output: u64 = bevy::math::U64Vec3::element_product(_self.into_inner()) .into(); output } - fn element_sum(_self: Val) { + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> u64 { let output: u64 = bevy::math::U64Vec3::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn extend(_self: Val, w: u64) { + /// Creates a 4D vector from `self` and the given `w` value. + fn extend(_self: Val, w: u64) -> Val { let output: Val = bevy::math::U64Vec3::extend( _self.into_inner(), w, @@ -6385,15 +9351,22 @@ impl bevy::math::U64Vec3 { .into(); output } - fn from_array(a: [u64; 3]) { + /// Creates a new vector from an array. + fn from_array(a: [u64; 3]) -> Val { let output: Val = bevy::math::U64Vec3::from_array(a).into(); output } - fn length_squared(_self: Val) { + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> u64 { let output: u64 = bevy::math::U64Vec3::length_squared(_self.into_inner()).into(); output } - fn max(_self: Val, rhs: Val) { + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec3::max( _self.into_inner(), rhs.into_inner(), @@ -6401,11 +9374,18 @@ impl bevy::math::U64Vec3 { .into(); output } - fn max_element(_self: Val) { + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> u64 { let output: u64 = bevy::math::U64Vec3::max_element(_self.into_inner()).into(); output } - fn min(_self: Val, rhs: Val) { + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec3::min( _self.into_inner(), rhs.into_inner(), @@ -6413,57 +9393,77 @@ impl bevy::math::U64Vec3 { .into(); output } - fn min_element(_self: Val) { + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> u64 { let output: u64 = bevy::math::U64Vec3::min_element(_self.into_inner()).into(); output } - fn mul(_self: Val, rhs: Ref) { + fn mul( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::mul(_self.into_inner(), &rhs) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: u64) { + fn mul(_self: Val, rhs: u64) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn new(x: u64, y: u64, z: u64) { + /// Creates a new vector. + fn new(x: u64, y: u64, z: u64) -> Val { let output: Val = bevy::math::U64Vec3::new(x, y, z).into(); output } - fn rem(_self: Val, rhs: Ref) { + fn rem( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::rem(_self.into_inner(), &rhs) .into(); output } - fn rem(_self: Val, rhs: Val) { + fn rem( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) .into(); output } - fn rem(_self: Val, rhs: u64) { + fn rem(_self: Val, rhs: u64) -> Val { let output: Val = >::rem(_self.into_inner(), rhs) .into(); output } - fn saturating_add(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec3::saturating_add( _self.into_inner(), rhs.into_inner(), @@ -6471,10 +9471,12 @@ impl bevy::math::U64Vec3 { .into(); output } + /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`. fn saturating_add_signed( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::U64Vec3::saturating_add_signed( _self.into_inner(), rhs.into_inner(), @@ -6482,7 +9484,12 @@ impl bevy::math::U64Vec3 { .into(); output } - fn saturating_div(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec3::saturating_div( _self.into_inner(), rhs.into_inner(), @@ -6490,7 +9497,12 @@ impl bevy::math::U64Vec3 { .into(); output } - fn saturating_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec3::saturating_mul( _self.into_inner(), rhs.into_inner(), @@ -6498,7 +9510,12 @@ impl bevy::math::U64Vec3 { .into(); output } - fn saturating_sub(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec3::saturating_sub( _self.into_inner(), rhs.into_inner(), @@ -6506,11 +9523,15 @@ impl bevy::math::U64Vec3 { .into(); output } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. fn select( mask: Val, if_true: Val, if_false: Val, - ) { + ) -> Val { let output: Val = bevy::math::U64Vec3::select( mask.into_inner(), if_true.into_inner(), @@ -6519,43 +9540,54 @@ impl bevy::math::U64Vec3 { .into(); output } - fn splat(v: u64) { + /// Creates a vector with all elements set to `v`. + fn splat(v: u64) -> Val { let output: Val = bevy::math::U64Vec3::splat(v).into(); output } - fn sub(_self: Val, rhs: Ref) { + fn sub( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::sub(_self.into_inner(), &rhs) .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub(_self: Val, rhs: u64) { + fn sub(_self: Val, rhs: u64) -> Val { let output: Val = >::sub(_self.into_inner(), rhs) .into(); output } - fn to_array(_self: Ref) { + /// `[x, y, z]` + fn to_array(_self: Ref) -> [u64; 3] { let output: [u64; 3] = bevy::math::U64Vec3::to_array(&_self).into(); output } - fn truncate(_self: Val) { + /// Creates a 2D vector from the `x` and `y` elements of `self`, discarding `z`. + /// Truncation may also be performed by using [`self.xy()`][crate::swizzles::Vec3Swizzles::xy()]. + fn truncate(_self: Val) -> Val { let output: Val = bevy::math::U64Vec3::truncate( _self.into_inner(), ) .into(); output } - fn with_x(_self: Val, x: u64) { + /// Creates a 3D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: u64) -> Val { let output: Val = bevy::math::U64Vec3::with_x( _self.into_inner(), x, @@ -6563,7 +9595,8 @@ impl bevy::math::U64Vec3 { .into(); output } - fn with_y(_self: Val, y: u64) { + /// Creates a 3D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: u64) -> Val { let output: Val = bevy::math::U64Vec3::with_y( _self.into_inner(), y, @@ -6571,7 +9604,8 @@ impl bevy::math::U64Vec3 { .into(); output } - fn with_z(_self: Val, z: u64) { + /// Creates a 3D vector from `self` with the given value of `z`. + fn with_z(_self: Val, z: u64) -> Val { let output: Val = bevy::math::U64Vec3::with_z( _self.into_inner(), z, @@ -6579,7 +9613,12 @@ impl bevy::math::U64Vec3 { .into(); output } - fn wrapping_add(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec3::wrapping_add( _self.into_inner(), rhs.into_inner(), @@ -6587,10 +9626,12 @@ impl bevy::math::U64Vec3 { .into(); output } + /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_signed(rhs.x), self.y.wrapping_add_signed(rhs.y), ..]`. fn wrapping_add_signed( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::U64Vec3::wrapping_add_signed( _self.into_inner(), rhs.into_inner(), @@ -6598,7 +9639,12 @@ impl bevy::math::U64Vec3 { .into(); output } - fn wrapping_div(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec3::wrapping_div( _self.into_inner(), rhs.into_inner(), @@ -6606,7 +9652,12 @@ impl bevy::math::U64Vec3 { .into(); output } - fn wrapping_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec3::wrapping_mul( _self.into_inner(), rhs.into_inner(), @@ -6614,7 +9665,12 @@ impl bevy::math::U64Vec3 { .into(); output } - fn wrapping_sub(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec3::wrapping_sub( _self.into_inner(), rhs.into_inner(), @@ -6629,63 +9685,78 @@ impl bevy::math::U64Vec3 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::U64Vec4 { - fn add(_self: Val, rhs: Ref) { + fn add( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::add(_self.into_inner(), &rhs) .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add(_self: Val, rhs: u64) { + fn add(_self: Val, rhs: u64) -> Val { let output: Val = >::add(_self.into_inner(), rhs) .into(); output } - fn as_dvec4(_self: Ref) { + /// Casts all elements of `self` to `f64`. + fn as_dvec4(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec4::as_dvec4(&_self) .into(); output } - fn as_i64vec4(_self: Ref) { + /// Casts all elements of `self` to `i64`. + fn as_i64vec4(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec4::as_i64vec4(&_self) .into(); output } - fn as_ivec4(_self: Ref) { + /// Casts all elements of `self` to `i32`. + fn as_ivec4(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec4::as_ivec4(&_self) .into(); output } - fn as_uvec4(_self: Ref) { + /// Casts all elements of `self` to `u32`. + fn as_uvec4(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec4::as_uvec4(&_self) .into(); output } - fn as_vec4(_self: Ref) { + /// Casts all elements of `self` to `f32`. + fn as_vec4(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec4::as_vec4(&_self).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } + /// Component-wise clamping of values, similar to [`u64::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( _self: Val, min: Val, max: Val, - ) { + ) -> Val { let output: Val = bevy::math::U64Vec4::clamp( _self.into_inner(), min.into_inner(), @@ -6694,14 +9765,21 @@ impl bevy::math::U64Vec4 { .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn cmpeq(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec4::cmpeq( _self.into_inner(), rhs.into_inner(), @@ -6709,7 +9787,14 @@ impl bevy::math::U64Vec4 { .into(); output } - fn cmpge(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec4::cmpge( _self.into_inner(), rhs.into_inner(), @@ -6717,7 +9802,14 @@ impl bevy::math::U64Vec4 { .into(); output } - fn cmpgt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec4::cmpgt( _self.into_inner(), rhs.into_inner(), @@ -6725,7 +9817,14 @@ impl bevy::math::U64Vec4 { .into(); output } - fn cmple(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec4::cmple( _self.into_inner(), rhs.into_inner(), @@ -6733,7 +9832,14 @@ impl bevy::math::U64Vec4 { .into(); output } - fn cmplt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec4::cmplt( _self.into_inner(), rhs.into_inner(), @@ -6741,7 +9847,14 @@ impl bevy::math::U64Vec4 { .into(); output } - fn cmpne(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec4::cmpne( _self.into_inner(), rhs.into_inner(), @@ -6749,33 +9862,44 @@ impl bevy::math::U64Vec4 { .into(); output } - fn div(_self: Val, rhs: Ref) { + fn div( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::div(_self.into_inner(), &rhs) .into(); output } - fn div(_self: Val, rhs: Val) { + fn div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::div(_self.into_inner(), rhs.into_inner()) .into(); output } - fn div(_self: Val, rhs: u64) { + fn div(_self: Val, rhs: u64) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn dot(_self: Val, rhs: Val) { + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> u64 { let output: u64 = bevy::math::U64Vec4::dot(_self.into_inner(), rhs.into_inner()) .into(); output } - fn dot_into_vec(_self: Val, rhs: Val) { + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec4::dot_into_vec( _self.into_inner(), rhs.into_inner(), @@ -6783,31 +9907,42 @@ impl bevy::math::U64Vec4 { .into(); output } - fn element_product(_self: Val) { + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> u64 { let output: u64 = bevy::math::U64Vec4::element_product(_self.into_inner()) .into(); output } - fn element_sum(_self: Val) { + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> u64 { let output: u64 = bevy::math::U64Vec4::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn from_array(a: [u64; 4]) { + /// Creates a new vector from an array. + fn from_array(a: [u64; 4]) -> Val { let output: Val = bevy::math::U64Vec4::from_array(a).into(); output } - fn length_squared(_self: Val) { + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> u64 { let output: u64 = bevy::math::U64Vec4::length_squared(_self.into_inner()).into(); output } - fn max(_self: Val, rhs: Val) { + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec4::max( _self.into_inner(), rhs.into_inner(), @@ -6815,11 +9950,18 @@ impl bevy::math::U64Vec4 { .into(); output } - fn max_element(_self: Val) { + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> u64 { let output: u64 = bevy::math::U64Vec4::max_element(_self.into_inner()).into(); output } - fn min(_self: Val, rhs: Val) { + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec4::min( _self.into_inner(), rhs.into_inner(), @@ -6827,58 +9969,78 @@ impl bevy::math::U64Vec4 { .into(); output } - fn min_element(_self: Val) { + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> u64 { let output: u64 = bevy::math::U64Vec4::min_element(_self.into_inner()).into(); output } - fn mul(_self: Val, rhs: Ref) { + fn mul( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::mul(_self.into_inner(), &rhs) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: u64) { + fn mul(_self: Val, rhs: u64) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn new(x: u64, y: u64, z: u64, w: u64) { + /// Creates a new vector. + fn new(x: u64, y: u64, z: u64, w: u64) -> Val { let output: Val = bevy::math::U64Vec4::new(x, y, z, w) .into(); output } - fn rem(_self: Val, rhs: Ref) { + fn rem( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::rem(_self.into_inner(), &rhs) .into(); output } - fn rem(_self: Val, rhs: Val) { + fn rem( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) .into(); output } - fn rem(_self: Val, rhs: u64) { + fn rem(_self: Val, rhs: u64) -> Val { let output: Val = >::rem(_self.into_inner(), rhs) .into(); output } - fn saturating_add(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec4::saturating_add( _self.into_inner(), rhs.into_inner(), @@ -6886,10 +10048,12 @@ impl bevy::math::U64Vec4 { .into(); output } + /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`. fn saturating_add_signed( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::U64Vec4::saturating_add_signed( _self.into_inner(), rhs.into_inner(), @@ -6897,7 +10061,12 @@ impl bevy::math::U64Vec4 { .into(); output } - fn saturating_div(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec4::saturating_div( _self.into_inner(), rhs.into_inner(), @@ -6905,7 +10074,12 @@ impl bevy::math::U64Vec4 { .into(); output } - fn saturating_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec4::saturating_mul( _self.into_inner(), rhs.into_inner(), @@ -6913,7 +10087,12 @@ impl bevy::math::U64Vec4 { .into(); output } - fn saturating_sub(_self: Val, rhs: Val) { + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec4::saturating_sub( _self.into_inner(), rhs.into_inner(), @@ -6921,11 +10100,15 @@ impl bevy::math::U64Vec4 { .into(); output } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. fn select( mask: Val, if_true: Val, if_false: Val, - ) { + ) -> Val { let output: Val = bevy::math::U64Vec4::select( mask.into_inner(), if_true.into_inner(), @@ -6934,43 +10117,54 @@ impl bevy::math::U64Vec4 { .into(); output } - fn splat(v: u64) { + /// Creates a vector with all elements set to `v`. + fn splat(v: u64) -> Val { let output: Val = bevy::math::U64Vec4::splat(v).into(); output } - fn sub(_self: Val, rhs: Ref) { + fn sub( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::sub(_self.into_inner(), &rhs) .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub(_self: Val, rhs: u64) { + fn sub(_self: Val, rhs: u64) -> Val { let output: Val = >::sub(_self.into_inner(), rhs) .into(); output } - fn to_array(_self: Ref) { + /// `[x, y, z, w]` + fn to_array(_self: Ref) -> [u64; 4] { let output: [u64; 4] = bevy::math::U64Vec4::to_array(&_self).into(); output } - fn truncate(_self: Val) { + /// Creates a 3D vector from the `x`, `y` and `z` elements of `self`, discarding `w`. + /// Truncation to [`U64Vec3`] may also be performed by using [`self.xyz()`][crate::swizzles::Vec4Swizzles::xyz()]. + fn truncate(_self: Val) -> Val { let output: Val = bevy::math::U64Vec4::truncate( _self.into_inner(), ) .into(); output } - fn with_w(_self: Val, w: u64) { + /// Creates a 4D vector from `self` with the given value of `w`. + fn with_w(_self: Val, w: u64) -> Val { let output: Val = bevy::math::U64Vec4::with_w( _self.into_inner(), w, @@ -6978,7 +10172,8 @@ impl bevy::math::U64Vec4 { .into(); output } - fn with_x(_self: Val, x: u64) { + /// Creates a 4D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: u64) -> Val { let output: Val = bevy::math::U64Vec4::with_x( _self.into_inner(), x, @@ -6986,7 +10181,8 @@ impl bevy::math::U64Vec4 { .into(); output } - fn with_y(_self: Val, y: u64) { + /// Creates a 4D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: u64) -> Val { let output: Val = bevy::math::U64Vec4::with_y( _self.into_inner(), y, @@ -6994,7 +10190,8 @@ impl bevy::math::U64Vec4 { .into(); output } - fn with_z(_self: Val, z: u64) { + /// Creates a 4D vector from `self` with the given value of `z`. + fn with_z(_self: Val, z: u64) -> Val { let output: Val = bevy::math::U64Vec4::with_z( _self.into_inner(), z, @@ -7002,7 +10199,12 @@ impl bevy::math::U64Vec4 { .into(); output } - fn wrapping_add(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec4::wrapping_add( _self.into_inner(), rhs.into_inner(), @@ -7010,10 +10212,12 @@ impl bevy::math::U64Vec4 { .into(); output } + /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_signed(rhs.x), self.y.wrapping_add_signed(rhs.y), ..]`. fn wrapping_add_signed( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::U64Vec4::wrapping_add_signed( _self.into_inner(), rhs.into_inner(), @@ -7021,7 +10225,12 @@ impl bevy::math::U64Vec4 { .into(); output } - fn wrapping_div(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec4::wrapping_div( _self.into_inner(), rhs.into_inner(), @@ -7029,7 +10238,12 @@ impl bevy::math::U64Vec4 { .into(); output } - fn wrapping_mul(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec4::wrapping_mul( _self.into_inner(), rhs.into_inner(), @@ -7037,7 +10251,12 @@ impl bevy::math::U64Vec4 { .into(); output } - fn wrapping_sub(_self: Val, rhs: Val) { + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::U64Vec4::wrapping_sub( _self.into_inner(), rhs.into_inner(), @@ -7052,16 +10271,24 @@ impl bevy::math::U64Vec4 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::Vec2 { - fn abs(_self: Val) { + /// Returns a vector containing the absolute value of each element of `self`. + fn abs(_self: Val) -> Val { let output: Val = bevy::math::Vec2::abs(_self.into_inner()) .into(); output } + /// Returns true if the absolute difference of all elements between `self` and `rhs` is + /// less than or equal to `max_abs_diff`. + /// This can be used to compare if two vectors contain similar elements. It works best when + /// comparing with a known value. The `max_abs_diff` that should be used used depends on + /// the values being compared against. + /// For more see + /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). fn abs_diff_eq( _self: Val, rhs: Val, max_abs_diff: f32, - ) { + ) -> bool { let output: bool = bevy::math::Vec2::abs_diff_eq( _self.into_inner(), rhs.into_inner(), @@ -7070,28 +10297,34 @@ impl bevy::math::Vec2 { .into(); output } - fn add(_self: Val, rhs: Ref) { + fn add( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::add(_self.into_inner(), &rhs) .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add(_self: Val, rhs: f32) { + fn add(_self: Val, rhs: f32) -> Val { let output: Val = >::add(_self.into_inner(), rhs) .into(); output } - fn angle_between(_self: Val, rhs: Val) { + fn angle_between(_self: Val, rhs: Val) -> f32 { let output: f32 = bevy::math::Vec2::angle_between( _self.into_inner(), rhs.into_inner(), @@ -7099,7 +10332,9 @@ impl bevy::math::Vec2 { .into(); output } - fn angle_to(_self: Val, rhs: Val) { + /// Returns the angle of rotation (in radians) from `self` to `rhs` in the range `[-π, +π]`. + /// The inputs do not need to be unit vectors however they must be non-zero. + fn angle_to(_self: Val, rhs: Val) -> f32 { let output: f32 = bevy::math::Vec2::angle_to( _self.into_inner(), rhs.into_inner(), @@ -7107,38 +10342,49 @@ impl bevy::math::Vec2 { .into(); output } - fn as_dvec2(_self: Ref) { + /// Casts all elements of `self` to `f64`. + fn as_dvec2(_self: Ref) -> Val { let output: Val = bevy::math::Vec2::as_dvec2(&_self).into(); output } - fn as_i64vec2(_self: Ref) { + /// Casts all elements of `self` to `i64`. + fn as_i64vec2(_self: Ref) -> Val { let output: Val = bevy::math::Vec2::as_i64vec2(&_self) .into(); output } - fn as_ivec2(_self: Ref) { + /// Casts all elements of `self` to `i32`. + fn as_ivec2(_self: Ref) -> Val { let output: Val = bevy::math::Vec2::as_ivec2(&_self).into(); output } - fn as_u64vec2(_self: Ref) { + /// Casts all elements of `self` to `u64`. + fn as_u64vec2(_self: Ref) -> Val { let output: Val = bevy::math::Vec2::as_u64vec2(&_self) .into(); output } - fn as_uvec2(_self: Ref) { + /// Casts all elements of `self` to `u32`. + fn as_uvec2(_self: Ref) -> Val { let output: Val = bevy::math::Vec2::as_uvec2(&_self).into(); output } - fn ceil(_self: Val) { + /// Returns a vector containing the smallest integer greater than or equal to a number for + /// each element of `self`. + fn ceil(_self: Val) -> Val { let output: Val = bevy::math::Vec2::ceil(_self.into_inner()) .into(); output } + /// Component-wise clamping of values, similar to [`f32::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( _self: Val, min: Val, max: Val, - ) { + ) -> Val { let output: Val = bevy::math::Vec2::clamp( _self.into_inner(), min.into_inner(), @@ -7147,7 +10393,14 @@ impl bevy::math::Vec2 { .into(); output } - fn clamp_length(_self: Val, min: f32, max: f32) { + /// Returns a vector with a length no less than `min` and no more than `max`. + /// # Panics + /// Will panic if `min` is greater than `max`, or if either `min` or `max` is negative, when `glam_assert` is enabled. + fn clamp_length( + _self: Val, + min: f32, + max: f32, + ) -> Val { let output: Val = bevy::math::Vec2::clamp_length( _self.into_inner(), min, @@ -7156,7 +10409,13 @@ impl bevy::math::Vec2 { .into(); output } - fn clamp_length_max(_self: Val, max: f32) { + /// Returns a vector with a length no more than `max`. + /// # Panics + /// Will panic if `max` is negative when `glam_assert` is enabled. + fn clamp_length_max( + _self: Val, + max: f32, + ) -> Val { let output: Val = bevy::math::Vec2::clamp_length_max( _self.into_inner(), max, @@ -7164,7 +10423,13 @@ impl bevy::math::Vec2 { .into(); output } - fn clamp_length_min(_self: Val, min: f32) { + /// Returns a vector with a length no less than `min`. + /// # Panics + /// Will panic if `min` is negative when `glam_assert` is enabled. + fn clamp_length_min( + _self: Val, + min: f32, + ) -> Val { let output: Val = bevy::math::Vec2::clamp_length_min( _self.into_inner(), min, @@ -7172,14 +10437,21 @@ impl bevy::math::Vec2 { .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn cmpeq(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec2::cmpeq( _self.into_inner(), rhs.into_inner(), @@ -7187,7 +10459,14 @@ impl bevy::math::Vec2 { .into(); output } - fn cmpge(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec2::cmpge( _self.into_inner(), rhs.into_inner(), @@ -7195,7 +10474,14 @@ impl bevy::math::Vec2 { .into(); output } - fn cmpgt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec2::cmpgt( _self.into_inner(), rhs.into_inner(), @@ -7203,7 +10489,14 @@ impl bevy::math::Vec2 { .into(); output } - fn cmple(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec2::cmple( _self.into_inner(), rhs.into_inner(), @@ -7211,7 +10504,14 @@ impl bevy::math::Vec2 { .into(); output } - fn cmplt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec2::cmplt( _self.into_inner(), rhs.into_inner(), @@ -7219,7 +10519,14 @@ impl bevy::math::Vec2 { .into(); output } - fn cmpne(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec2::cmpne( _self.into_inner(), rhs.into_inner(), @@ -7227,7 +10534,11 @@ impl bevy::math::Vec2 { .into(); output } - fn copysign(_self: Val, rhs: Val) { + /// Returns a vector with signs of `rhs` and the magnitudes of `self`. + fn copysign( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec2::copysign( _self.into_inner(), rhs.into_inner(), @@ -7235,7 +10546,8 @@ impl bevy::math::Vec2 { .into(); output } - fn distance(_self: Val, rhs: Val) { + /// Computes the Euclidean distance between two points in space. + fn distance(_self: Val, rhs: Val) -> f32 { let output: f32 = bevy::math::Vec2::distance( _self.into_inner(), rhs.into_inner(), @@ -7243,7 +10555,11 @@ impl bevy::math::Vec2 { .into(); output } - fn distance_squared(_self: Val, rhs: Val) { + /// Compute the squared euclidean distance between two points in space. + fn distance_squared( + _self: Val, + rhs: Val, + ) -> f32 { let output: f32 = bevy::math::Vec2::distance_squared( _self.into_inner(), rhs.into_inner(), @@ -7251,28 +10567,38 @@ impl bevy::math::Vec2 { .into(); output } - fn div(_self: Val, rhs: Ref) { + fn div( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::div(_self.into_inner(), &rhs) .into(); output } - fn div(_self: Val, rhs: Val) { + fn div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::div(_self.into_inner(), rhs.into_inner()) .into(); output } - fn div(_self: Val, rhs: f32) { + fn div(_self: Val, rhs: f32) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn div_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. + fn div_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec2::div_euclid( _self.into_inner(), rhs.into_inner(), @@ -7280,12 +10606,17 @@ impl bevy::math::Vec2 { .into(); output } - fn dot(_self: Val, rhs: Val) { + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> f32 { let output: f32 = bevy::math::Vec2::dot(_self.into_inner(), rhs.into_inner()) .into(); output } - fn dot_into_vec(_self: Val, rhs: Val) { + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec2::dot_into_vec( _self.into_inner(), rhs.into_inner(), @@ -7293,27 +10624,34 @@ impl bevy::math::Vec2 { .into(); output } - fn element_product(_self: Val) { + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> f32 { let output: f32 = bevy::math::Vec2::element_product(_self.into_inner()).into(); output } - fn element_sum(_self: Val) { + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> f32 { let output: f32 = bevy::math::Vec2::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn exp(_self: Val) { + /// Returns a vector containing `e^self` (the exponential function) for each element of + /// `self`. + fn exp(_self: Val) -> Val { let output: Val = bevy::math::Vec2::exp(_self.into_inner()) .into(); output } - fn extend(_self: Val, z: f32) { + /// Creates a 3D vector from `self` and the given `z` value. + fn extend(_self: Val, z: f32) -> Val { let output: Val = bevy::math::Vec2::extend( _self.into_inner(), z, @@ -7321,75 +10659,115 @@ impl bevy::math::Vec2 { .into(); output } - fn floor(_self: Val) { + /// Returns a vector containing the largest integer less than or equal to a number for each + /// element of `self`. + fn floor(_self: Val) -> Val { let output: Val = bevy::math::Vec2::floor(_self.into_inner()) .into(); output } - fn fract(_self: Val) { + /// Returns a vector containing the fractional part of the vector as `self - self.trunc()`. + /// Note that this differs from the GLSL implementation of `fract` which returns + /// `self - self.floor()`. + /// Note that this is fast but not precise for large numbers. + fn fract(_self: Val) -> Val { let output: Val = bevy::math::Vec2::fract(_self.into_inner()) .into(); output } - fn fract_gl(_self: Val) { + /// Returns a vector containing the fractional part of the vector as `self - self.floor()`. + /// Note that this differs from the Rust implementation of `fract` which returns + /// `self - self.trunc()`. + /// Note that this is fast but not precise for large numbers. + fn fract_gl(_self: Val) -> Val { let output: Val = bevy::math::Vec2::fract_gl( _self.into_inner(), ) .into(); output } - fn from_angle(angle: f32) { + /// Creates a 2D vector containing `[angle.cos(), angle.sin()]`. This can be used in + /// conjunction with the [`rotate()`][Self::rotate()] method, e.g. + /// `Vec2::from_angle(PI).rotate(Vec2::Y)` will create the vector `[-1, 0]` + /// and rotate [`Vec2::Y`] around it returning `-Vec2::Y`. + fn from_angle(angle: f32) -> Val { let output: Val = bevy::math::Vec2::from_angle(angle).into(); output } - fn from_array(a: [f32; 2]) { + /// Creates a new vector from an array. + fn from_array(a: [f32; 2]) -> Val { let output: Val = bevy::math::Vec2::from_array(a).into(); output } - fn is_finite(_self: Val) { + /// Returns `true` if, and only if, all elements are finite. If any element is either + /// `NaN`, positive or negative infinity, this will return `false`. + fn is_finite(_self: Val) -> bool { let output: bool = bevy::math::Vec2::is_finite(_self.into_inner()).into(); output } - fn is_finite_mask(_self: Val) { + /// Performs `is_finite` on each element of self, returning a vector mask of the results. + /// In other words, this computes `[x.is_finite(), y.is_finite(), ...]`. + fn is_finite_mask(_self: Val) -> Val { let output: Val = bevy::math::Vec2::is_finite_mask( _self.into_inner(), ) .into(); output } - fn is_nan(_self: Val) { + /// Returns `true` if any elements are `NaN`. + fn is_nan(_self: Val) -> bool { let output: bool = bevy::math::Vec2::is_nan(_self.into_inner()).into(); output } - fn is_nan_mask(_self: Val) { + /// Performs `is_nan` on each element of self, returning a vector mask of the results. + /// In other words, this computes `[x.is_nan(), y.is_nan(), ...]`. + fn is_nan_mask(_self: Val) -> Val { let output: Val = bevy::math::Vec2::is_nan_mask( _self.into_inner(), ) .into(); output } - fn is_negative_bitmask(_self: Val) { + /// Returns a bitmask with the lowest 2 bits set to the sign bits from the elements of `self`. + /// A negative element results in a `1` bit and a positive element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn is_negative_bitmask(_self: Val) -> u32 { let output: u32 = bevy::math::Vec2::is_negative_bitmask(_self.into_inner()) .into(); output } - fn is_normalized(_self: Val) { + /// Returns whether `self` is length `1.0` or not. + /// Uses a precision threshold of approximately `1e-4`. + fn is_normalized(_self: Val) -> bool { let output: bool = bevy::math::Vec2::is_normalized(_self.into_inner()).into(); output } - fn length(_self: Val) { + /// Computes the length of `self`. + fn length(_self: Val) -> f32 { let output: f32 = bevy::math::Vec2::length(_self.into_inner()).into(); output } - fn length_recip(_self: Val) { + /// Computes `1.0 / length()`. + /// For valid results, `self` must _not_ be of length zero. + fn length_recip(_self: Val) -> f32 { let output: f32 = bevy::math::Vec2::length_recip(_self.into_inner()).into(); output } - fn length_squared(_self: Val) { + /// Computes the squared length of `self`. + /// This is faster than `length()` as it avoids a square root operation. + fn length_squared(_self: Val) -> f32 { let output: f32 = bevy::math::Vec2::length_squared(_self.into_inner()).into(); output } - fn lerp(_self: Val, rhs: Val, s: f32) { + /// Performs a linear interpolation between `self` and `rhs` based on the value `s`. + /// When `s` is `0.0`, the result will be equal to `self`. When `s` is `1.0`, the result + /// will be equal to `rhs`. When `s` is outside of range `[0, 1]`, the result is linearly + /// extrapolated. + fn lerp( + _self: Val, + rhs: Val, + s: f32, + ) -> Val { let output: Val = bevy::math::Vec2::lerp( _self.into_inner(), rhs.into_inner(), @@ -7398,7 +10776,12 @@ impl bevy::math::Vec2 { .into(); output } - fn max(_self: Val, rhs: Val) { + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec2::max( _self.into_inner(), rhs.into_inner(), @@ -7406,11 +10789,20 @@ impl bevy::math::Vec2 { .into(); output } - fn max_element(_self: Val) { + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> f32 { let output: f32 = bevy::math::Vec2::max_element(_self.into_inner()).into(); output } - fn midpoint(_self: Val, rhs: Val) { + /// Calculates the midpoint between `self` and `rhs`. + /// The midpoint is the average of, or halfway point between, two vectors. + /// `a.midpoint(b)` should yield the same result as `a.lerp(b, 0.5)` + /// while being slightly cheaper to compute. + fn midpoint( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec2::midpoint( _self.into_inner(), rhs.into_inner(), @@ -7418,7 +10810,12 @@ impl bevy::math::Vec2 { .into(); output } - fn min(_self: Val, rhs: Val) { + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec2::min( _self.into_inner(), rhs.into_inner(), @@ -7426,11 +10823,20 @@ impl bevy::math::Vec2 { .into(); output } - fn min_element(_self: Val) { + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> f32 { let output: f32 = bevy::math::Vec2::min_element(_self.into_inner()).into(); output } - fn move_towards(_self: Ref, rhs: Val, d: f32) { + /// Moves towards `rhs` based on the value `d`. + /// When `d` is `0.0`, the result will be equal to `self`. When `d` is equal to + /// `self.distance(rhs)`, the result will be equal to `rhs`. Will not go past `rhs`. + fn move_towards( + _self: Ref, + rhs: Val, + d: f32, + ) -> Val { let output: Val = bevy::math::Vec2::move_towards( &_self, rhs.into_inner(), @@ -7439,32 +10845,44 @@ impl bevy::math::Vec2 { .into(); output } - fn mul(_self: Val, rhs: Ref) { + fn mul( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::mul(_self.into_inner(), &rhs) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: f32) { + fn mul(_self: Val, rhs: f32) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } + /// Fused multiply-add. Computes `(self * a) + b` element-wise with only one rounding + /// error, yielding a more accurate result than an unfused multiply-add. + /// Using `mul_add` *may* be more performant than an unfused multiply-add if the target + /// architecture has a dedicated fma CPU instruction. However, this is not always true, + /// and will be heavily dependant on designing algorithms with specific target hardware in + /// mind. fn mul_add( _self: Val, a: Val, b: Val, - ) { + ) -> Val { let output: Val = bevy::math::Vec2::mul_add( _self.into_inner(), a.into_inner(), @@ -7473,25 +10891,39 @@ impl bevy::math::Vec2 { .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } - fn new(x: f32, y: f32) { + /// Creates a new vector. + fn new(x: f32, y: f32) -> Val { let output: Val = bevy::math::Vec2::new(x, y).into(); output } - fn normalize(_self: Val) { + /// Returns `self` normalized to length 1.0. + /// For valid results, `self` must be finite and _not_ of length zero, nor very close to zero. + /// See also [`Self::try_normalize()`] and [`Self::normalize_or_zero()`]. + /// Panics + /// Will panic if the resulting normalized vector is not finite when `glam_assert` is enabled. + fn normalize(_self: Val) -> Val { let output: Val = bevy::math::Vec2::normalize( _self.into_inner(), ) .into(); output } - fn normalize_or(_self: Val, fallback: Val) { + /// Returns `self` normalized to length 1.0 if possible, else returns a + /// fallback value. + /// In particular, if the input is zero (or very close to zero), or non-finite, + /// the result of this operation will be the fallback value. + /// See also [`Self::try_normalize()`]. + fn normalize_or( + _self: Val, + fallback: Val, + ) -> Val { let output: Val = bevy::math::Vec2::normalize_or( _self.into_inner(), fallback.into_inner(), @@ -7499,19 +10931,26 @@ impl bevy::math::Vec2 { .into(); output } - fn normalize_or_zero(_self: Val) { + /// Returns `self` normalized to length 1.0 if possible, else returns zero. + /// In particular, if the input is zero (or very close to zero), or non-finite, + /// the result of this operation will be zero. + /// See also [`Self::try_normalize()`]. + fn normalize_or_zero(_self: Val) -> Val { let output: Val = bevy::math::Vec2::normalize_or_zero( _self.into_inner(), ) .into(); output } - fn perp(_self: Val) { + /// Returns a vector that is equal to `self` rotated by 90 degrees. + fn perp(_self: Val) -> Val { let output: Val = bevy::math::Vec2::perp(_self.into_inner()) .into(); output } - fn perp_dot(_self: Val, rhs: Val) { + /// The perpendicular dot product of `self` and `rhs`. + /// Also known as the wedge product, 2D cross product, and determinant. + fn perp_dot(_self: Val, rhs: Val) -> f32 { let output: f32 = bevy::math::Vec2::perp_dot( _self.into_inner(), rhs.into_inner(), @@ -7519,12 +10958,20 @@ impl bevy::math::Vec2 { .into(); output } - fn powf(_self: Val, n: f32) { + /// Returns a vector containing each element of `self` raised to the power of `n`. + fn powf(_self: Val, n: f32) -> Val { let output: Val = bevy::math::Vec2::powf(_self.into_inner(), n) .into(); output } - fn project_onto(_self: Val, rhs: Val) { + /// Returns the vector projection of `self` onto `rhs`. + /// `rhs` must be of non-zero length. + /// # Panics + /// Will panic if `rhs` is zero length when `glam_assert` is enabled. + fn project_onto( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec2::project_onto( _self.into_inner(), rhs.into_inner(), @@ -7532,10 +10979,14 @@ impl bevy::math::Vec2 { .into(); output } + /// Returns the vector projection of `self` onto `rhs`. + /// `rhs` must be normalized. + /// # Panics + /// Will panic if `rhs` is not normalized when `glam_assert` is enabled. fn project_onto_normalized( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::Vec2::project_onto_normalized( _self.into_inner(), rhs.into_inner(), @@ -7543,12 +10994,21 @@ impl bevy::math::Vec2 { .into(); output } - fn recip(_self: Val) { + /// Returns a vector containing the reciprocal `1.0/n` of each element of `self`. + fn recip(_self: Val) -> Val { let output: Val = bevy::math::Vec2::recip(_self.into_inner()) .into(); output } - fn reflect(_self: Val, normal: Val) { + /// Returns the reflection vector for a given incident vector `self` and surface normal + /// `normal`. + /// `normal` must be normalized. + /// # Panics + /// Will panic if `normal` is not normalized when `glam_assert` is enabled. + fn reflect( + _self: Val, + normal: Val, + ) -> Val { let output: Val = bevy::math::Vec2::reflect( _self.into_inner(), normal.into_inner(), @@ -7556,7 +11016,17 @@ impl bevy::math::Vec2 { .into(); output } - fn refract(_self: Val, normal: Val, eta: f32) { + /// Returns the refraction direction for a given incident vector `self`, surface normal + /// `normal` and ratio of indices of refraction, `eta`. When total internal reflection occurs, + /// a zero vector will be returned. + /// `self` and `normal` must be normalized. + /// # Panics + /// Will panic if `self` or `normal` is not normalized when `glam_assert` is enabled. + fn refract( + _self: Val, + normal: Val, + eta: f32, + ) -> Val { let output: Val = bevy::math::Vec2::refract( _self.into_inner(), normal.into_inner(), @@ -7565,7 +11035,16 @@ impl bevy::math::Vec2 { .into(); output } - fn reject_from(_self: Val, rhs: Val) { + /// Returns the vector rejection of `self` from `rhs`. + /// The vector rejection is the vector perpendicular to the projection of `self` onto + /// `rhs`, in rhs words the result of `self - self.project_onto(rhs)`. + /// `rhs` must be of non-zero length. + /// # Panics + /// Will panic if `rhs` has a length of zero when `glam_assert` is enabled. + fn reject_from( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec2::reject_from( _self.into_inner(), rhs.into_inner(), @@ -7573,7 +11052,16 @@ impl bevy::math::Vec2 { .into(); output } - fn reject_from_normalized(_self: Val, rhs: Val) { + /// Returns the vector rejection of `self` from `rhs`. + /// The vector rejection is the vector perpendicular to the projection of `self` onto + /// `rhs`, in rhs words the result of `self - self.project_onto(rhs)`. + /// `rhs` must be normalized. + /// # Panics + /// Will panic if `rhs` is not normalized when `glam_assert` is enabled. + fn reject_from_normalized( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec2::reject_from_normalized( _self.into_inner(), rhs.into_inner(), @@ -7581,28 +11069,39 @@ impl bevy::math::Vec2 { .into(); output } - fn rem(_self: Val, rhs: Ref) { + fn rem( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::rem(_self.into_inner(), &rhs) .into(); output } - fn rem(_self: Val, rhs: Val) { + fn rem( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) .into(); output } - fn rem(_self: Val, rhs: f32) { + fn rem(_self: Val, rhs: f32) -> Val { let output: Val = >::rem(_self.into_inner(), rhs) .into(); output } - fn rem_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. + /// [Euclidean division]: f32::rem_euclid + fn rem_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec2::rem_euclid( _self.into_inner(), rhs.into_inner(), @@ -7610,7 +11109,13 @@ impl bevy::math::Vec2 { .into(); output } - fn rotate(_self: Val, rhs: Val) { + /// Returns `rhs` rotated by the angle of `self`. If `self` is normalized, + /// then this just rotation. This is what you usually want. Otherwise, + /// it will be like a rotation with a multiplication by `self`'s length. + fn rotate( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec2::rotate( _self.into_inner(), rhs.into_inner(), @@ -7618,11 +11123,15 @@ impl bevy::math::Vec2 { .into(); output } + /// Rotates towards `rhs` up to `max_angle` (in radians). + /// When `max_angle` is `0.0`, the result will be equal to `self`. When `max_angle` is equal to + /// `self.angle_between(rhs)`, the result will be equal to `rhs`. If `max_angle` is negative, + /// rotates towards the exact opposite of `rhs`. Will not go past the target. fn rotate_towards( _self: Ref, rhs: Val, max_angle: f32, - ) { + ) -> Val { let output: Val = bevy::math::Vec2::rotate_towards( &_self, rhs.into_inner(), @@ -7631,16 +11140,22 @@ impl bevy::math::Vec2 { .into(); output } - fn round(_self: Val) { + /// Returns a vector containing the nearest integer to a number for each element of `self`. + /// Round half-way cases away from 0.0. + fn round(_self: Val) -> Val { let output: Val = bevy::math::Vec2::round(_self.into_inner()) .into(); output } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. fn select( mask: Val, if_true: Val, if_false: Val, - ) { + ) -> Val { let output: Val = bevy::math::Vec2::select( mask.into_inner(), if_true.into_inner(), @@ -7649,50 +11164,67 @@ impl bevy::math::Vec2 { .into(); output } - fn signum(_self: Val) { + /// Returns a vector with elements representing the sign of `self`. + /// - `1.0` if the number is positive, `+0.0` or `INFINITY` + /// - `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY` + /// - `NAN` if the number is `NAN` + fn signum(_self: Val) -> Val { let output: Val = bevy::math::Vec2::signum(_self.into_inner()) .into(); output } - fn splat(v: f32) { + /// Creates a vector with all elements set to `v`. + fn splat(v: f32) -> Val { let output: Val = bevy::math::Vec2::splat(v).into(); output } - fn sub(_self: Val, rhs: Ref) { + fn sub( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::sub(_self.into_inner(), &rhs) .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub(_self: Val, rhs: f32) { + fn sub(_self: Val, rhs: f32) -> Val { let output: Val = >::sub(_self.into_inner(), rhs) .into(); output } - fn to_angle(_self: Val) { + /// Returns the angle (in radians) of this vector in the range `[-π, +π]`. + /// The input does not need to be a unit vector however it must be non-zero. + fn to_angle(_self: Val) -> f32 { let output: f32 = bevy::math::Vec2::to_angle(_self.into_inner()).into(); output } - fn to_array(_self: Ref) { + /// `[x, y]` + fn to_array(_self: Ref) -> [f32; 2] { let output: [f32; 2] = bevy::math::Vec2::to_array(&_self).into(); output } - fn trunc(_self: Val) { + /// Returns a vector containing the integer part each element of `self`. This means numbers are + /// always truncated towards zero. + fn trunc(_self: Val) -> Val { let output: Val = bevy::math::Vec2::trunc(_self.into_inner()) .into(); output } - fn with_x(_self: Val, x: f32) { + /// Creates a 2D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: f32) -> Val { let output: Val = bevy::math::Vec2::with_x( _self.into_inner(), x, @@ -7700,7 +11232,8 @@ impl bevy::math::Vec2 { .into(); output } - fn with_y(_self: Val, y: f32) { + /// Creates a 2D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: f32) -> Val { let output: Val = bevy::math::Vec2::with_y( _self.into_inner(), y, @@ -7715,16 +11248,24 @@ impl bevy::math::Vec2 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::Vec3A { - fn abs(_self: Val) { + /// Returns a vector containing the absolute value of each element of `self`. + fn abs(_self: Val) -> Val { let output: Val = bevy::math::Vec3A::abs(_self.into_inner()) .into(); output } + /// Returns true if the absolute difference of all elements between `self` and `rhs` is + /// less than or equal to `max_abs_diff`. + /// This can be used to compare if two vectors contain similar elements. It works best when + /// comparing with a known value. The `max_abs_diff` that should be used used depends on + /// the values being compared against. + /// For more see + /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). fn abs_diff_eq( _self: Val, rhs: Val, max_abs_diff: f32, - ) { + ) -> bool { let output: bool = bevy::math::Vec3A::abs_diff_eq( _self.into_inner(), rhs.into_inner(), @@ -7733,28 +11274,36 @@ impl bevy::math::Vec3A { .into(); output } - fn add(_self: Val, rhs: Ref) { + fn add( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::add(_self.into_inner(), &rhs) .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add(_self: Val, rhs: f32) { + fn add(_self: Val, rhs: f32) -> Val { let output: Val = >::add(_self.into_inner(), rhs) .into(); output } - fn angle_between(_self: Val, rhs: Val) { + /// Returns the angle (in radians) between two vectors in the range `[0, +π]`. + /// The inputs do not need to be unit vectors however they must be non-zero. + fn angle_between(_self: Val, rhs: Val) -> f32 { let output: f32 = bevy::math::Vec3A::angle_between( _self.into_inner(), rhs.into_inner(), @@ -7762,52 +11311,71 @@ impl bevy::math::Vec3A { .into(); output } - fn any_orthogonal_vector(_self: Ref) { + /// Returns some vector that is orthogonal to the given one. + /// The input vector must be finite and non-zero. + /// The output vector is not necessarily unit length. For that use + /// [`Self::any_orthonormal_vector()`] instead. + fn any_orthogonal_vector(_self: Ref) -> Val { let output: Val = bevy::math::Vec3A::any_orthogonal_vector( &_self, ) .into(); output } - fn any_orthonormal_vector(_self: Ref) { + /// Returns any unit vector that is orthogonal to the given one. + /// The input vector must be unit length. + /// # Panics + /// Will panic if `self` is not normalized when `glam_assert` is enabled. + fn any_orthonormal_vector(_self: Ref) -> Val { let output: Val = bevy::math::Vec3A::any_orthonormal_vector( &_self, ) .into(); output } - fn as_dvec3(_self: Ref) { + /// Casts all elements of `self` to `f64`. + fn as_dvec3(_self: Ref) -> Val { let output: Val = bevy::math::Vec3A::as_dvec3(&_self).into(); output } - fn as_i64vec3(_self: Ref) { + /// Casts all elements of `self` to `i64`. + fn as_i64vec3(_self: Ref) -> Val { let output: Val = bevy::math::Vec3A::as_i64vec3(&_self) .into(); output } - fn as_ivec3(_self: Ref) { + /// Casts all elements of `self` to `i32`. + fn as_ivec3(_self: Ref) -> Val { let output: Val = bevy::math::Vec3A::as_ivec3(&_self).into(); output } - fn as_u64vec3(_self: Ref) { + /// Casts all elements of `self` to `u64`. + fn as_u64vec3(_self: Ref) -> Val { let output: Val = bevy::math::Vec3A::as_u64vec3(&_self) .into(); output } - fn as_uvec3(_self: Ref) { + /// Casts all elements of `self` to `u32`. + fn as_uvec3(_self: Ref) -> Val { let output: Val = bevy::math::Vec3A::as_uvec3(&_self).into(); output } - fn ceil(_self: Val) { + /// Returns a vector containing the smallest integer greater than or equal to a number for + /// each element of `self`. + fn ceil(_self: Val) -> Val { let output: Val = bevy::math::Vec3A::ceil(_self.into_inner()) .into(); output } + /// Component-wise clamping of values, similar to [`f32::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( _self: Val, min: Val, max: Val, - ) { + ) -> Val { let output: Val = bevy::math::Vec3A::clamp( _self.into_inner(), min.into_inner(), @@ -7816,7 +11384,14 @@ impl bevy::math::Vec3A { .into(); output } - fn clamp_length(_self: Val, min: f32, max: f32) { + /// Returns a vector with a length no less than `min` and no more than `max`. + /// # Panics + /// Will panic if `min` is greater than `max`, or if either `min` or `max` is negative, when `glam_assert` is enabled. + fn clamp_length( + _self: Val, + min: f32, + max: f32, + ) -> Val { let output: Val = bevy::math::Vec3A::clamp_length( _self.into_inner(), min, @@ -7825,7 +11400,13 @@ impl bevy::math::Vec3A { .into(); output } - fn clamp_length_max(_self: Val, max: f32) { + /// Returns a vector with a length no more than `max`. + /// # Panics + /// Will panic if `max` is negative when `glam_assert` is enabled. + fn clamp_length_max( + _self: Val, + max: f32, + ) -> Val { let output: Val = bevy::math::Vec3A::clamp_length_max( _self.into_inner(), max, @@ -7833,7 +11414,13 @@ impl bevy::math::Vec3A { .into(); output } - fn clamp_length_min(_self: Val, min: f32) { + /// Returns a vector with a length no less than `min`. + /// # Panics + /// Will panic if `min` is negative when `glam_assert` is enabled. + fn clamp_length_min( + _self: Val, + min: f32, + ) -> Val { let output: Val = bevy::math::Vec3A::clamp_length_min( _self.into_inner(), min, @@ -7841,14 +11428,21 @@ impl bevy::math::Vec3A { .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn cmpeq(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3A::cmpeq( _self.into_inner(), rhs.into_inner(), @@ -7856,7 +11450,14 @@ impl bevy::math::Vec3A { .into(); output } - fn cmpge(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3A::cmpge( _self.into_inner(), rhs.into_inner(), @@ -7864,7 +11465,14 @@ impl bevy::math::Vec3A { .into(); output } - fn cmpgt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3A::cmpgt( _self.into_inner(), rhs.into_inner(), @@ -7872,7 +11480,14 @@ impl bevy::math::Vec3A { .into(); output } - fn cmple(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3A::cmple( _self.into_inner(), rhs.into_inner(), @@ -7880,7 +11495,14 @@ impl bevy::math::Vec3A { .into(); output } - fn cmplt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3A::cmplt( _self.into_inner(), rhs.into_inner(), @@ -7888,7 +11510,14 @@ impl bevy::math::Vec3A { .into(); output } - fn cmpne(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3A::cmpne( _self.into_inner(), rhs.into_inner(), @@ -7896,7 +11525,11 @@ impl bevy::math::Vec3A { .into(); output } - fn copysign(_self: Val, rhs: Val) { + /// Returns a vector with signs of `rhs` and the magnitudes of `self`. + fn copysign( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3A::copysign( _self.into_inner(), rhs.into_inner(), @@ -7904,7 +11537,11 @@ impl bevy::math::Vec3A { .into(); output } - fn cross(_self: Val, rhs: Val) { + /// Computes the cross product of `self` and `rhs`. + fn cross( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3A::cross( _self.into_inner(), rhs.into_inner(), @@ -7912,7 +11549,8 @@ impl bevy::math::Vec3A { .into(); output } - fn distance(_self: Val, rhs: Val) { + /// Computes the Euclidean distance between two points in space. + fn distance(_self: Val, rhs: Val) -> f32 { let output: f32 = bevy::math::Vec3A::distance( _self.into_inner(), rhs.into_inner(), @@ -7920,7 +11558,11 @@ impl bevy::math::Vec3A { .into(); output } - fn distance_squared(_self: Val, rhs: Val) { + /// Compute the squared euclidean distance between two points in space. + fn distance_squared( + _self: Val, + rhs: Val, + ) -> f32 { let output: f32 = bevy::math::Vec3A::distance_squared( _self.into_inner(), rhs.into_inner(), @@ -7928,28 +11570,38 @@ impl bevy::math::Vec3A { .into(); output } - fn div(_self: Val, rhs: Ref) { + fn div( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::div(_self.into_inner(), &rhs) .into(); output } - fn div(_self: Val, rhs: Val) { + fn div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::div(_self.into_inner(), rhs.into_inner()) .into(); output } - fn div(_self: Val, rhs: f32) { + fn div(_self: Val, rhs: f32) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn div_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. + fn div_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3A::div_euclid( _self.into_inner(), rhs.into_inner(), @@ -7957,12 +11609,17 @@ impl bevy::math::Vec3A { .into(); output } - fn dot(_self: Val, rhs: Val) { + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> f32 { let output: f32 = bevy::math::Vec3A::dot(_self.into_inner(), rhs.into_inner()) .into(); output } - fn dot_into_vec(_self: Val, rhs: Val) { + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3A::dot_into_vec( _self.into_inner(), rhs.into_inner(), @@ -7970,27 +11627,34 @@ impl bevy::math::Vec3A { .into(); output } - fn element_product(_self: Val) { + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> f32 { let output: f32 = bevy::math::Vec3A::element_product(_self.into_inner()).into(); output } - fn element_sum(_self: Val) { + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> f32 { let output: f32 = bevy::math::Vec3A::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, rhs: Ref) { + fn eq(_self: Ref, rhs: Ref) -> bool { let output: bool = >::eq(&_self, &rhs) .into(); output } - fn exp(_self: Val) { + /// Returns a vector containing `e^self` (the exponential function) for each element of + /// `self`. + fn exp(_self: Val) -> Val { let output: Val = bevy::math::Vec3A::exp(_self.into_inner()) .into(); output } - fn extend(_self: Val, w: f32) { + /// Creates a 4D vector from `self` and the given `w` value. + fn extend(_self: Val, w: f32) -> Val { let output: Val = bevy::math::Vec3A::extend( _self.into_inner(), w, @@ -7998,76 +11662,114 @@ impl bevy::math::Vec3A { .into(); output } - fn floor(_self: Val) { + /// Returns a vector containing the largest integer less than or equal to a number for each + /// element of `self`. + fn floor(_self: Val) -> Val { let output: Val = bevy::math::Vec3A::floor(_self.into_inner()) .into(); output } - fn fract(_self: Val) { + /// Returns a vector containing the fractional part of the vector as `self - self.trunc()`. + /// Note that this differs from the GLSL implementation of `fract` which returns + /// `self - self.floor()`. + /// Note that this is fast but not precise for large numbers. + fn fract(_self: Val) -> Val { let output: Val = bevy::math::Vec3A::fract(_self.into_inner()) .into(); output } - fn fract_gl(_self: Val) { + /// Returns a vector containing the fractional part of the vector as `self - self.floor()`. + /// Note that this differs from the Rust implementation of `fract` which returns + /// `self - self.trunc()`. + /// Note that this is fast but not precise for large numbers. + fn fract_gl(_self: Val) -> Val { let output: Val = bevy::math::Vec3A::fract_gl( _self.into_inner(), ) .into(); output } - fn from_array(a: [f32; 3]) { + /// Creates a new vector from an array. + fn from_array(a: [f32; 3]) -> Val { let output: Val = bevy::math::Vec3A::from_array(a).into(); output } - fn from_vec4(v: Val) { + /// Creates a [`Vec3A`] from the `x`, `y` and `z` elements of `self` discarding `w`. + /// On architectures where SIMD is supported such as SSE2 on `x86_64` this conversion is a noop. + fn from_vec4(v: Val) -> Val { let output: Val = bevy::math::Vec3A::from_vec4(v.into_inner()) .into(); output } - fn is_finite(_self: Val) { + /// Returns `true` if, and only if, all elements are finite. If any element is either + /// `NaN`, positive or negative infinity, this will return `false`. + fn is_finite(_self: Val) -> bool { let output: bool = bevy::math::Vec3A::is_finite(_self.into_inner()).into(); output } - fn is_finite_mask(_self: Val) { + /// Performs `is_finite` on each element of self, returning a vector mask of the results. + /// In other words, this computes `[x.is_finite(), y.is_finite(), ...]`. + fn is_finite_mask(_self: Val) -> Val { let output: Val = bevy::math::Vec3A::is_finite_mask( _self.into_inner(), ) .into(); output } - fn is_nan(_self: Val) { + /// Returns `true` if any elements are `NaN`. + fn is_nan(_self: Val) -> bool { let output: bool = bevy::math::Vec3A::is_nan(_self.into_inner()).into(); output } - fn is_nan_mask(_self: Val) { + /// Performs `is_nan` on each element of self, returning a vector mask of the results. + /// In other words, this computes `[x.is_nan(), y.is_nan(), ...]`. + fn is_nan_mask(_self: Val) -> Val { let output: Val = bevy::math::Vec3A::is_nan_mask( _self.into_inner(), ) .into(); output } - fn is_negative_bitmask(_self: Val) { + /// Returns a bitmask with the lowest 3 bits set to the sign bits from the elements of `self`. + /// A negative element results in a `1` bit and a positive element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn is_negative_bitmask(_self: Val) -> u32 { let output: u32 = bevy::math::Vec3A::is_negative_bitmask(_self.into_inner()) .into(); output } - fn is_normalized(_self: Val) { + /// Returns whether `self` is length `1.0` or not. + /// Uses a precision threshold of approximately `1e-4`. + fn is_normalized(_self: Val) -> bool { let output: bool = bevy::math::Vec3A::is_normalized(_self.into_inner()).into(); output } - fn length(_self: Val) { + /// Computes the length of `self`. + fn length(_self: Val) -> f32 { let output: f32 = bevy::math::Vec3A::length(_self.into_inner()).into(); output } - fn length_recip(_self: Val) { + /// Computes `1.0 / length()`. + /// For valid results, `self` must _not_ be of length zero. + fn length_recip(_self: Val) -> f32 { let output: f32 = bevy::math::Vec3A::length_recip(_self.into_inner()).into(); output } - fn length_squared(_self: Val) { + /// Computes the squared length of `self`. + /// This is faster than `length()` as it avoids a square root operation. + fn length_squared(_self: Val) -> f32 { let output: f32 = bevy::math::Vec3A::length_squared(_self.into_inner()).into(); output } - fn lerp(_self: Val, rhs: Val, s: f32) { + /// Performs a linear interpolation between `self` and `rhs` based on the value `s`. + /// When `s` is `0.0`, the result will be equal to `self`. When `s` is `1.0`, the result + /// will be equal to `rhs`. When `s` is outside of range `[0, 1]`, the result is linearly + /// extrapolated. + fn lerp( + _self: Val, + rhs: Val, + s: f32, + ) -> Val { let output: Val = bevy::math::Vec3A::lerp( _self.into_inner(), rhs.into_inner(), @@ -8076,7 +11778,12 @@ impl bevy::math::Vec3A { .into(); output } - fn max(_self: Val, rhs: Val) { + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3A::max( _self.into_inner(), rhs.into_inner(), @@ -8084,11 +11791,20 @@ impl bevy::math::Vec3A { .into(); output } - fn max_element(_self: Val) { + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> f32 { let output: f32 = bevy::math::Vec3A::max_element(_self.into_inner()).into(); output } - fn midpoint(_self: Val, rhs: Val) { + /// Calculates the midpoint between `self` and `rhs`. + /// The midpoint is the average of, or halfway point between, two vectors. + /// `a.midpoint(b)` should yield the same result as `a.lerp(b, 0.5)` + /// while being slightly cheaper to compute. + fn midpoint( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3A::midpoint( _self.into_inner(), rhs.into_inner(), @@ -8096,7 +11812,12 @@ impl bevy::math::Vec3A { .into(); output } - fn min(_self: Val, rhs: Val) { + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3A::min( _self.into_inner(), rhs.into_inner(), @@ -8104,11 +11825,20 @@ impl bevy::math::Vec3A { .into(); output } - fn min_element(_self: Val) { + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> f32 { let output: f32 = bevy::math::Vec3A::min_element(_self.into_inner()).into(); output } - fn move_towards(_self: Ref, rhs: Val, d: f32) { + /// Moves towards `rhs` based on the value `d`. + /// When `d` is `0.0`, the result will be equal to `self`. When `d` is equal to + /// `self.distance(rhs)`, the result will be equal to `rhs`. Will not go past `rhs`. + fn move_towards( + _self: Ref, + rhs: Val, + d: f32, + ) -> Val { let output: Val = bevy::math::Vec3A::move_towards( &_self, rhs.into_inner(), @@ -8117,32 +11847,44 @@ impl bevy::math::Vec3A { .into(); output } - fn mul(_self: Val, rhs: Ref) { + fn mul( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::mul(_self.into_inner(), &rhs) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: f32) { + fn mul(_self: Val, rhs: f32) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } + /// Fused multiply-add. Computes `(self * a) + b` element-wise with only one rounding + /// error, yielding a more accurate result than an unfused multiply-add. + /// Using `mul_add` *may* be more performant than an unfused multiply-add if the target + /// architecture has a dedicated fma CPU instruction. However, this is not always true, + /// and will be heavily dependant on designing algorithms with specific target hardware in + /// mind. fn mul_add( _self: Val, a: Val, b: Val, - ) { + ) -> Val { let output: Val = bevy::math::Vec3A::mul_add( _self.into_inner(), a.into_inner(), @@ -8151,25 +11893,39 @@ impl bevy::math::Vec3A { .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } - fn new(x: f32, y: f32, z: f32) { + /// Creates a new vector. + fn new(x: f32, y: f32, z: f32) -> Val { let output: Val = bevy::math::Vec3A::new(x, y, z).into(); output } - fn normalize(_self: Val) { + /// Returns `self` normalized to length 1.0. + /// For valid results, `self` must be finite and _not_ of length zero, nor very close to zero. + /// See also [`Self::try_normalize()`] and [`Self::normalize_or_zero()`]. + /// Panics + /// Will panic if the resulting normalized vector is not finite when `glam_assert` is enabled. + fn normalize(_self: Val) -> Val { let output: Val = bevy::math::Vec3A::normalize( _self.into_inner(), ) .into(); output } - fn normalize_or(_self: Val, fallback: Val) { + /// Returns `self` normalized to length 1.0 if possible, else returns a + /// fallback value. + /// In particular, if the input is zero (or very close to zero), or non-finite, + /// the result of this operation will be the fallback value. + /// See also [`Self::try_normalize()`]. + fn normalize_or( + _self: Val, + fallback: Val, + ) -> Val { let output: Val = bevy::math::Vec3A::normalize_or( _self.into_inner(), fallback.into_inner(), @@ -8177,14 +11933,19 @@ impl bevy::math::Vec3A { .into(); output } - fn normalize_or_zero(_self: Val) { + /// Returns `self` normalized to length 1.0 if possible, else returns zero. + /// In particular, if the input is zero (or very close to zero), or non-finite, + /// the result of this operation will be zero. + /// See also [`Self::try_normalize()`]. + fn normalize_or_zero(_self: Val) -> Val { let output: Val = bevy::math::Vec3A::normalize_or_zero( _self.into_inner(), ) .into(); output } - fn powf(_self: Val, n: f32) { + /// Returns a vector containing each element of `self` raised to the power of `n`. + fn powf(_self: Val, n: f32) -> Val { let output: Val = bevy::math::Vec3A::powf( _self.into_inner(), n, @@ -8192,7 +11953,14 @@ impl bevy::math::Vec3A { .into(); output } - fn project_onto(_self: Val, rhs: Val) { + /// Returns the vector projection of `self` onto `rhs`. + /// `rhs` must be of non-zero length. + /// # Panics + /// Will panic if `rhs` is zero length when `glam_assert` is enabled. + fn project_onto( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3A::project_onto( _self.into_inner(), rhs.into_inner(), @@ -8200,10 +11968,14 @@ impl bevy::math::Vec3A { .into(); output } + /// Returns the vector projection of `self` onto `rhs`. + /// `rhs` must be normalized. + /// # Panics + /// Will panic if `rhs` is not normalized when `glam_assert` is enabled. fn project_onto_normalized( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::Vec3A::project_onto_normalized( _self.into_inner(), rhs.into_inner(), @@ -8211,12 +11983,21 @@ impl bevy::math::Vec3A { .into(); output } - fn recip(_self: Val) { + /// Returns a vector containing the reciprocal `1.0/n` of each element of `self`. + fn recip(_self: Val) -> Val { let output: Val = bevy::math::Vec3A::recip(_self.into_inner()) .into(); output } - fn reflect(_self: Val, normal: Val) { + /// Returns the reflection vector for a given incident vector `self` and surface normal + /// `normal`. + /// `normal` must be normalized. + /// # Panics + /// Will panic if `normal` is not normalized when `glam_assert` is enabled. + fn reflect( + _self: Val, + normal: Val, + ) -> Val { let output: Val = bevy::math::Vec3A::reflect( _self.into_inner(), normal.into_inner(), @@ -8224,7 +12005,17 @@ impl bevy::math::Vec3A { .into(); output } - fn refract(_self: Val, normal: Val, eta: f32) { + /// Returns the refraction direction for a given incident vector `self`, surface normal + /// `normal` and ratio of indices of refraction, `eta`. When total internal reflection occurs, + /// a zero vector will be returned. + /// `self` and `normal` must be normalized. + /// # Panics + /// Will panic if `self` or `normal` is not normalized when `glam_assert` is enabled. + fn refract( + _self: Val, + normal: Val, + eta: f32, + ) -> Val { let output: Val = bevy::math::Vec3A::refract( _self.into_inner(), normal.into_inner(), @@ -8233,7 +12024,16 @@ impl bevy::math::Vec3A { .into(); output } - fn reject_from(_self: Val, rhs: Val) { + /// Returns the vector rejection of `self` from `rhs`. + /// The vector rejection is the vector perpendicular to the projection of `self` onto + /// `rhs`, in rhs words the result of `self - self.project_onto(rhs)`. + /// `rhs` must be of non-zero length. + /// # Panics + /// Will panic if `rhs` has a length of zero when `glam_assert` is enabled. + fn reject_from( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3A::reject_from( _self.into_inner(), rhs.into_inner(), @@ -8241,10 +12041,16 @@ impl bevy::math::Vec3A { .into(); output } + /// Returns the vector rejection of `self` from `rhs`. + /// The vector rejection is the vector perpendicular to the projection of `self` onto + /// `rhs`, in rhs words the result of `self - self.project_onto(rhs)`. + /// `rhs` must be normalized. + /// # Panics + /// Will panic if `rhs` is not normalized when `glam_assert` is enabled. fn reject_from_normalized( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::Vec3A::reject_from_normalized( _self.into_inner(), rhs.into_inner(), @@ -8252,28 +12058,39 @@ impl bevy::math::Vec3A { .into(); output } - fn rem(_self: Val, rhs: Ref) { + fn rem( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::rem(_self.into_inner(), &rhs) .into(); output } - fn rem(_self: Val, rhs: Val) { + fn rem( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) .into(); output } - fn rem(_self: Val, rhs: f32) { + fn rem(_self: Val, rhs: f32) -> Val { let output: Val = >::rem(_self.into_inner(), rhs) .into(); output } - fn rem_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. + /// [Euclidean division]: f32::rem_euclid + fn rem_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec3A::rem_euclid( _self.into_inner(), rhs.into_inner(), @@ -8281,16 +12098,22 @@ impl bevy::math::Vec3A { .into(); output } - fn round(_self: Val) { + /// Returns a vector containing the nearest integer to a number for each element of `self`. + /// Round half-way cases away from 0.0. + fn round(_self: Val) -> Val { let output: Val = bevy::math::Vec3A::round(_self.into_inner()) .into(); output } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. fn select( mask: Val, if_true: Val, if_false: Val, - ) { + ) -> Val { let output: Val = bevy::math::Vec3A::select( mask.into_inner(), if_true.into_inner(), @@ -8299,55 +12122,72 @@ impl bevy::math::Vec3A { .into(); output } - fn signum(_self: Val) { + /// Returns a vector with elements representing the sign of `self`. + /// - `1.0` if the number is positive, `+0.0` or `INFINITY` + /// - `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY` + /// - `NAN` if the number is `NAN` + fn signum(_self: Val) -> Val { let output: Val = bevy::math::Vec3A::signum( _self.into_inner(), ) .into(); output } - fn splat(v: f32) { + /// Creates a vector with all elements set to `v`. + fn splat(v: f32) -> Val { let output: Val = bevy::math::Vec3A::splat(v).into(); output } - fn sub(_self: Val, rhs: Ref) { + fn sub( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::sub(_self.into_inner(), &rhs) .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub(_self: Val, rhs: f32) { + fn sub(_self: Val, rhs: f32) -> Val { let output: Val = >::sub(_self.into_inner(), rhs) .into(); output } - fn to_array(_self: Ref) { + /// `[x, y, z]` + fn to_array(_self: Ref) -> [f32; 3] { let output: [f32; 3] = bevy::math::Vec3A::to_array(&_self).into(); output } - fn trunc(_self: Val) { + /// Returns a vector containing the integer part each element of `self`. This means numbers are + /// always truncated towards zero. + fn trunc(_self: Val) -> Val { let output: Val = bevy::math::Vec3A::trunc(_self.into_inner()) .into(); output } - fn truncate(_self: Val) { + /// Creates a 2D vector from the `x` and `y` elements of `self`, discarding `z`. + /// Truncation may also be performed by using [`self.xy()`][crate::swizzles::Vec3Swizzles::xy()]. + fn truncate(_self: Val) -> Val { let output: Val = bevy::math::Vec3A::truncate( _self.into_inner(), ) .into(); output } - fn with_x(_self: Val, x: f32) { + /// Creates a 3D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: f32) -> Val { let output: Val = bevy::math::Vec3A::with_x( _self.into_inner(), x, @@ -8355,7 +12195,8 @@ impl bevy::math::Vec3A { .into(); output } - fn with_y(_self: Val, y: f32) { + /// Creates a 3D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: f32) -> Val { let output: Val = bevy::math::Vec3A::with_y( _self.into_inner(), y, @@ -8363,7 +12204,8 @@ impl bevy::math::Vec3A { .into(); output } - fn with_z(_self: Val, z: f32) { + /// Creates a 3D vector from `self` with the given value of `z`. + fn with_z(_self: Val, z: f32) -> Val { let output: Val = bevy::math::Vec3A::with_z( _self.into_inner(), z, @@ -8378,16 +12220,24 @@ impl bevy::math::Vec3A { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::Vec4 { - fn abs(_self: Val) { + /// Returns a vector containing the absolute value of each element of `self`. + fn abs(_self: Val) -> Val { let output: Val = bevy::math::Vec4::abs(_self.into_inner()) .into(); output } + /// Returns true if the absolute difference of all elements between `self` and `rhs` is + /// less than or equal to `max_abs_diff`. + /// This can be used to compare if two vectors contain similar elements. It works best when + /// comparing with a known value. The `max_abs_diff` that should be used used depends on + /// the values being compared against. + /// For more see + /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). fn abs_diff_eq( _self: Val, rhs: Val, max_abs_diff: f32, - ) { + ) -> bool { let output: bool = bevy::math::Vec4::abs_diff_eq( _self.into_inner(), rhs.into_inner(), @@ -8396,59 +12246,76 @@ impl bevy::math::Vec4 { .into(); output } - fn add(_self: Val, rhs: Ref) { + fn add( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::add(_self.into_inner(), &rhs) .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add(_self: Val, rhs: f32) { + fn add(_self: Val, rhs: f32) -> Val { let output: Val = >::add(_self.into_inner(), rhs) .into(); output } - fn as_dvec4(_self: Ref) { + /// Casts all elements of `self` to `f64`. + fn as_dvec4(_self: Ref) -> Val { let output: Val = bevy::math::Vec4::as_dvec4(&_self).into(); output } - fn as_i64vec4(_self: Ref) { + /// Casts all elements of `self` to `i64`. + fn as_i64vec4(_self: Ref) -> Val { let output: Val = bevy::math::Vec4::as_i64vec4(&_self) .into(); output } - fn as_ivec4(_self: Ref) { + /// Casts all elements of `self` to `i32`. + fn as_ivec4(_self: Ref) -> Val { let output: Val = bevy::math::Vec4::as_ivec4(&_self).into(); output } - fn as_u64vec4(_self: Ref) { + /// Casts all elements of `self` to `u64`. + fn as_u64vec4(_self: Ref) -> Val { let output: Val = bevy::math::Vec4::as_u64vec4(&_self) .into(); output } - fn as_uvec4(_self: Ref) { + /// Casts all elements of `self` to `u32`. + fn as_uvec4(_self: Ref) -> Val { let output: Val = bevy::math::Vec4::as_uvec4(&_self).into(); output } - fn ceil(_self: Val) { + /// Returns a vector containing the smallest integer greater than or equal to a number for + /// each element of `self`. + fn ceil(_self: Val) -> Val { let output: Val = bevy::math::Vec4::ceil(_self.into_inner()) .into(); output } + /// Component-wise clamping of values, similar to [`f32::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( _self: Val, min: Val, max: Val, - ) { + ) -> Val { let output: Val = bevy::math::Vec4::clamp( _self.into_inner(), min.into_inner(), @@ -8457,7 +12324,14 @@ impl bevy::math::Vec4 { .into(); output } - fn clamp_length(_self: Val, min: f32, max: f32) { + /// Returns a vector with a length no less than `min` and no more than `max`. + /// # Panics + /// Will panic if `min` is greater than `max`, or if either `min` or `max` is negative, when `glam_assert` is enabled. + fn clamp_length( + _self: Val, + min: f32, + max: f32, + ) -> Val { let output: Val = bevy::math::Vec4::clamp_length( _self.into_inner(), min, @@ -8466,7 +12340,13 @@ impl bevy::math::Vec4 { .into(); output } - fn clamp_length_max(_self: Val, max: f32) { + /// Returns a vector with a length no more than `max`. + /// # Panics + /// Will panic if `max` is negative when `glam_assert` is enabled. + fn clamp_length_max( + _self: Val, + max: f32, + ) -> Val { let output: Val = bevy::math::Vec4::clamp_length_max( _self.into_inner(), max, @@ -8474,7 +12354,13 @@ impl bevy::math::Vec4 { .into(); output } - fn clamp_length_min(_self: Val, min: f32) { + /// Returns a vector with a length no less than `min`. + /// # Panics + /// Will panic if `min` is negative when `glam_assert` is enabled. + fn clamp_length_min( + _self: Val, + min: f32, + ) -> Val { let output: Val = bevy::math::Vec4::clamp_length_min( _self.into_inner(), min, @@ -8482,14 +12368,21 @@ impl bevy::math::Vec4 { .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn cmpeq(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec4::cmpeq( _self.into_inner(), rhs.into_inner(), @@ -8497,7 +12390,14 @@ impl bevy::math::Vec4 { .into(); output } - fn cmpge(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec4::cmpge( _self.into_inner(), rhs.into_inner(), @@ -8505,7 +12405,14 @@ impl bevy::math::Vec4 { .into(); output } - fn cmpgt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec4::cmpgt( _self.into_inner(), rhs.into_inner(), @@ -8513,7 +12420,14 @@ impl bevy::math::Vec4 { .into(); output } - fn cmple(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec4::cmple( _self.into_inner(), rhs.into_inner(), @@ -8521,7 +12435,14 @@ impl bevy::math::Vec4 { .into(); output } - fn cmplt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec4::cmplt( _self.into_inner(), rhs.into_inner(), @@ -8529,7 +12450,14 @@ impl bevy::math::Vec4 { .into(); output } - fn cmpne(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec4::cmpne( _self.into_inner(), rhs.into_inner(), @@ -8537,7 +12465,11 @@ impl bevy::math::Vec4 { .into(); output } - fn copysign(_self: Val, rhs: Val) { + /// Returns a vector with signs of `rhs` and the magnitudes of `self`. + fn copysign( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec4::copysign( _self.into_inner(), rhs.into_inner(), @@ -8545,7 +12477,8 @@ impl bevy::math::Vec4 { .into(); output } - fn distance(_self: Val, rhs: Val) { + /// Computes the Euclidean distance between two points in space. + fn distance(_self: Val, rhs: Val) -> f32 { let output: f32 = bevy::math::Vec4::distance( _self.into_inner(), rhs.into_inner(), @@ -8553,7 +12486,11 @@ impl bevy::math::Vec4 { .into(); output } - fn distance_squared(_self: Val, rhs: Val) { + /// Compute the squared euclidean distance between two points in space. + fn distance_squared( + _self: Val, + rhs: Val, + ) -> f32 { let output: f32 = bevy::math::Vec4::distance_squared( _self.into_inner(), rhs.into_inner(), @@ -8561,28 +12498,38 @@ impl bevy::math::Vec4 { .into(); output } - fn div(_self: Val, rhs: Ref) { + fn div( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::div(_self.into_inner(), &rhs) .into(); output } - fn div(_self: Val, rhs: Val) { + fn div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::div(_self.into_inner(), rhs.into_inner()) .into(); output } - fn div(_self: Val, rhs: f32) { + fn div(_self: Val, rhs: f32) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn div_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. + fn div_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec4::div_euclid( _self.into_inner(), rhs.into_inner(), @@ -8590,12 +12537,17 @@ impl bevy::math::Vec4 { .into(); output } - fn dot(_self: Val, rhs: Val) { + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> f32 { let output: f32 = bevy::math::Vec4::dot(_self.into_inner(), rhs.into_inner()) .into(); output } - fn dot_into_vec(_self: Val, rhs: Val) { + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec4::dot_into_vec( _self.into_inner(), rhs.into_inner(), @@ -8603,91 +12555,133 @@ impl bevy::math::Vec4 { .into(); output } - fn element_product(_self: Val) { + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> f32 { let output: f32 = bevy::math::Vec4::element_product(_self.into_inner()).into(); output } - fn element_sum(_self: Val) { + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> f32 { let output: f32 = bevy::math::Vec4::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, rhs: Ref) { + fn eq(_self: Ref, rhs: Ref) -> bool { let output: bool = >::eq(&_self, &rhs) .into(); output } - fn exp(_self: Val) { + /// Returns a vector containing `e^self` (the exponential function) for each element of + /// `self`. + fn exp(_self: Val) -> Val { let output: Val = bevy::math::Vec4::exp(_self.into_inner()) .into(); output } - fn floor(_self: Val) { + /// Returns a vector containing the largest integer less than or equal to a number for each + /// element of `self`. + fn floor(_self: Val) -> Val { let output: Val = bevy::math::Vec4::floor(_self.into_inner()) .into(); output } - fn fract(_self: Val) { + /// Returns a vector containing the fractional part of the vector as `self - self.trunc()`. + /// Note that this differs from the GLSL implementation of `fract` which returns + /// `self - self.floor()`. + /// Note that this is fast but not precise for large numbers. + fn fract(_self: Val) -> Val { let output: Val = bevy::math::Vec4::fract(_self.into_inner()) .into(); output } - fn fract_gl(_self: Val) { + /// Returns a vector containing the fractional part of the vector as `self - self.floor()`. + /// Note that this differs from the Rust implementation of `fract` which returns + /// `self - self.trunc()`. + /// Note that this is fast but not precise for large numbers. + fn fract_gl(_self: Val) -> Val { let output: Val = bevy::math::Vec4::fract_gl( _self.into_inner(), ) .into(); output } - fn from_array(a: [f32; 4]) { + /// Creates a new vector from an array. + fn from_array(a: [f32; 4]) -> Val { let output: Val = bevy::math::Vec4::from_array(a).into(); output } - fn is_finite(_self: Val) { + /// Returns `true` if, and only if, all elements are finite. If any element is either + /// `NaN`, positive or negative infinity, this will return `false`. + fn is_finite(_self: Val) -> bool { let output: bool = bevy::math::Vec4::is_finite(_self.into_inner()).into(); output } - fn is_finite_mask(_self: Val) { + /// Performs `is_finite` on each element of self, returning a vector mask of the results. + /// In other words, this computes `[x.is_finite(), y.is_finite(), ...]`. + fn is_finite_mask(_self: Val) -> Val { let output: Val = bevy::math::Vec4::is_finite_mask( _self.into_inner(), ) .into(); output } - fn is_nan(_self: Val) { + /// Returns `true` if any elements are `NaN`. + fn is_nan(_self: Val) -> bool { let output: bool = bevy::math::Vec4::is_nan(_self.into_inner()).into(); output } - fn is_nan_mask(_self: Val) { + /// Performs `is_nan` on each element of self, returning a vector mask of the results. + /// In other words, this computes `[x.is_nan(), y.is_nan(), ...]`. + fn is_nan_mask(_self: Val) -> Val { let output: Val = bevy::math::Vec4::is_nan_mask( _self.into_inner(), ) .into(); output } - fn is_negative_bitmask(_self: Val) { + /// Returns a bitmask with the lowest 4 bits set to the sign bits from the elements of `self`. + /// A negative element results in a `1` bit and a positive element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn is_negative_bitmask(_self: Val) -> u32 { let output: u32 = bevy::math::Vec4::is_negative_bitmask(_self.into_inner()) .into(); output } - fn is_normalized(_self: Val) { + /// Returns whether `self` is length `1.0` or not. + /// Uses a precision threshold of approximately `1e-4`. + fn is_normalized(_self: Val) -> bool { let output: bool = bevy::math::Vec4::is_normalized(_self.into_inner()).into(); output } - fn length(_self: Val) { + /// Computes the length of `self`. + fn length(_self: Val) -> f32 { let output: f32 = bevy::math::Vec4::length(_self.into_inner()).into(); output } - fn length_recip(_self: Val) { + /// Computes `1.0 / length()`. + /// For valid results, `self` must _not_ be of length zero. + fn length_recip(_self: Val) -> f32 { let output: f32 = bevy::math::Vec4::length_recip(_self.into_inner()).into(); output } - fn length_squared(_self: Val) { + /// Computes the squared length of `self`. + /// This is faster than `length()` as it avoids a square root operation. + fn length_squared(_self: Val) -> f32 { let output: f32 = bevy::math::Vec4::length_squared(_self.into_inner()).into(); output } - fn lerp(_self: Val, rhs: Val, s: f32) { + /// Performs a linear interpolation between `self` and `rhs` based on the value `s`. + /// When `s` is `0.0`, the result will be equal to `self`. When `s` is `1.0`, the result + /// will be equal to `rhs`. When `s` is outside of range `[0, 1]`, the result is linearly + /// extrapolated. + fn lerp( + _self: Val, + rhs: Val, + s: f32, + ) -> Val { let output: Val = bevy::math::Vec4::lerp( _self.into_inner(), rhs.into_inner(), @@ -8696,7 +12690,12 @@ impl bevy::math::Vec4 { .into(); output } - fn max(_self: Val, rhs: Val) { + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec4::max( _self.into_inner(), rhs.into_inner(), @@ -8704,11 +12703,20 @@ impl bevy::math::Vec4 { .into(); output } - fn max_element(_self: Val) { + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> f32 { let output: f32 = bevy::math::Vec4::max_element(_self.into_inner()).into(); output } - fn midpoint(_self: Val, rhs: Val) { + /// Calculates the midpoint between `self` and `rhs`. + /// The midpoint is the average of, or halfway point between, two vectors. + /// `a.midpoint(b)` should yield the same result as `a.lerp(b, 0.5)` + /// while being slightly cheaper to compute. + fn midpoint( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec4::midpoint( _self.into_inner(), rhs.into_inner(), @@ -8716,7 +12724,12 @@ impl bevy::math::Vec4 { .into(); output } - fn min(_self: Val, rhs: Val) { + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec4::min( _self.into_inner(), rhs.into_inner(), @@ -8724,11 +12737,20 @@ impl bevy::math::Vec4 { .into(); output } - fn min_element(_self: Val) { + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> f32 { let output: f32 = bevy::math::Vec4::min_element(_self.into_inner()).into(); output } - fn move_towards(_self: Ref, rhs: Val, d: f32) { + /// Moves towards `rhs` based on the value `d`. + /// When `d` is `0.0`, the result will be equal to `self`. When `d` is equal to + /// `self.distance(rhs)`, the result will be equal to `rhs`. Will not go past `rhs`. + fn move_towards( + _self: Ref, + rhs: Val, + d: f32, + ) -> Val { let output: Val = bevy::math::Vec4::move_towards( &_self, rhs.into_inner(), @@ -8737,32 +12759,44 @@ impl bevy::math::Vec4 { .into(); output } - fn mul(_self: Val, rhs: Ref) { + fn mul( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::mul(_self.into_inner(), &rhs) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: f32) { + fn mul(_self: Val, rhs: f32) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } + /// Fused multiply-add. Computes `(self * a) + b` element-wise with only one rounding + /// error, yielding a more accurate result than an unfused multiply-add. + /// Using `mul_add` *may* be more performant than an unfused multiply-add if the target + /// architecture has a dedicated fma CPU instruction. However, this is not always true, + /// and will be heavily dependant on designing algorithms with specific target hardware in + /// mind. fn mul_add( _self: Val, a: Val, b: Val, - ) { + ) -> Val { let output: Val = bevy::math::Vec4::mul_add( _self.into_inner(), a.into_inner(), @@ -8771,25 +12805,39 @@ impl bevy::math::Vec4 { .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } - fn new(x: f32, y: f32, z: f32, w: f32) { + /// Creates a new vector. + fn new(x: f32, y: f32, z: f32, w: f32) -> Val { let output: Val = bevy::math::Vec4::new(x, y, z, w).into(); output } - fn normalize(_self: Val) { + /// Returns `self` normalized to length 1.0. + /// For valid results, `self` must be finite and _not_ of length zero, nor very close to zero. + /// See also [`Self::try_normalize()`] and [`Self::normalize_or_zero()`]. + /// Panics + /// Will panic if the resulting normalized vector is not finite when `glam_assert` is enabled. + fn normalize(_self: Val) -> Val { let output: Val = bevy::math::Vec4::normalize( _self.into_inner(), ) .into(); output } - fn normalize_or(_self: Val, fallback: Val) { + /// Returns `self` normalized to length 1.0 if possible, else returns a + /// fallback value. + /// In particular, if the input is zero (or very close to zero), or non-finite, + /// the result of this operation will be the fallback value. + /// See also [`Self::try_normalize()`]. + fn normalize_or( + _self: Val, + fallback: Val, + ) -> Val { let output: Val = bevy::math::Vec4::normalize_or( _self.into_inner(), fallback.into_inner(), @@ -8797,19 +12845,31 @@ impl bevy::math::Vec4 { .into(); output } - fn normalize_or_zero(_self: Val) { + /// Returns `self` normalized to length 1.0 if possible, else returns zero. + /// In particular, if the input is zero (or very close to zero), or non-finite, + /// the result of this operation will be zero. + /// See also [`Self::try_normalize()`]. + fn normalize_or_zero(_self: Val) -> Val { let output: Val = bevy::math::Vec4::normalize_or_zero( _self.into_inner(), ) .into(); output } - fn powf(_self: Val, n: f32) { + /// Returns a vector containing each element of `self` raised to the power of `n`. + fn powf(_self: Val, n: f32) -> Val { let output: Val = bevy::math::Vec4::powf(_self.into_inner(), n) .into(); output } - fn project_onto(_self: Val, rhs: Val) { + /// Returns the vector projection of `self` onto `rhs`. + /// `rhs` must be of non-zero length. + /// # Panics + /// Will panic if `rhs` is zero length when `glam_assert` is enabled. + fn project_onto( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec4::project_onto( _self.into_inner(), rhs.into_inner(), @@ -8817,10 +12877,14 @@ impl bevy::math::Vec4 { .into(); output } + /// Returns the vector projection of `self` onto `rhs`. + /// `rhs` must be normalized. + /// # Panics + /// Will panic if `rhs` is not normalized when `glam_assert` is enabled. fn project_onto_normalized( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::Vec4::project_onto_normalized( _self.into_inner(), rhs.into_inner(), @@ -8828,12 +12892,21 @@ impl bevy::math::Vec4 { .into(); output } - fn recip(_self: Val) { + /// Returns a vector containing the reciprocal `1.0/n` of each element of `self`. + fn recip(_self: Val) -> Val { let output: Val = bevy::math::Vec4::recip(_self.into_inner()) .into(); output } - fn reflect(_self: Val, normal: Val) { + /// Returns the reflection vector for a given incident vector `self` and surface normal + /// `normal`. + /// `normal` must be normalized. + /// # Panics + /// Will panic if `normal` is not normalized when `glam_assert` is enabled. + fn reflect( + _self: Val, + normal: Val, + ) -> Val { let output: Val = bevy::math::Vec4::reflect( _self.into_inner(), normal.into_inner(), @@ -8841,7 +12914,17 @@ impl bevy::math::Vec4 { .into(); output } - fn refract(_self: Val, normal: Val, eta: f32) { + /// Returns the refraction direction for a given incident vector `self`, surface normal + /// `normal` and ratio of indices of refraction, `eta`. When total internal reflection occurs, + /// a zero vector will be returned. + /// `self` and `normal` must be normalized. + /// # Panics + /// Will panic if `self` or `normal` is not normalized when `glam_assert` is enabled. + fn refract( + _self: Val, + normal: Val, + eta: f32, + ) -> Val { let output: Val = bevy::math::Vec4::refract( _self.into_inner(), normal.into_inner(), @@ -8850,7 +12933,16 @@ impl bevy::math::Vec4 { .into(); output } - fn reject_from(_self: Val, rhs: Val) { + /// Returns the vector rejection of `self` from `rhs`. + /// The vector rejection is the vector perpendicular to the projection of `self` onto + /// `rhs`, in rhs words the result of `self - self.project_onto(rhs)`. + /// `rhs` must be of non-zero length. + /// # Panics + /// Will panic if `rhs` has a length of zero when `glam_assert` is enabled. + fn reject_from( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec4::reject_from( _self.into_inner(), rhs.into_inner(), @@ -8858,7 +12950,16 @@ impl bevy::math::Vec4 { .into(); output } - fn reject_from_normalized(_self: Val, rhs: Val) { + /// Returns the vector rejection of `self` from `rhs`. + /// The vector rejection is the vector perpendicular to the projection of `self` onto + /// `rhs`, in rhs words the result of `self - self.project_onto(rhs)`. + /// `rhs` must be normalized. + /// # Panics + /// Will panic if `rhs` is not normalized when `glam_assert` is enabled. + fn reject_from_normalized( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec4::reject_from_normalized( _self.into_inner(), rhs.into_inner(), @@ -8866,28 +12967,39 @@ impl bevy::math::Vec4 { .into(); output } - fn rem(_self: Val, rhs: Ref) { + fn rem( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::rem(_self.into_inner(), &rhs) .into(); output } - fn rem(_self: Val, rhs: Val) { + fn rem( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) .into(); output } - fn rem(_self: Val, rhs: f32) { + fn rem(_self: Val, rhs: f32) -> Val { let output: Val = >::rem(_self.into_inner(), rhs) .into(); output } - fn rem_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. + /// [Euclidean division]: f32::rem_euclid + fn rem_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Vec4::rem_euclid( _self.into_inner(), rhs.into_inner(), @@ -8895,16 +13007,22 @@ impl bevy::math::Vec4 { .into(); output } - fn round(_self: Val) { + /// Returns a vector containing the nearest integer to a number for each element of `self`. + /// Round half-way cases away from 0.0. + fn round(_self: Val) -> Val { let output: Val = bevy::math::Vec4::round(_self.into_inner()) .into(); output } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. fn select( mask: Val, if_true: Val, if_false: Val, - ) { + ) -> Val { let output: Val = bevy::math::Vec4::select( mask.into_inner(), if_true.into_inner(), @@ -8913,53 +13031,71 @@ impl bevy::math::Vec4 { .into(); output } - fn signum(_self: Val) { + /// Returns a vector with elements representing the sign of `self`. + /// - `1.0` if the number is positive, `+0.0` or `INFINITY` + /// - `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY` + /// - `NAN` if the number is `NAN` + fn signum(_self: Val) -> Val { let output: Val = bevy::math::Vec4::signum(_self.into_inner()) .into(); output } - fn splat(v: f32) { + /// Creates a vector with all elements set to `v`. + fn splat(v: f32) -> Val { let output: Val = bevy::math::Vec4::splat(v).into(); output } - fn sub(_self: Val, rhs: Ref) { + fn sub( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::sub(_self.into_inner(), &rhs) .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub(_self: Val, rhs: f32) { + fn sub(_self: Val, rhs: f32) -> Val { let output: Val = >::sub(_self.into_inner(), rhs) .into(); output } - fn to_array(_self: Ref) { + /// `[x, y, z, w]` + fn to_array(_self: Ref) -> [f32; 4] { let output: [f32; 4] = bevy::math::Vec4::to_array(&_self).into(); output } - fn trunc(_self: Val) { + /// Returns a vector containing the integer part each element of `self`. This means numbers are + /// always truncated towards zero. + fn trunc(_self: Val) -> Val { let output: Val = bevy::math::Vec4::trunc(_self.into_inner()) .into(); output } - fn truncate(_self: Val) { + /// Creates a 3D vector from the `x`, `y` and `z` elements of `self`, discarding `w`. + /// Truncation to [`Vec3`] may also be performed by using [`self.xyz()`][crate::swizzles::Vec4Swizzles::xyz()]. + /// To truncate to [`Vec3A`] use [`Vec3A::from()`]. + fn truncate(_self: Val) -> Val { let output: Val = bevy::math::Vec4::truncate( _self.into_inner(), ) .into(); output } - fn with_w(_self: Val, w: f32) { + /// Creates a 4D vector from `self` with the given value of `w`. + fn with_w(_self: Val, w: f32) -> Val { let output: Val = bevy::math::Vec4::with_w( _self.into_inner(), w, @@ -8967,7 +13103,8 @@ impl bevy::math::Vec4 { .into(); output } - fn with_x(_self: Val, x: f32) { + /// Creates a 4D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: f32) -> Val { let output: Val = bevy::math::Vec4::with_x( _self.into_inner(), x, @@ -8975,7 +13112,8 @@ impl bevy::math::Vec4 { .into(); output } - fn with_y(_self: Val, y: f32) { + /// Creates a 4D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: f32) -> Val { let output: Val = bevy::math::Vec4::with_y( _self.into_inner(), y, @@ -8983,7 +13121,8 @@ impl bevy::math::Vec4 { .into(); output } - fn with_z(_self: Val, z: f32) { + /// Creates a 4D vector from `self` with the given value of `z`. + fn with_z(_self: Val, z: f32) -> Val { let output: Val = bevy::math::Vec4::with_z( _self.into_inner(), z, @@ -8998,56 +13137,68 @@ impl bevy::math::Vec4 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::BVec2 { - fn all(_self: Val) { + /// Returns true if all the elements are true, false otherwise. + fn all(_self: Val) -> bool { let output: bool = bevy::math::BVec2::all(_self.into_inner()).into(); output } - fn any(_self: Val) { + /// Returns true if any of the elements are true, false otherwise. + fn any(_self: Val) -> bool { let output: bool = bevy::math::BVec2::any(_self.into_inner()).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn bitmask(_self: Val) { + /// Returns a bitmask with the lowest 2 bits set from the elements of `self`. + /// A true element results in a `1` bit and a false element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn bitmask(_self: Val) -> u32 { let output: u32 = bevy::math::BVec2::bitmask(_self.into_inner()).into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn from_array(a: [bool; 2]) { + /// Creates a new vector mask from a bool array. + fn from_array(a: [bool; 2]) -> Val { let output: Val = bevy::math::BVec2::from_array(a).into(); output } - fn new(x: bool, y: bool) { + /// Creates a new vector mask. + fn new(x: bool, y: bool) -> Val { let output: Val = bevy::math::BVec2::new(x, y).into(); output } - fn set(mut _self: Mut, index: usize, value: bool) { + /// Sets the element at `index`. + /// Panics if `index` is greater than 1. + fn set(mut _self: Mut, index: usize, value: bool) -> () { let output: () = bevy::math::BVec2::set(&mut _self, index, value).into(); output } - fn splat(v: bool) { + /// Creates a vector mask with all elements set to `v`. + fn splat(v: bool) -> Val { let output: Val = bevy::math::BVec2::splat(v).into(); output } - fn test(_self: Ref, index: usize) { + /// Tests the value at `index`. + /// Panics if `index` is greater than 1. + fn test(_self: Ref, index: usize) -> bool { let output: bool = bevy::math::BVec2::test(&_self, index).into(); output } @@ -9058,56 +13209,68 @@ impl bevy::math::BVec2 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::BVec3 { - fn all(_self: Val) { + /// Returns true if all the elements are true, false otherwise. + fn all(_self: Val) -> bool { let output: bool = bevy::math::BVec3::all(_self.into_inner()).into(); output } - fn any(_self: Val) { + /// Returns true if any of the elements are true, false otherwise. + fn any(_self: Val) -> bool { let output: bool = bevy::math::BVec3::any(_self.into_inner()).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn bitmask(_self: Val) { + /// Returns a bitmask with the lowest 3 bits set from the elements of `self`. + /// A true element results in a `1` bit and a false element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn bitmask(_self: Val) -> u32 { let output: u32 = bevy::math::BVec3::bitmask(_self.into_inner()).into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn from_array(a: [bool; 3]) { + /// Creates a new vector mask from a bool array. + fn from_array(a: [bool; 3]) -> Val { let output: Val = bevy::math::BVec3::from_array(a).into(); output } - fn new(x: bool, y: bool, z: bool) { + /// Creates a new vector mask. + fn new(x: bool, y: bool, z: bool) -> Val { let output: Val = bevy::math::BVec3::new(x, y, z).into(); output } - fn set(mut _self: Mut, index: usize, value: bool) { + /// Sets the element at `index`. + /// Panics if `index` is greater than 2. + fn set(mut _self: Mut, index: usize, value: bool) -> () { let output: () = bevy::math::BVec3::set(&mut _self, index, value).into(); output } - fn splat(v: bool) { + /// Creates a vector mask with all elements set to `v`. + fn splat(v: bool) -> Val { let output: Val = bevy::math::BVec3::splat(v).into(); output } - fn test(_self: Ref, index: usize) { + /// Tests the value at `index`. + /// Panics if `index` is greater than 2. + fn test(_self: Ref, index: usize) -> bool { let output: bool = bevy::math::BVec3::test(&_self, index).into(); output } @@ -9118,56 +13281,68 @@ impl bevy::math::BVec3 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::BVec4 { - fn all(_self: Val) { + /// Returns true if all the elements are true, false otherwise. + fn all(_self: Val) -> bool { let output: bool = bevy::math::BVec4::all(_self.into_inner()).into(); output } - fn any(_self: Val) { + /// Returns true if any of the elements are true, false otherwise. + fn any(_self: Val) -> bool { let output: bool = bevy::math::BVec4::any(_self.into_inner()).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn bitmask(_self: Val) { + /// Returns a bitmask with the lowest 4 bits set from the elements of `self`. + /// A true element results in a `1` bit and a false element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn bitmask(_self: Val) -> u32 { let output: u32 = bevy::math::BVec4::bitmask(_self.into_inner()).into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn from_array(a: [bool; 4]) { + /// Creates a new vector mask from a bool array. + fn from_array(a: [bool; 4]) -> Val { let output: Val = bevy::math::BVec4::from_array(a).into(); output } - fn new(x: bool, y: bool, z: bool, w: bool) { + /// Creates a new vector mask. + fn new(x: bool, y: bool, z: bool, w: bool) -> Val { let output: Val = bevy::math::BVec4::new(x, y, z, w).into(); output } - fn set(mut _self: Mut, index: usize, value: bool) { + /// Sets the element at `index`. + /// Panics if `index` is greater than 3. + fn set(mut _self: Mut, index: usize, value: bool) -> () { let output: () = bevy::math::BVec4::set(&mut _self, index, value).into(); output } - fn splat(v: bool) { + /// Creates a vector mask with all elements set to `v`. + fn splat(v: bool) -> Val { let output: Val = bevy::math::BVec4::splat(v).into(); output } - fn test(_self: Ref, index: usize) { + /// Tests the value at `index`. + /// Panics if `index` is greater than 3. + fn test(_self: Ref, index: usize) -> bool { let output: bool = bevy::math::BVec4::test(&_self, index).into(); output } @@ -9178,16 +13353,24 @@ impl bevy::math::BVec4 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::DVec2 { - fn abs(_self: Val) { + /// Returns a vector containing the absolute value of each element of `self`. + fn abs(_self: Val) -> Val { let output: Val = bevy::math::DVec2::abs(_self.into_inner()) .into(); output } + /// Returns true if the absolute difference of all elements between `self` and `rhs` is + /// less than or equal to `max_abs_diff`. + /// This can be used to compare if two vectors contain similar elements. It works best when + /// comparing with a known value. The `max_abs_diff` that should be used used depends on + /// the values being compared against. + /// For more see + /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). fn abs_diff_eq( _self: Val, rhs: Val, max_abs_diff: f64, - ) { + ) -> bool { let output: bool = bevy::math::DVec2::abs_diff_eq( _self.into_inner(), rhs.into_inner(), @@ -9196,28 +13379,34 @@ impl bevy::math::DVec2 { .into(); output } - fn add(_self: Val, rhs: Ref) { + fn add( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::add(_self.into_inner(), &rhs) .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add(_self: Val, rhs: f64) { + fn add(_self: Val, rhs: f64) -> Val { let output: Val = >::add(_self.into_inner(), rhs) .into(); output } - fn angle_between(_self: Val, rhs: Val) { + fn angle_between(_self: Val, rhs: Val) -> f64 { let output: f64 = bevy::math::DVec2::angle_between( _self.into_inner(), rhs.into_inner(), @@ -9225,7 +13414,9 @@ impl bevy::math::DVec2 { .into(); output } - fn angle_to(_self: Val, rhs: Val) { + /// Returns the angle of rotation (in radians) from `self` to `rhs` in the range `[-π, +π]`. + /// The inputs do not need to be unit vectors however they must be non-zero. + fn angle_to(_self: Val, rhs: Val) -> f64 { let output: f64 = bevy::math::DVec2::angle_to( _self.into_inner(), rhs.into_inner(), @@ -9233,38 +13424,49 @@ impl bevy::math::DVec2 { .into(); output } - fn as_i64vec2(_self: Ref) { + /// Casts all elements of `self` to `i64`. + fn as_i64vec2(_self: Ref) -> Val { let output: Val = bevy::math::DVec2::as_i64vec2(&_self) .into(); output } - fn as_ivec2(_self: Ref) { + /// Casts all elements of `self` to `i32`. + fn as_ivec2(_self: Ref) -> Val { let output: Val = bevy::math::DVec2::as_ivec2(&_self).into(); output } - fn as_u64vec2(_self: Ref) { + /// Casts all elements of `self` to `u64`. + fn as_u64vec2(_self: Ref) -> Val { let output: Val = bevy::math::DVec2::as_u64vec2(&_self) .into(); output } - fn as_uvec2(_self: Ref) { + /// Casts all elements of `self` to `u32`. + fn as_uvec2(_self: Ref) -> Val { let output: Val = bevy::math::DVec2::as_uvec2(&_self).into(); output } - fn as_vec2(_self: Ref) { + /// Casts all elements of `self` to `f32`. + fn as_vec2(_self: Ref) -> Val { let output: Val = bevy::math::DVec2::as_vec2(&_self).into(); output } - fn ceil(_self: Val) { + /// Returns a vector containing the smallest integer greater than or equal to a number for + /// each element of `self`. + fn ceil(_self: Val) -> Val { let output: Val = bevy::math::DVec2::ceil(_self.into_inner()) .into(); output } + /// Component-wise clamping of values, similar to [`f64::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( _self: Val, min: Val, max: Val, - ) { + ) -> Val { let output: Val = bevy::math::DVec2::clamp( _self.into_inner(), min.into_inner(), @@ -9273,7 +13475,14 @@ impl bevy::math::DVec2 { .into(); output } - fn clamp_length(_self: Val, min: f64, max: f64) { + /// Returns a vector with a length no less than `min` and no more than `max`. + /// # Panics + /// Will panic if `min` is greater than `max`, or if either `min` or `max` is negative, when `glam_assert` is enabled. + fn clamp_length( + _self: Val, + min: f64, + max: f64, + ) -> Val { let output: Val = bevy::math::DVec2::clamp_length( _self.into_inner(), min, @@ -9282,7 +13491,13 @@ impl bevy::math::DVec2 { .into(); output } - fn clamp_length_max(_self: Val, max: f64) { + /// Returns a vector with a length no more than `max`. + /// # Panics + /// Will panic if `max` is negative when `glam_assert` is enabled. + fn clamp_length_max( + _self: Val, + max: f64, + ) -> Val { let output: Val = bevy::math::DVec2::clamp_length_max( _self.into_inner(), max, @@ -9290,7 +13505,13 @@ impl bevy::math::DVec2 { .into(); output } - fn clamp_length_min(_self: Val, min: f64) { + /// Returns a vector with a length no less than `min`. + /// # Panics + /// Will panic if `min` is negative when `glam_assert` is enabled. + fn clamp_length_min( + _self: Val, + min: f64, + ) -> Val { let output: Val = bevy::math::DVec2::clamp_length_min( _self.into_inner(), min, @@ -9298,14 +13519,21 @@ impl bevy::math::DVec2 { .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn cmpeq(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec2::cmpeq( _self.into_inner(), rhs.into_inner(), @@ -9313,7 +13541,14 @@ impl bevy::math::DVec2 { .into(); output } - fn cmpge(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec2::cmpge( _self.into_inner(), rhs.into_inner(), @@ -9321,7 +13556,14 @@ impl bevy::math::DVec2 { .into(); output } - fn cmpgt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec2::cmpgt( _self.into_inner(), rhs.into_inner(), @@ -9329,7 +13571,14 @@ impl bevy::math::DVec2 { .into(); output } - fn cmple(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec2::cmple( _self.into_inner(), rhs.into_inner(), @@ -9337,7 +13586,14 @@ impl bevy::math::DVec2 { .into(); output } - fn cmplt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec2::cmplt( _self.into_inner(), rhs.into_inner(), @@ -9345,7 +13601,14 @@ impl bevy::math::DVec2 { .into(); output } - fn cmpne(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec2::cmpne( _self.into_inner(), rhs.into_inner(), @@ -9353,7 +13616,11 @@ impl bevy::math::DVec2 { .into(); output } - fn copysign(_self: Val, rhs: Val) { + /// Returns a vector with signs of `rhs` and the magnitudes of `self`. + fn copysign( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec2::copysign( _self.into_inner(), rhs.into_inner(), @@ -9361,7 +13628,8 @@ impl bevy::math::DVec2 { .into(); output } - fn distance(_self: Val, rhs: Val) { + /// Computes the Euclidean distance between two points in space. + fn distance(_self: Val, rhs: Val) -> f64 { let output: f64 = bevy::math::DVec2::distance( _self.into_inner(), rhs.into_inner(), @@ -9369,7 +13637,11 @@ impl bevy::math::DVec2 { .into(); output } - fn distance_squared(_self: Val, rhs: Val) { + /// Compute the squared euclidean distance between two points in space. + fn distance_squared( + _self: Val, + rhs: Val, + ) -> f64 { let output: f64 = bevy::math::DVec2::distance_squared( _self.into_inner(), rhs.into_inner(), @@ -9377,28 +13649,38 @@ impl bevy::math::DVec2 { .into(); output } - fn div(_self: Val, rhs: Ref) { + fn div( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::div(_self.into_inner(), &rhs) .into(); output } - fn div(_self: Val, rhs: Val) { + fn div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::div(_self.into_inner(), rhs.into_inner()) .into(); output } - fn div(_self: Val, rhs: f64) { + fn div(_self: Val, rhs: f64) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn div_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. + fn div_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec2::div_euclid( _self.into_inner(), rhs.into_inner(), @@ -9406,12 +13688,17 @@ impl bevy::math::DVec2 { .into(); output } - fn dot(_self: Val, rhs: Val) { + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> f64 { let output: f64 = bevy::math::DVec2::dot(_self.into_inner(), rhs.into_inner()) .into(); output } - fn dot_into_vec(_self: Val, rhs: Val) { + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec2::dot_into_vec( _self.into_inner(), rhs.into_inner(), @@ -9419,27 +13706,34 @@ impl bevy::math::DVec2 { .into(); output } - fn element_product(_self: Val) { + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> f64 { let output: f64 = bevy::math::DVec2::element_product(_self.into_inner()).into(); output } - fn element_sum(_self: Val) { + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> f64 { let output: f64 = bevy::math::DVec2::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn exp(_self: Val) { + /// Returns a vector containing `e^self` (the exponential function) for each element of + /// `self`. + fn exp(_self: Val) -> Val { let output: Val = bevy::math::DVec2::exp(_self.into_inner()) .into(); output } - fn extend(_self: Val, z: f64) { + /// Creates a 3D vector from `self` and the given `z` value. + fn extend(_self: Val, z: f64) -> Val { let output: Val = bevy::math::DVec2::extend( _self.into_inner(), z, @@ -9447,75 +13741,115 @@ impl bevy::math::DVec2 { .into(); output } - fn floor(_self: Val) { + /// Returns a vector containing the largest integer less than or equal to a number for each + /// element of `self`. + fn floor(_self: Val) -> Val { let output: Val = bevy::math::DVec2::floor(_self.into_inner()) .into(); output } - fn fract(_self: Val) { + /// Returns a vector containing the fractional part of the vector as `self - self.trunc()`. + /// Note that this differs from the GLSL implementation of `fract` which returns + /// `self - self.floor()`. + /// Note that this is fast but not precise for large numbers. + fn fract(_self: Val) -> Val { let output: Val = bevy::math::DVec2::fract(_self.into_inner()) .into(); output } - fn fract_gl(_self: Val) { + /// Returns a vector containing the fractional part of the vector as `self - self.floor()`. + /// Note that this differs from the Rust implementation of `fract` which returns + /// `self - self.trunc()`. + /// Note that this is fast but not precise for large numbers. + fn fract_gl(_self: Val) -> Val { let output: Val = bevy::math::DVec2::fract_gl( _self.into_inner(), ) .into(); output } - fn from_angle(angle: f64) { + /// Creates a 2D vector containing `[angle.cos(), angle.sin()]`. This can be used in + /// conjunction with the [`rotate()`][Self::rotate()] method, e.g. + /// `DVec2::from_angle(PI).rotate(DVec2::Y)` will create the vector `[-1, 0]` + /// and rotate [`DVec2::Y`] around it returning `-DVec2::Y`. + fn from_angle(angle: f64) -> Val { let output: Val = bevy::math::DVec2::from_angle(angle).into(); output } - fn from_array(a: [f64; 2]) { + /// Creates a new vector from an array. + fn from_array(a: [f64; 2]) -> Val { let output: Val = bevy::math::DVec2::from_array(a).into(); output } - fn is_finite(_self: Val) { + /// Returns `true` if, and only if, all elements are finite. If any element is either + /// `NaN`, positive or negative infinity, this will return `false`. + fn is_finite(_self: Val) -> bool { let output: bool = bevy::math::DVec2::is_finite(_self.into_inner()).into(); output } - fn is_finite_mask(_self: Val) { + /// Performs `is_finite` on each element of self, returning a vector mask of the results. + /// In other words, this computes `[x.is_finite(), y.is_finite(), ...]`. + fn is_finite_mask(_self: Val) -> Val { let output: Val = bevy::math::DVec2::is_finite_mask( _self.into_inner(), ) .into(); output } - fn is_nan(_self: Val) { + /// Returns `true` if any elements are `NaN`. + fn is_nan(_self: Val) -> bool { let output: bool = bevy::math::DVec2::is_nan(_self.into_inner()).into(); output } - fn is_nan_mask(_self: Val) { + /// Performs `is_nan` on each element of self, returning a vector mask of the results. + /// In other words, this computes `[x.is_nan(), y.is_nan(), ...]`. + fn is_nan_mask(_self: Val) -> Val { let output: Val = bevy::math::DVec2::is_nan_mask( _self.into_inner(), ) .into(); output } - fn is_negative_bitmask(_self: Val) { + /// Returns a bitmask with the lowest 2 bits set to the sign bits from the elements of `self`. + /// A negative element results in a `1` bit and a positive element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn is_negative_bitmask(_self: Val) -> u32 { let output: u32 = bevy::math::DVec2::is_negative_bitmask(_self.into_inner()) .into(); output } - fn is_normalized(_self: Val) { + /// Returns whether `self` is length `1.0` or not. + /// Uses a precision threshold of approximately `1e-4`. + fn is_normalized(_self: Val) -> bool { let output: bool = bevy::math::DVec2::is_normalized(_self.into_inner()).into(); output } - fn length(_self: Val) { + /// Computes the length of `self`. + fn length(_self: Val) -> f64 { let output: f64 = bevy::math::DVec2::length(_self.into_inner()).into(); output } - fn length_recip(_self: Val) { + /// Computes `1.0 / length()`. + /// For valid results, `self` must _not_ be of length zero. + fn length_recip(_self: Val) -> f64 { let output: f64 = bevy::math::DVec2::length_recip(_self.into_inner()).into(); output } - fn length_squared(_self: Val) { + /// Computes the squared length of `self`. + /// This is faster than `length()` as it avoids a square root operation. + fn length_squared(_self: Val) -> f64 { let output: f64 = bevy::math::DVec2::length_squared(_self.into_inner()).into(); output } - fn lerp(_self: Val, rhs: Val, s: f64) { + /// Performs a linear interpolation between `self` and `rhs` based on the value `s`. + /// When `s` is `0.0`, the result will be equal to `self`. When `s` is `1.0`, the result + /// will be equal to `rhs`. When `s` is outside of range `[0, 1]`, the result is linearly + /// extrapolated. + fn lerp( + _self: Val, + rhs: Val, + s: f64, + ) -> Val { let output: Val = bevy::math::DVec2::lerp( _self.into_inner(), rhs.into_inner(), @@ -9524,7 +13858,12 @@ impl bevy::math::DVec2 { .into(); output } - fn max(_self: Val, rhs: Val) { + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec2::max( _self.into_inner(), rhs.into_inner(), @@ -9532,11 +13871,20 @@ impl bevy::math::DVec2 { .into(); output } - fn max_element(_self: Val) { + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> f64 { let output: f64 = bevy::math::DVec2::max_element(_self.into_inner()).into(); output } - fn midpoint(_self: Val, rhs: Val) { + /// Calculates the midpoint between `self` and `rhs`. + /// The midpoint is the average of, or halfway point between, two vectors. + /// `a.midpoint(b)` should yield the same result as `a.lerp(b, 0.5)` + /// while being slightly cheaper to compute. + fn midpoint( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec2::midpoint( _self.into_inner(), rhs.into_inner(), @@ -9544,7 +13892,12 @@ impl bevy::math::DVec2 { .into(); output } - fn min(_self: Val, rhs: Val) { + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec2::min( _self.into_inner(), rhs.into_inner(), @@ -9552,11 +13905,20 @@ impl bevy::math::DVec2 { .into(); output } - fn min_element(_self: Val) { + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> f64 { let output: f64 = bevy::math::DVec2::min_element(_self.into_inner()).into(); output } - fn move_towards(_self: Ref, rhs: Val, d: f64) { + /// Moves towards `rhs` based on the value `d`. + /// When `d` is `0.0`, the result will be equal to `self`. When `d` is equal to + /// `self.distance(rhs)`, the result will be equal to `rhs`. Will not go past `rhs`. + fn move_towards( + _self: Ref, + rhs: Val, + d: f64, + ) -> Val { let output: Val = bevy::math::DVec2::move_towards( &_self, rhs.into_inner(), @@ -9565,32 +13927,44 @@ impl bevy::math::DVec2 { .into(); output } - fn mul(_self: Val, rhs: Ref) { + fn mul( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::mul(_self.into_inner(), &rhs) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: f64) { + fn mul(_self: Val, rhs: f64) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } + /// Fused multiply-add. Computes `(self * a) + b` element-wise with only one rounding + /// error, yielding a more accurate result than an unfused multiply-add. + /// Using `mul_add` *may* be more performant than an unfused multiply-add if the target + /// architecture has a dedicated fma CPU instruction. However, this is not always true, + /// and will be heavily dependant on designing algorithms with specific target hardware in + /// mind. fn mul_add( _self: Val, a: Val, b: Val, - ) { + ) -> Val { let output: Val = bevy::math::DVec2::mul_add( _self.into_inner(), a.into_inner(), @@ -9599,25 +13973,39 @@ impl bevy::math::DVec2 { .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } - fn new(x: f64, y: f64) { + /// Creates a new vector. + fn new(x: f64, y: f64) -> Val { let output: Val = bevy::math::DVec2::new(x, y).into(); output } - fn normalize(_self: Val) { + /// Returns `self` normalized to length 1.0. + /// For valid results, `self` must be finite and _not_ of length zero, nor very close to zero. + /// See also [`Self::try_normalize()`] and [`Self::normalize_or_zero()`]. + /// Panics + /// Will panic if the resulting normalized vector is not finite when `glam_assert` is enabled. + fn normalize(_self: Val) -> Val { let output: Val = bevy::math::DVec2::normalize( _self.into_inner(), ) .into(); output } - fn normalize_or(_self: Val, fallback: Val) { + /// Returns `self` normalized to length 1.0 if possible, else returns a + /// fallback value. + /// In particular, if the input is zero (or very close to zero), or non-finite, + /// the result of this operation will be the fallback value. + /// See also [`Self::try_normalize()`]. + fn normalize_or( + _self: Val, + fallback: Val, + ) -> Val { let output: Val = bevy::math::DVec2::normalize_or( _self.into_inner(), fallback.into_inner(), @@ -9625,19 +14013,26 @@ impl bevy::math::DVec2 { .into(); output } - fn normalize_or_zero(_self: Val) { + /// Returns `self` normalized to length 1.0 if possible, else returns zero. + /// In particular, if the input is zero (or very close to zero), or non-finite, + /// the result of this operation will be zero. + /// See also [`Self::try_normalize()`]. + fn normalize_or_zero(_self: Val) -> Val { let output: Val = bevy::math::DVec2::normalize_or_zero( _self.into_inner(), ) .into(); output } - fn perp(_self: Val) { + /// Returns a vector that is equal to `self` rotated by 90 degrees. + fn perp(_self: Val) -> Val { let output: Val = bevy::math::DVec2::perp(_self.into_inner()) .into(); output } - fn perp_dot(_self: Val, rhs: Val) { + /// The perpendicular dot product of `self` and `rhs`. + /// Also known as the wedge product, 2D cross product, and determinant. + fn perp_dot(_self: Val, rhs: Val) -> f64 { let output: f64 = bevy::math::DVec2::perp_dot( _self.into_inner(), rhs.into_inner(), @@ -9645,7 +14040,8 @@ impl bevy::math::DVec2 { .into(); output } - fn powf(_self: Val, n: f64) { + /// Returns a vector containing each element of `self` raised to the power of `n`. + fn powf(_self: Val, n: f64) -> Val { let output: Val = bevy::math::DVec2::powf( _self.into_inner(), n, @@ -9653,7 +14049,14 @@ impl bevy::math::DVec2 { .into(); output } - fn project_onto(_self: Val, rhs: Val) { + /// Returns the vector projection of `self` onto `rhs`. + /// `rhs` must be of non-zero length. + /// # Panics + /// Will panic if `rhs` is zero length when `glam_assert` is enabled. + fn project_onto( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec2::project_onto( _self.into_inner(), rhs.into_inner(), @@ -9661,10 +14064,14 @@ impl bevy::math::DVec2 { .into(); output } + /// Returns the vector projection of `self` onto `rhs`. + /// `rhs` must be normalized. + /// # Panics + /// Will panic if `rhs` is not normalized when `glam_assert` is enabled. fn project_onto_normalized( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::DVec2::project_onto_normalized( _self.into_inner(), rhs.into_inner(), @@ -9672,12 +14079,21 @@ impl bevy::math::DVec2 { .into(); output } - fn recip(_self: Val) { + /// Returns a vector containing the reciprocal `1.0/n` of each element of `self`. + fn recip(_self: Val) -> Val { let output: Val = bevy::math::DVec2::recip(_self.into_inner()) .into(); output } - fn reflect(_self: Val, normal: Val) { + /// Returns the reflection vector for a given incident vector `self` and surface normal + /// `normal`. + /// `normal` must be normalized. + /// # Panics + /// Will panic if `normal` is not normalized when `glam_assert` is enabled. + fn reflect( + _self: Val, + normal: Val, + ) -> Val { let output: Val = bevy::math::DVec2::reflect( _self.into_inner(), normal.into_inner(), @@ -9685,7 +14101,17 @@ impl bevy::math::DVec2 { .into(); output } - fn refract(_self: Val, normal: Val, eta: f64) { + /// Returns the refraction direction for a given incident vector `self`, surface normal + /// `normal` and ratio of indices of refraction, `eta`. When total internal reflection occurs, + /// a zero vector will be returned. + /// `self` and `normal` must be normalized. + /// # Panics + /// Will panic if `self` or `normal` is not normalized when `glam_assert` is enabled. + fn refract( + _self: Val, + normal: Val, + eta: f64, + ) -> Val { let output: Val = bevy::math::DVec2::refract( _self.into_inner(), normal.into_inner(), @@ -9694,7 +14120,16 @@ impl bevy::math::DVec2 { .into(); output } - fn reject_from(_self: Val, rhs: Val) { + /// Returns the vector rejection of `self` from `rhs`. + /// The vector rejection is the vector perpendicular to the projection of `self` onto + /// `rhs`, in rhs words the result of `self - self.project_onto(rhs)`. + /// `rhs` must be of non-zero length. + /// # Panics + /// Will panic if `rhs` has a length of zero when `glam_assert` is enabled. + fn reject_from( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec2::reject_from( _self.into_inner(), rhs.into_inner(), @@ -9702,10 +14137,16 @@ impl bevy::math::DVec2 { .into(); output } + /// Returns the vector rejection of `self` from `rhs`. + /// The vector rejection is the vector perpendicular to the projection of `self` onto + /// `rhs`, in rhs words the result of `self - self.project_onto(rhs)`. + /// `rhs` must be normalized. + /// # Panics + /// Will panic if `rhs` is not normalized when `glam_assert` is enabled. fn reject_from_normalized( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::DVec2::reject_from_normalized( _self.into_inner(), rhs.into_inner(), @@ -9713,28 +14154,39 @@ impl bevy::math::DVec2 { .into(); output } - fn rem(_self: Val, rhs: Ref) { + fn rem( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::rem(_self.into_inner(), &rhs) .into(); output } - fn rem(_self: Val, rhs: Val) { + fn rem( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) .into(); output } - fn rem(_self: Val, rhs: f64) { + fn rem(_self: Val, rhs: f64) -> Val { let output: Val = >::rem(_self.into_inner(), rhs) .into(); output } - fn rem_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. + /// [Euclidean division]: f64::rem_euclid + fn rem_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec2::rem_euclid( _self.into_inner(), rhs.into_inner(), @@ -9742,7 +14194,13 @@ impl bevy::math::DVec2 { .into(); output } - fn rotate(_self: Val, rhs: Val) { + /// Returns `rhs` rotated by the angle of `self`. If `self` is normalized, + /// then this just rotation. This is what you usually want. Otherwise, + /// it will be like a rotation with a multiplication by `self`'s length. + fn rotate( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec2::rotate( _self.into_inner(), rhs.into_inner(), @@ -9750,11 +14208,15 @@ impl bevy::math::DVec2 { .into(); output } + /// Rotates towards `rhs` up to `max_angle` (in radians). + /// When `max_angle` is `0.0`, the result will be equal to `self`. When `max_angle` is equal to + /// `self.angle_between(rhs)`, the result will be equal to `rhs`. If `max_angle` is negative, + /// rotates towards the exact opposite of `rhs`. Will not go past the target. fn rotate_towards( _self: Ref, rhs: Val, max_angle: f64, - ) { + ) -> Val { let output: Val = bevy::math::DVec2::rotate_towards( &_self, rhs.into_inner(), @@ -9763,16 +14225,22 @@ impl bevy::math::DVec2 { .into(); output } - fn round(_self: Val) { + /// Returns a vector containing the nearest integer to a number for each element of `self`. + /// Round half-way cases away from 0.0. + fn round(_self: Val) -> Val { let output: Val = bevy::math::DVec2::round(_self.into_inner()) .into(); output } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. fn select( mask: Val, if_true: Val, if_false: Val, - ) { + ) -> Val { let output: Val = bevy::math::DVec2::select( mask.into_inner(), if_true.into_inner(), @@ -9781,52 +14249,69 @@ impl bevy::math::DVec2 { .into(); output } - fn signum(_self: Val) { + /// Returns a vector with elements representing the sign of `self`. + /// - `1.0` if the number is positive, `+0.0` or `INFINITY` + /// - `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY` + /// - `NAN` if the number is `NAN` + fn signum(_self: Val) -> Val { let output: Val = bevy::math::DVec2::signum( _self.into_inner(), ) .into(); output } - fn splat(v: f64) { + /// Creates a vector with all elements set to `v`. + fn splat(v: f64) -> Val { let output: Val = bevy::math::DVec2::splat(v).into(); output } - fn sub(_self: Val, rhs: Ref) { + fn sub( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::sub(_self.into_inner(), &rhs) .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub(_self: Val, rhs: f64) { + fn sub(_self: Val, rhs: f64) -> Val { let output: Val = >::sub(_self.into_inner(), rhs) .into(); output } - fn to_angle(_self: Val) { + /// Returns the angle (in radians) of this vector in the range `[-π, +π]`. + /// The input does not need to be a unit vector however it must be non-zero. + fn to_angle(_self: Val) -> f64 { let output: f64 = bevy::math::DVec2::to_angle(_self.into_inner()).into(); output } - fn to_array(_self: Ref) { + /// `[x, y]` + fn to_array(_self: Ref) -> [f64; 2] { let output: [f64; 2] = bevy::math::DVec2::to_array(&_self).into(); output } - fn trunc(_self: Val) { + /// Returns a vector containing the integer part each element of `self`. This means numbers are + /// always truncated towards zero. + fn trunc(_self: Val) -> Val { let output: Val = bevy::math::DVec2::trunc(_self.into_inner()) .into(); output } - fn with_x(_self: Val, x: f64) { + /// Creates a 2D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: f64) -> Val { let output: Val = bevy::math::DVec2::with_x( _self.into_inner(), x, @@ -9834,7 +14319,8 @@ impl bevy::math::DVec2 { .into(); output } - fn with_y(_self: Val, y: f64) { + /// Creates a 2D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: f64) -> Val { let output: Val = bevy::math::DVec2::with_y( _self.into_inner(), y, @@ -9849,16 +14335,24 @@ impl bevy::math::DVec2 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::DVec3 { - fn abs(_self: Val) { + /// Returns a vector containing the absolute value of each element of `self`. + fn abs(_self: Val) -> Val { let output: Val = bevy::math::DVec3::abs(_self.into_inner()) .into(); output } + /// Returns true if the absolute difference of all elements between `self` and `rhs` is + /// less than or equal to `max_abs_diff`. + /// This can be used to compare if two vectors contain similar elements. It works best when + /// comparing with a known value. The `max_abs_diff` that should be used used depends on + /// the values being compared against. + /// For more see + /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). fn abs_diff_eq( _self: Val, rhs: Val, max_abs_diff: f64, - ) { + ) -> bool { let output: bool = bevy::math::DVec3::abs_diff_eq( _self.into_inner(), rhs.into_inner(), @@ -9867,28 +14361,36 @@ impl bevy::math::DVec3 { .into(); output } - fn add(_self: Val, rhs: Ref) { + fn add( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::add(_self.into_inner(), &rhs) .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add(_self: Val, rhs: f64) { + fn add(_self: Val, rhs: f64) -> Val { let output: Val = >::add(_self.into_inner(), rhs) .into(); output } - fn angle_between(_self: Val, rhs: Val) { + /// Returns the angle (in radians) between two vectors in the range `[0, +π]`. + /// The inputs do not need to be unit vectors however they must be non-zero. + fn angle_between(_self: Val, rhs: Val) -> f64 { let output: f64 = bevy::math::DVec3::angle_between( _self.into_inner(), rhs.into_inner(), @@ -9896,56 +14398,76 @@ impl bevy::math::DVec3 { .into(); output } - fn any_orthogonal_vector(_self: Ref) { + /// Returns some vector that is orthogonal to the given one. + /// The input vector must be finite and non-zero. + /// The output vector is not necessarily unit length. For that use + /// [`Self::any_orthonormal_vector()`] instead. + fn any_orthogonal_vector(_self: Ref) -> Val { let output: Val = bevy::math::DVec3::any_orthogonal_vector( &_self, ) .into(); output } - fn any_orthonormal_vector(_self: Ref) { + /// Returns any unit vector that is orthogonal to the given one. + /// The input vector must be unit length. + /// # Panics + /// Will panic if `self` is not normalized when `glam_assert` is enabled. + fn any_orthonormal_vector(_self: Ref) -> Val { let output: Val = bevy::math::DVec3::any_orthonormal_vector( &_self, ) .into(); output } - fn as_i64vec3(_self: Ref) { + /// Casts all elements of `self` to `i64`. + fn as_i64vec3(_self: Ref) -> Val { let output: Val = bevy::math::DVec3::as_i64vec3(&_self) .into(); output } - fn as_ivec3(_self: Ref) { + /// Casts all elements of `self` to `i32`. + fn as_ivec3(_self: Ref) -> Val { let output: Val = bevy::math::DVec3::as_ivec3(&_self).into(); output } - fn as_u64vec3(_self: Ref) { + /// Casts all elements of `self` to `u64`. + fn as_u64vec3(_self: Ref) -> Val { let output: Val = bevy::math::DVec3::as_u64vec3(&_self) .into(); output } - fn as_uvec3(_self: Ref) { + /// Casts all elements of `self` to `u32`. + fn as_uvec3(_self: Ref) -> Val { let output: Val = bevy::math::DVec3::as_uvec3(&_self).into(); output } - fn as_vec3(_self: Ref) { + /// Casts all elements of `self` to `f32`. + fn as_vec3(_self: Ref) -> Val { let output: Val = bevy::math::DVec3::as_vec3(&_self).into(); output } - fn as_vec3a(_self: Ref) { + /// Casts all elements of `self` to `f32`. + fn as_vec3a(_self: Ref) -> Val { let output: Val = bevy::math::DVec3::as_vec3a(&_self).into(); output } - fn ceil(_self: Val) { + /// Returns a vector containing the smallest integer greater than or equal to a number for + /// each element of `self`. + fn ceil(_self: Val) -> Val { let output: Val = bevy::math::DVec3::ceil(_self.into_inner()) .into(); output } + /// Component-wise clamping of values, similar to [`f64::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( _self: Val, min: Val, max: Val, - ) { + ) -> Val { let output: Val = bevy::math::DVec3::clamp( _self.into_inner(), min.into_inner(), @@ -9954,7 +14476,14 @@ impl bevy::math::DVec3 { .into(); output } - fn clamp_length(_self: Val, min: f64, max: f64) { + /// Returns a vector with a length no less than `min` and no more than `max`. + /// # Panics + /// Will panic if `min` is greater than `max`, or if either `min` or `max` is negative, when `glam_assert` is enabled. + fn clamp_length( + _self: Val, + min: f64, + max: f64, + ) -> Val { let output: Val = bevy::math::DVec3::clamp_length( _self.into_inner(), min, @@ -9963,7 +14492,13 @@ impl bevy::math::DVec3 { .into(); output } - fn clamp_length_max(_self: Val, max: f64) { + /// Returns a vector with a length no more than `max`. + /// # Panics + /// Will panic if `max` is negative when `glam_assert` is enabled. + fn clamp_length_max( + _self: Val, + max: f64, + ) -> Val { let output: Val = bevy::math::DVec3::clamp_length_max( _self.into_inner(), max, @@ -9971,7 +14506,13 @@ impl bevy::math::DVec3 { .into(); output } - fn clamp_length_min(_self: Val, min: f64) { + /// Returns a vector with a length no less than `min`. + /// # Panics + /// Will panic if `min` is negative when `glam_assert` is enabled. + fn clamp_length_min( + _self: Val, + min: f64, + ) -> Val { let output: Val = bevy::math::DVec3::clamp_length_min( _self.into_inner(), min, @@ -9979,14 +14520,21 @@ impl bevy::math::DVec3 { .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn cmpeq(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec3::cmpeq( _self.into_inner(), rhs.into_inner(), @@ -9994,7 +14542,14 @@ impl bevy::math::DVec3 { .into(); output } - fn cmpge(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec3::cmpge( _self.into_inner(), rhs.into_inner(), @@ -10002,7 +14557,14 @@ impl bevy::math::DVec3 { .into(); output } - fn cmpgt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec3::cmpgt( _self.into_inner(), rhs.into_inner(), @@ -10010,7 +14572,14 @@ impl bevy::math::DVec3 { .into(); output } - fn cmple(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec3::cmple( _self.into_inner(), rhs.into_inner(), @@ -10018,7 +14587,14 @@ impl bevy::math::DVec3 { .into(); output } - fn cmplt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec3::cmplt( _self.into_inner(), rhs.into_inner(), @@ -10026,7 +14602,14 @@ impl bevy::math::DVec3 { .into(); output } - fn cmpne(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec3::cmpne( _self.into_inner(), rhs.into_inner(), @@ -10034,7 +14617,11 @@ impl bevy::math::DVec3 { .into(); output } - fn copysign(_self: Val, rhs: Val) { + /// Returns a vector with signs of `rhs` and the magnitudes of `self`. + fn copysign( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec3::copysign( _self.into_inner(), rhs.into_inner(), @@ -10042,7 +14629,11 @@ impl bevy::math::DVec3 { .into(); output } - fn cross(_self: Val, rhs: Val) { + /// Computes the cross product of `self` and `rhs`. + fn cross( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec3::cross( _self.into_inner(), rhs.into_inner(), @@ -10050,7 +14641,8 @@ impl bevy::math::DVec3 { .into(); output } - fn distance(_self: Val, rhs: Val) { + /// Computes the Euclidean distance between two points in space. + fn distance(_self: Val, rhs: Val) -> f64 { let output: f64 = bevy::math::DVec3::distance( _self.into_inner(), rhs.into_inner(), @@ -10058,7 +14650,11 @@ impl bevy::math::DVec3 { .into(); output } - fn distance_squared(_self: Val, rhs: Val) { + /// Compute the squared euclidean distance between two points in space. + fn distance_squared( + _self: Val, + rhs: Val, + ) -> f64 { let output: f64 = bevy::math::DVec3::distance_squared( _self.into_inner(), rhs.into_inner(), @@ -10066,28 +14662,38 @@ impl bevy::math::DVec3 { .into(); output } - fn div(_self: Val, rhs: Ref) { + fn div( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::div(_self.into_inner(), &rhs) .into(); output } - fn div(_self: Val, rhs: Val) { + fn div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::div(_self.into_inner(), rhs.into_inner()) .into(); output } - fn div(_self: Val, rhs: f64) { + fn div(_self: Val, rhs: f64) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn div_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. + fn div_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec3::div_euclid( _self.into_inner(), rhs.into_inner(), @@ -10095,12 +14701,17 @@ impl bevy::math::DVec3 { .into(); output } - fn dot(_self: Val, rhs: Val) { + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> f64 { let output: f64 = bevy::math::DVec3::dot(_self.into_inner(), rhs.into_inner()) .into(); output } - fn dot_into_vec(_self: Val, rhs: Val) { + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec3::dot_into_vec( _self.into_inner(), rhs.into_inner(), @@ -10108,27 +14719,34 @@ impl bevy::math::DVec3 { .into(); output } - fn element_product(_self: Val) { + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> f64 { let output: f64 = bevy::math::DVec3::element_product(_self.into_inner()).into(); output } - fn element_sum(_self: Val) { + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> f64 { let output: f64 = bevy::math::DVec3::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn exp(_self: Val) { + /// Returns a vector containing `e^self` (the exponential function) for each element of + /// `self`. + fn exp(_self: Val) -> Val { let output: Val = bevy::math::DVec3::exp(_self.into_inner()) .into(); output } - fn extend(_self: Val, w: f64) { + /// Creates a 4D vector from `self` and the given `w` value. + fn extend(_self: Val, w: f64) -> Val { let output: Val = bevy::math::DVec3::extend( _self.into_inner(), w, @@ -10136,71 +14754,107 @@ impl bevy::math::DVec3 { .into(); output } - fn floor(_self: Val) { + /// Returns a vector containing the largest integer less than or equal to a number for each + /// element of `self`. + fn floor(_self: Val) -> Val { let output: Val = bevy::math::DVec3::floor(_self.into_inner()) .into(); output } - fn fract(_self: Val) { + /// Returns a vector containing the fractional part of the vector as `self - self.trunc()`. + /// Note that this differs from the GLSL implementation of `fract` which returns + /// `self - self.floor()`. + /// Note that this is fast but not precise for large numbers. + fn fract(_self: Val) -> Val { let output: Val = bevy::math::DVec3::fract(_self.into_inner()) .into(); output } - fn fract_gl(_self: Val) { + /// Returns a vector containing the fractional part of the vector as `self - self.floor()`. + /// Note that this differs from the Rust implementation of `fract` which returns + /// `self - self.trunc()`. + /// Note that this is fast but not precise for large numbers. + fn fract_gl(_self: Val) -> Val { let output: Val = bevy::math::DVec3::fract_gl( _self.into_inner(), ) .into(); output } - fn from_array(a: [f64; 3]) { + /// Creates a new vector from an array. + fn from_array(a: [f64; 3]) -> Val { let output: Val = bevy::math::DVec3::from_array(a).into(); output } - fn is_finite(_self: Val) { + /// Returns `true` if, and only if, all elements are finite. If any element is either + /// `NaN`, positive or negative infinity, this will return `false`. + fn is_finite(_self: Val) -> bool { let output: bool = bevy::math::DVec3::is_finite(_self.into_inner()).into(); output } - fn is_finite_mask(_self: Val) { + /// Performs `is_finite` on each element of self, returning a vector mask of the results. + /// In other words, this computes `[x.is_finite(), y.is_finite(), ...]`. + fn is_finite_mask(_self: Val) -> Val { let output: Val = bevy::math::DVec3::is_finite_mask( _self.into_inner(), ) .into(); output } - fn is_nan(_self: Val) { + /// Returns `true` if any elements are `NaN`. + fn is_nan(_self: Val) -> bool { let output: bool = bevy::math::DVec3::is_nan(_self.into_inner()).into(); output } - fn is_nan_mask(_self: Val) { + /// Performs `is_nan` on each element of self, returning a vector mask of the results. + /// In other words, this computes `[x.is_nan(), y.is_nan(), ...]`. + fn is_nan_mask(_self: Val) -> Val { let output: Val = bevy::math::DVec3::is_nan_mask( _self.into_inner(), ) .into(); output } - fn is_negative_bitmask(_self: Val) { + /// Returns a bitmask with the lowest 3 bits set to the sign bits from the elements of `self`. + /// A negative element results in a `1` bit and a positive element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn is_negative_bitmask(_self: Val) -> u32 { let output: u32 = bevy::math::DVec3::is_negative_bitmask(_self.into_inner()) .into(); output } - fn is_normalized(_self: Val) { + /// Returns whether `self` is length `1.0` or not. + /// Uses a precision threshold of approximately `1e-4`. + fn is_normalized(_self: Val) -> bool { let output: bool = bevy::math::DVec3::is_normalized(_self.into_inner()).into(); output } - fn length(_self: Val) { + /// Computes the length of `self`. + fn length(_self: Val) -> f64 { let output: f64 = bevy::math::DVec3::length(_self.into_inner()).into(); output } - fn length_recip(_self: Val) { + /// Computes `1.0 / length()`. + /// For valid results, `self` must _not_ be of length zero. + fn length_recip(_self: Val) -> f64 { let output: f64 = bevy::math::DVec3::length_recip(_self.into_inner()).into(); output } - fn length_squared(_self: Val) { + /// Computes the squared length of `self`. + /// This is faster than `length()` as it avoids a square root operation. + fn length_squared(_self: Val) -> f64 { let output: f64 = bevy::math::DVec3::length_squared(_self.into_inner()).into(); output } - fn lerp(_self: Val, rhs: Val, s: f64) { + /// Performs a linear interpolation between `self` and `rhs` based on the value `s`. + /// When `s` is `0.0`, the result will be equal to `self`. When `s` is `1.0`, the result + /// will be equal to `rhs`. When `s` is outside of range `[0, 1]`, the result is linearly + /// extrapolated. + fn lerp( + _self: Val, + rhs: Val, + s: f64, + ) -> Val { let output: Val = bevy::math::DVec3::lerp( _self.into_inner(), rhs.into_inner(), @@ -10209,7 +14863,12 @@ impl bevy::math::DVec3 { .into(); output } - fn max(_self: Val, rhs: Val) { + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec3::max( _self.into_inner(), rhs.into_inner(), @@ -10217,11 +14876,20 @@ impl bevy::math::DVec3 { .into(); output } - fn max_element(_self: Val) { + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> f64 { let output: f64 = bevy::math::DVec3::max_element(_self.into_inner()).into(); output } - fn midpoint(_self: Val, rhs: Val) { + /// Calculates the midpoint between `self` and `rhs`. + /// The midpoint is the average of, or halfway point between, two vectors. + /// `a.midpoint(b)` should yield the same result as `a.lerp(b, 0.5)` + /// while being slightly cheaper to compute. + fn midpoint( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec3::midpoint( _self.into_inner(), rhs.into_inner(), @@ -10229,7 +14897,12 @@ impl bevy::math::DVec3 { .into(); output } - fn min(_self: Val, rhs: Val) { + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec3::min( _self.into_inner(), rhs.into_inner(), @@ -10237,11 +14910,20 @@ impl bevy::math::DVec3 { .into(); output } - fn min_element(_self: Val) { + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> f64 { let output: f64 = bevy::math::DVec3::min_element(_self.into_inner()).into(); output } - fn move_towards(_self: Ref, rhs: Val, d: f64) { + /// Moves towards `rhs` based on the value `d`. + /// When `d` is `0.0`, the result will be equal to `self`. When `d` is equal to + /// `self.distance(rhs)`, the result will be equal to `rhs`. Will not go past `rhs`. + fn move_towards( + _self: Ref, + rhs: Val, + d: f64, + ) -> Val { let output: Val = bevy::math::DVec3::move_towards( &_self, rhs.into_inner(), @@ -10250,32 +14932,44 @@ impl bevy::math::DVec3 { .into(); output } - fn mul(_self: Val, rhs: Ref) { + fn mul( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::mul(_self.into_inner(), &rhs) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: f64) { + fn mul(_self: Val, rhs: f64) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } + /// Fused multiply-add. Computes `(self * a) + b` element-wise with only one rounding + /// error, yielding a more accurate result than an unfused multiply-add. + /// Using `mul_add` *may* be more performant than an unfused multiply-add if the target + /// architecture has a dedicated fma CPU instruction. However, this is not always true, + /// and will be heavily dependant on designing algorithms with specific target hardware in + /// mind. fn mul_add( _self: Val, a: Val, b: Val, - ) { + ) -> Val { let output: Val = bevy::math::DVec3::mul_add( _self.into_inner(), a.into_inner(), @@ -10284,25 +14978,39 @@ impl bevy::math::DVec3 { .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } - fn new(x: f64, y: f64, z: f64) { + /// Creates a new vector. + fn new(x: f64, y: f64, z: f64) -> Val { let output: Val = bevy::math::DVec3::new(x, y, z).into(); output } - fn normalize(_self: Val) { + /// Returns `self` normalized to length 1.0. + /// For valid results, `self` must be finite and _not_ of length zero, nor very close to zero. + /// See also [`Self::try_normalize()`] and [`Self::normalize_or_zero()`]. + /// Panics + /// Will panic if the resulting normalized vector is not finite when `glam_assert` is enabled. + fn normalize(_self: Val) -> Val { let output: Val = bevy::math::DVec3::normalize( _self.into_inner(), ) .into(); output } - fn normalize_or(_self: Val, fallback: Val) { + /// Returns `self` normalized to length 1.0 if possible, else returns a + /// fallback value. + /// In particular, if the input is zero (or very close to zero), or non-finite, + /// the result of this operation will be the fallback value. + /// See also [`Self::try_normalize()`]. + fn normalize_or( + _self: Val, + fallback: Val, + ) -> Val { let output: Val = bevy::math::DVec3::normalize_or( _self.into_inner(), fallback.into_inner(), @@ -10310,14 +15018,19 @@ impl bevy::math::DVec3 { .into(); output } - fn normalize_or_zero(_self: Val) { + /// Returns `self` normalized to length 1.0 if possible, else returns zero. + /// In particular, if the input is zero (or very close to zero), or non-finite, + /// the result of this operation will be zero. + /// See also [`Self::try_normalize()`]. + fn normalize_or_zero(_self: Val) -> Val { let output: Val = bevy::math::DVec3::normalize_or_zero( _self.into_inner(), ) .into(); output } - fn powf(_self: Val, n: f64) { + /// Returns a vector containing each element of `self` raised to the power of `n`. + fn powf(_self: Val, n: f64) -> Val { let output: Val = bevy::math::DVec3::powf( _self.into_inner(), n, @@ -10325,7 +15038,14 @@ impl bevy::math::DVec3 { .into(); output } - fn project_onto(_self: Val, rhs: Val) { + /// Returns the vector projection of `self` onto `rhs`. + /// `rhs` must be of non-zero length. + /// # Panics + /// Will panic if `rhs` is zero length when `glam_assert` is enabled. + fn project_onto( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec3::project_onto( _self.into_inner(), rhs.into_inner(), @@ -10333,10 +15053,14 @@ impl bevy::math::DVec3 { .into(); output } + /// Returns the vector projection of `self` onto `rhs`. + /// `rhs` must be normalized. + /// # Panics + /// Will panic if `rhs` is not normalized when `glam_assert` is enabled. fn project_onto_normalized( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::DVec3::project_onto_normalized( _self.into_inner(), rhs.into_inner(), @@ -10344,12 +15068,21 @@ impl bevy::math::DVec3 { .into(); output } - fn recip(_self: Val) { + /// Returns a vector containing the reciprocal `1.0/n` of each element of `self`. + fn recip(_self: Val) -> Val { let output: Val = bevy::math::DVec3::recip(_self.into_inner()) .into(); output } - fn reflect(_self: Val, normal: Val) { + /// Returns the reflection vector for a given incident vector `self` and surface normal + /// `normal`. + /// `normal` must be normalized. + /// # Panics + /// Will panic if `normal` is not normalized when `glam_assert` is enabled. + fn reflect( + _self: Val, + normal: Val, + ) -> Val { let output: Val = bevy::math::DVec3::reflect( _self.into_inner(), normal.into_inner(), @@ -10357,7 +15090,17 @@ impl bevy::math::DVec3 { .into(); output } - fn refract(_self: Val, normal: Val, eta: f64) { + /// Returns the refraction direction for a given incident vector `self`, surface normal + /// `normal` and ratio of indices of refraction, `eta`. When total internal reflection occurs, + /// a zero vector will be returned. + /// `self` and `normal` must be normalized. + /// # Panics + /// Will panic if `self` or `normal` is not normalized when `glam_assert` is enabled. + fn refract( + _self: Val, + normal: Val, + eta: f64, + ) -> Val { let output: Val = bevy::math::DVec3::refract( _self.into_inner(), normal.into_inner(), @@ -10366,7 +15109,16 @@ impl bevy::math::DVec3 { .into(); output } - fn reject_from(_self: Val, rhs: Val) { + /// Returns the vector rejection of `self` from `rhs`. + /// The vector rejection is the vector perpendicular to the projection of `self` onto + /// `rhs`, in rhs words the result of `self - self.project_onto(rhs)`. + /// `rhs` must be of non-zero length. + /// # Panics + /// Will panic if `rhs` has a length of zero when `glam_assert` is enabled. + fn reject_from( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec3::reject_from( _self.into_inner(), rhs.into_inner(), @@ -10374,10 +15126,16 @@ impl bevy::math::DVec3 { .into(); output } + /// Returns the vector rejection of `self` from `rhs`. + /// The vector rejection is the vector perpendicular to the projection of `self` onto + /// `rhs`, in rhs words the result of `self - self.project_onto(rhs)`. + /// `rhs` must be normalized. + /// # Panics + /// Will panic if `rhs` is not normalized when `glam_assert` is enabled. fn reject_from_normalized( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::DVec3::reject_from_normalized( _self.into_inner(), rhs.into_inner(), @@ -10385,28 +15143,39 @@ impl bevy::math::DVec3 { .into(); output } - fn rem(_self: Val, rhs: Ref) { + fn rem( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::rem(_self.into_inner(), &rhs) .into(); output } - fn rem(_self: Val, rhs: Val) { + fn rem( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) .into(); output } - fn rem(_self: Val, rhs: f64) { + fn rem(_self: Val, rhs: f64) -> Val { let output: Val = >::rem(_self.into_inner(), rhs) .into(); output } - fn rem_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. + /// [Euclidean division]: f64::rem_euclid + fn rem_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec3::rem_euclid( _self.into_inner(), rhs.into_inner(), @@ -10414,16 +15183,22 @@ impl bevy::math::DVec3 { .into(); output } - fn round(_self: Val) { + /// Returns a vector containing the nearest integer to a number for each element of `self`. + /// Round half-way cases away from 0.0. + fn round(_self: Val) -> Val { let output: Val = bevy::math::DVec3::round(_self.into_inner()) .into(); output } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. fn select( mask: Val, if_true: Val, if_false: Val, - ) { + ) -> Val { let output: Val = bevy::math::DVec3::select( mask.into_inner(), if_true.into_inner(), @@ -10432,55 +15207,72 @@ impl bevy::math::DVec3 { .into(); output } - fn signum(_self: Val) { + /// Returns a vector with elements representing the sign of `self`. + /// - `1.0` if the number is positive, `+0.0` or `INFINITY` + /// - `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY` + /// - `NAN` if the number is `NAN` + fn signum(_self: Val) -> Val { let output: Val = bevy::math::DVec3::signum( _self.into_inner(), ) .into(); output } - fn splat(v: f64) { + /// Creates a vector with all elements set to `v`. + fn splat(v: f64) -> Val { let output: Val = bevy::math::DVec3::splat(v).into(); output } - fn sub(_self: Val, rhs: Ref) { + fn sub( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::sub(_self.into_inner(), &rhs) .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub(_self: Val, rhs: f64) { + fn sub(_self: Val, rhs: f64) -> Val { let output: Val = >::sub(_self.into_inner(), rhs) .into(); output } - fn to_array(_self: Ref) { + /// `[x, y, z]` + fn to_array(_self: Ref) -> [f64; 3] { let output: [f64; 3] = bevy::math::DVec3::to_array(&_self).into(); output } - fn trunc(_self: Val) { + /// Returns a vector containing the integer part each element of `self`. This means numbers are + /// always truncated towards zero. + fn trunc(_self: Val) -> Val { let output: Val = bevy::math::DVec3::trunc(_self.into_inner()) .into(); output } - fn truncate(_self: Val) { + /// Creates a 2D vector from the `x` and `y` elements of `self`, discarding `z`. + /// Truncation may also be performed by using [`self.xy()`][crate::swizzles::Vec3Swizzles::xy()]. + fn truncate(_self: Val) -> Val { let output: Val = bevy::math::DVec3::truncate( _self.into_inner(), ) .into(); output } - fn with_x(_self: Val, x: f64) { + /// Creates a 3D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: f64) -> Val { let output: Val = bevy::math::DVec3::with_x( _self.into_inner(), x, @@ -10488,7 +15280,8 @@ impl bevy::math::DVec3 { .into(); output } - fn with_y(_self: Val, y: f64) { + /// Creates a 3D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: f64) -> Val { let output: Val = bevy::math::DVec3::with_y( _self.into_inner(), y, @@ -10496,7 +15289,8 @@ impl bevy::math::DVec3 { .into(); output } - fn with_z(_self: Val, z: f64) { + /// Creates a 3D vector from `self` with the given value of `z`. + fn with_z(_self: Val, z: f64) -> Val { let output: Val = bevy::math::DVec3::with_z( _self.into_inner(), z, @@ -10511,16 +15305,24 @@ impl bevy::math::DVec3 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::DVec4 { - fn abs(_self: Val) { + /// Returns a vector containing the absolute value of each element of `self`. + fn abs(_self: Val) -> Val { let output: Val = bevy::math::DVec4::abs(_self.into_inner()) .into(); output } + /// Returns true if the absolute difference of all elements between `self` and `rhs` is + /// less than or equal to `max_abs_diff`. + /// This can be used to compare if two vectors contain similar elements. It works best when + /// comparing with a known value. The `max_abs_diff` that should be used used depends on + /// the values being compared against. + /// For more see + /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). fn abs_diff_eq( _self: Val, rhs: Val, max_abs_diff: f64, - ) { + ) -> bool { let output: bool = bevy::math::DVec4::abs_diff_eq( _self.into_inner(), rhs.into_inner(), @@ -10529,59 +15331,76 @@ impl bevy::math::DVec4 { .into(); output } - fn add(_self: Val, rhs: Ref) { + fn add( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::add(_self.into_inner(), &rhs) .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add(_self: Val, rhs: f64) { + fn add(_self: Val, rhs: f64) -> Val { let output: Val = >::add(_self.into_inner(), rhs) .into(); output } - fn as_i64vec4(_self: Ref) { + /// Casts all elements of `self` to `i64`. + fn as_i64vec4(_self: Ref) -> Val { let output: Val = bevy::math::DVec4::as_i64vec4(&_self) .into(); output } - fn as_ivec4(_self: Ref) { + /// Casts all elements of `self` to `i32`. + fn as_ivec4(_self: Ref) -> Val { let output: Val = bevy::math::DVec4::as_ivec4(&_self).into(); output } - fn as_u64vec4(_self: Ref) { + /// Casts all elements of `self` to `u64`. + fn as_u64vec4(_self: Ref) -> Val { let output: Val = bevy::math::DVec4::as_u64vec4(&_self) .into(); output } - fn as_uvec4(_self: Ref) { + /// Casts all elements of `self` to `u32`. + fn as_uvec4(_self: Ref) -> Val { let output: Val = bevy::math::DVec4::as_uvec4(&_self).into(); output } - fn as_vec4(_self: Ref) { + /// Casts all elements of `self` to `f32`. + fn as_vec4(_self: Ref) -> Val { let output: Val = bevy::math::DVec4::as_vec4(&_self).into(); output } - fn ceil(_self: Val) { + /// Returns a vector containing the smallest integer greater than or equal to a number for + /// each element of `self`. + fn ceil(_self: Val) -> Val { let output: Val = bevy::math::DVec4::ceil(_self.into_inner()) .into(); output } + /// Component-wise clamping of values, similar to [`f64::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( _self: Val, min: Val, max: Val, - ) { + ) -> Val { let output: Val = bevy::math::DVec4::clamp( _self.into_inner(), min.into_inner(), @@ -10590,7 +15409,14 @@ impl bevy::math::DVec4 { .into(); output } - fn clamp_length(_self: Val, min: f64, max: f64) { + /// Returns a vector with a length no less than `min` and no more than `max`. + /// # Panics + /// Will panic if `min` is greater than `max`, or if either `min` or `max` is negative, when `glam_assert` is enabled. + fn clamp_length( + _self: Val, + min: f64, + max: f64, + ) -> Val { let output: Val = bevy::math::DVec4::clamp_length( _self.into_inner(), min, @@ -10599,7 +15425,13 @@ impl bevy::math::DVec4 { .into(); output } - fn clamp_length_max(_self: Val, max: f64) { + /// Returns a vector with a length no more than `max`. + /// # Panics + /// Will panic if `max` is negative when `glam_assert` is enabled. + fn clamp_length_max( + _self: Val, + max: f64, + ) -> Val { let output: Val = bevy::math::DVec4::clamp_length_max( _self.into_inner(), max, @@ -10607,7 +15439,13 @@ impl bevy::math::DVec4 { .into(); output } - fn clamp_length_min(_self: Val, min: f64) { + /// Returns a vector with a length no less than `min`. + /// # Panics + /// Will panic if `min` is negative when `glam_assert` is enabled. + fn clamp_length_min( + _self: Val, + min: f64, + ) -> Val { let output: Val = bevy::math::DVec4::clamp_length_min( _self.into_inner(), min, @@ -10615,14 +15453,21 @@ impl bevy::math::DVec4 { .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn cmpeq(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec4::cmpeq( _self.into_inner(), rhs.into_inner(), @@ -10630,7 +15475,14 @@ impl bevy::math::DVec4 { .into(); output } - fn cmpge(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec4::cmpge( _self.into_inner(), rhs.into_inner(), @@ -10638,7 +15490,14 @@ impl bevy::math::DVec4 { .into(); output } - fn cmpgt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec4::cmpgt( _self.into_inner(), rhs.into_inner(), @@ -10646,7 +15505,14 @@ impl bevy::math::DVec4 { .into(); output } - fn cmple(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec4::cmple( _self.into_inner(), rhs.into_inner(), @@ -10654,7 +15520,14 @@ impl bevy::math::DVec4 { .into(); output } - fn cmplt(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec4::cmplt( _self.into_inner(), rhs.into_inner(), @@ -10662,7 +15535,14 @@ impl bevy::math::DVec4 { .into(); output } - fn cmpne(_self: Val, rhs: Val) { + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec4::cmpne( _self.into_inner(), rhs.into_inner(), @@ -10670,7 +15550,11 @@ impl bevy::math::DVec4 { .into(); output } - fn copysign(_self: Val, rhs: Val) { + /// Returns a vector with signs of `rhs` and the magnitudes of `self`. + fn copysign( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec4::copysign( _self.into_inner(), rhs.into_inner(), @@ -10678,7 +15562,8 @@ impl bevy::math::DVec4 { .into(); output } - fn distance(_self: Val, rhs: Val) { + /// Computes the Euclidean distance between two points in space. + fn distance(_self: Val, rhs: Val) -> f64 { let output: f64 = bevy::math::DVec4::distance( _self.into_inner(), rhs.into_inner(), @@ -10686,7 +15571,11 @@ impl bevy::math::DVec4 { .into(); output } - fn distance_squared(_self: Val, rhs: Val) { + /// Compute the squared euclidean distance between two points in space. + fn distance_squared( + _self: Val, + rhs: Val, + ) -> f64 { let output: f64 = bevy::math::DVec4::distance_squared( _self.into_inner(), rhs.into_inner(), @@ -10694,28 +15583,38 @@ impl bevy::math::DVec4 { .into(); output } - fn div(_self: Val, rhs: Ref) { + fn div( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::div(_self.into_inner(), &rhs) .into(); output } - fn div(_self: Val, rhs: Val) { + fn div( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::div(_self.into_inner(), rhs.into_inner()) .into(); output } - fn div(_self: Val, rhs: f64) { + fn div(_self: Val, rhs: f64) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn div_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. + fn div_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec4::div_euclid( _self.into_inner(), rhs.into_inner(), @@ -10723,12 +15622,17 @@ impl bevy::math::DVec4 { .into(); output } - fn dot(_self: Val, rhs: Val) { + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> f64 { let output: f64 = bevy::math::DVec4::dot(_self.into_inner(), rhs.into_inner()) .into(); output } - fn dot_into_vec(_self: Val, rhs: Val) { + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec4::dot_into_vec( _self.into_inner(), rhs.into_inner(), @@ -10736,91 +15640,133 @@ impl bevy::math::DVec4 { .into(); output } - fn element_product(_self: Val) { + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> f64 { let output: f64 = bevy::math::DVec4::element_product(_self.into_inner()).into(); output } - fn element_sum(_self: Val) { + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> f64 { let output: f64 = bevy::math::DVec4::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn exp(_self: Val) { + /// Returns a vector containing `e^self` (the exponential function) for each element of + /// `self`. + fn exp(_self: Val) -> Val { let output: Val = bevy::math::DVec4::exp(_self.into_inner()) .into(); output } - fn floor(_self: Val) { + /// Returns a vector containing the largest integer less than or equal to a number for each + /// element of `self`. + fn floor(_self: Val) -> Val { let output: Val = bevy::math::DVec4::floor(_self.into_inner()) .into(); output } - fn fract(_self: Val) { + /// Returns a vector containing the fractional part of the vector as `self - self.trunc()`. + /// Note that this differs from the GLSL implementation of `fract` which returns + /// `self - self.floor()`. + /// Note that this is fast but not precise for large numbers. + fn fract(_self: Val) -> Val { let output: Val = bevy::math::DVec4::fract(_self.into_inner()) .into(); output } - fn fract_gl(_self: Val) { + /// Returns a vector containing the fractional part of the vector as `self - self.floor()`. + /// Note that this differs from the Rust implementation of `fract` which returns + /// `self - self.trunc()`. + /// Note that this is fast but not precise for large numbers. + fn fract_gl(_self: Val) -> Val { let output: Val = bevy::math::DVec4::fract_gl( _self.into_inner(), ) .into(); output } - fn from_array(a: [f64; 4]) { + /// Creates a new vector from an array. + fn from_array(a: [f64; 4]) -> Val { let output: Val = bevy::math::DVec4::from_array(a).into(); output } - fn is_finite(_self: Val) { + /// Returns `true` if, and only if, all elements are finite. If any element is either + /// `NaN`, positive or negative infinity, this will return `false`. + fn is_finite(_self: Val) -> bool { let output: bool = bevy::math::DVec4::is_finite(_self.into_inner()).into(); output } - fn is_finite_mask(_self: Val) { + /// Performs `is_finite` on each element of self, returning a vector mask of the results. + /// In other words, this computes `[x.is_finite(), y.is_finite(), ...]`. + fn is_finite_mask(_self: Val) -> Val { let output: Val = bevy::math::DVec4::is_finite_mask( _self.into_inner(), ) .into(); output } - fn is_nan(_self: Val) { + /// Returns `true` if any elements are `NaN`. + fn is_nan(_self: Val) -> bool { let output: bool = bevy::math::DVec4::is_nan(_self.into_inner()).into(); output } - fn is_nan_mask(_self: Val) { + /// Performs `is_nan` on each element of self, returning a vector mask of the results. + /// In other words, this computes `[x.is_nan(), y.is_nan(), ...]`. + fn is_nan_mask(_self: Val) -> Val { let output: Val = bevy::math::DVec4::is_nan_mask( _self.into_inner(), ) .into(); output } - fn is_negative_bitmask(_self: Val) { + /// Returns a bitmask with the lowest 4 bits set to the sign bits from the elements of `self`. + /// A negative element results in a `1` bit and a positive element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn is_negative_bitmask(_self: Val) -> u32 { let output: u32 = bevy::math::DVec4::is_negative_bitmask(_self.into_inner()) .into(); output } - fn is_normalized(_self: Val) { + /// Returns whether `self` is length `1.0` or not. + /// Uses a precision threshold of approximately `1e-4`. + fn is_normalized(_self: Val) -> bool { let output: bool = bevy::math::DVec4::is_normalized(_self.into_inner()).into(); output } - fn length(_self: Val) { + /// Computes the length of `self`. + fn length(_self: Val) -> f64 { let output: f64 = bevy::math::DVec4::length(_self.into_inner()).into(); output } - fn length_recip(_self: Val) { + /// Computes `1.0 / length()`. + /// For valid results, `self` must _not_ be of length zero. + fn length_recip(_self: Val) -> f64 { let output: f64 = bevy::math::DVec4::length_recip(_self.into_inner()).into(); output } - fn length_squared(_self: Val) { + /// Computes the squared length of `self`. + /// This is faster than `length()` as it avoids a square root operation. + fn length_squared(_self: Val) -> f64 { let output: f64 = bevy::math::DVec4::length_squared(_self.into_inner()).into(); output } - fn lerp(_self: Val, rhs: Val, s: f64) { + /// Performs a linear interpolation between `self` and `rhs` based on the value `s`. + /// When `s` is `0.0`, the result will be equal to `self`. When `s` is `1.0`, the result + /// will be equal to `rhs`. When `s` is outside of range `[0, 1]`, the result is linearly + /// extrapolated. + fn lerp( + _self: Val, + rhs: Val, + s: f64, + ) -> Val { let output: Val = bevy::math::DVec4::lerp( _self.into_inner(), rhs.into_inner(), @@ -10829,7 +15775,12 @@ impl bevy::math::DVec4 { .into(); output } - fn max(_self: Val, rhs: Val) { + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec4::max( _self.into_inner(), rhs.into_inner(), @@ -10837,11 +15788,20 @@ impl bevy::math::DVec4 { .into(); output } - fn max_element(_self: Val) { + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> f64 { let output: f64 = bevy::math::DVec4::max_element(_self.into_inner()).into(); output } - fn midpoint(_self: Val, rhs: Val) { + /// Calculates the midpoint between `self` and `rhs`. + /// The midpoint is the average of, or halfway point between, two vectors. + /// `a.midpoint(b)` should yield the same result as `a.lerp(b, 0.5)` + /// while being slightly cheaper to compute. + fn midpoint( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec4::midpoint( _self.into_inner(), rhs.into_inner(), @@ -10849,7 +15809,12 @@ impl bevy::math::DVec4 { .into(); output } - fn min(_self: Val, rhs: Val) { + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec4::min( _self.into_inner(), rhs.into_inner(), @@ -10857,11 +15822,20 @@ impl bevy::math::DVec4 { .into(); output } - fn min_element(_self: Val) { + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> f64 { let output: f64 = bevy::math::DVec4::min_element(_self.into_inner()).into(); output } - fn move_towards(_self: Ref, rhs: Val, d: f64) { + /// Moves towards `rhs` based on the value `d`. + /// When `d` is `0.0`, the result will be equal to `self`. When `d` is equal to + /// `self.distance(rhs)`, the result will be equal to `rhs`. Will not go past `rhs`. + fn move_towards( + _self: Ref, + rhs: Val, + d: f64, + ) -> Val { let output: Val = bevy::math::DVec4::move_towards( &_self, rhs.into_inner(), @@ -10870,32 +15844,44 @@ impl bevy::math::DVec4 { .into(); output } - fn mul(_self: Val, rhs: Ref) { + fn mul( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::mul(_self.into_inner(), &rhs) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: f64) { + fn mul(_self: Val, rhs: f64) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } + /// Fused multiply-add. Computes `(self * a) + b` element-wise with only one rounding + /// error, yielding a more accurate result than an unfused multiply-add. + /// Using `mul_add` *may* be more performant than an unfused multiply-add if the target + /// architecture has a dedicated fma CPU instruction. However, this is not always true, + /// and will be heavily dependant on designing algorithms with specific target hardware in + /// mind. fn mul_add( _self: Val, a: Val, b: Val, - ) { + ) -> Val { let output: Val = bevy::math::DVec4::mul_add( _self.into_inner(), a.into_inner(), @@ -10904,25 +15890,39 @@ impl bevy::math::DVec4 { .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } - fn new(x: f64, y: f64, z: f64, w: f64) { + /// Creates a new vector. + fn new(x: f64, y: f64, z: f64, w: f64) -> Val { let output: Val = bevy::math::DVec4::new(x, y, z, w).into(); output } - fn normalize(_self: Val) { + /// Returns `self` normalized to length 1.0. + /// For valid results, `self` must be finite and _not_ of length zero, nor very close to zero. + /// See also [`Self::try_normalize()`] and [`Self::normalize_or_zero()`]. + /// Panics + /// Will panic if the resulting normalized vector is not finite when `glam_assert` is enabled. + fn normalize(_self: Val) -> Val { let output: Val = bevy::math::DVec4::normalize( _self.into_inner(), ) .into(); output } - fn normalize_or(_self: Val, fallback: Val) { + /// Returns `self` normalized to length 1.0 if possible, else returns a + /// fallback value. + /// In particular, if the input is zero (or very close to zero), or non-finite, + /// the result of this operation will be the fallback value. + /// See also [`Self::try_normalize()`]. + fn normalize_or( + _self: Val, + fallback: Val, + ) -> Val { let output: Val = bevy::math::DVec4::normalize_or( _self.into_inner(), fallback.into_inner(), @@ -10930,14 +15930,19 @@ impl bevy::math::DVec4 { .into(); output } - fn normalize_or_zero(_self: Val) { + /// Returns `self` normalized to length 1.0 if possible, else returns zero. + /// In particular, if the input is zero (or very close to zero), or non-finite, + /// the result of this operation will be zero. + /// See also [`Self::try_normalize()`]. + fn normalize_or_zero(_self: Val) -> Val { let output: Val = bevy::math::DVec4::normalize_or_zero( _self.into_inner(), ) .into(); output } - fn powf(_self: Val, n: f64) { + /// Returns a vector containing each element of `self` raised to the power of `n`. + fn powf(_self: Val, n: f64) -> Val { let output: Val = bevy::math::DVec4::powf( _self.into_inner(), n, @@ -10945,7 +15950,14 @@ impl bevy::math::DVec4 { .into(); output } - fn project_onto(_self: Val, rhs: Val) { + /// Returns the vector projection of `self` onto `rhs`. + /// `rhs` must be of non-zero length. + /// # Panics + /// Will panic if `rhs` is zero length when `glam_assert` is enabled. + fn project_onto( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec4::project_onto( _self.into_inner(), rhs.into_inner(), @@ -10953,10 +15965,14 @@ impl bevy::math::DVec4 { .into(); output } + /// Returns the vector projection of `self` onto `rhs`. + /// `rhs` must be normalized. + /// # Panics + /// Will panic if `rhs` is not normalized when `glam_assert` is enabled. fn project_onto_normalized( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::DVec4::project_onto_normalized( _self.into_inner(), rhs.into_inner(), @@ -10964,12 +15980,21 @@ impl bevy::math::DVec4 { .into(); output } - fn recip(_self: Val) { + /// Returns a vector containing the reciprocal `1.0/n` of each element of `self`. + fn recip(_self: Val) -> Val { let output: Val = bevy::math::DVec4::recip(_self.into_inner()) .into(); output } - fn reflect(_self: Val, normal: Val) { + /// Returns the reflection vector for a given incident vector `self` and surface normal + /// `normal`. + /// `normal` must be normalized. + /// # Panics + /// Will panic if `normal` is not normalized when `glam_assert` is enabled. + fn reflect( + _self: Val, + normal: Val, + ) -> Val { let output: Val = bevy::math::DVec4::reflect( _self.into_inner(), normal.into_inner(), @@ -10977,7 +16002,17 @@ impl bevy::math::DVec4 { .into(); output } - fn refract(_self: Val, normal: Val, eta: f64) { + /// Returns the refraction direction for a given incident vector `self`, surface normal + /// `normal` and ratio of indices of refraction, `eta`. When total internal reflection occurs, + /// a zero vector will be returned. + /// `self` and `normal` must be normalized. + /// # Panics + /// Will panic if `self` or `normal` is not normalized when `glam_assert` is enabled. + fn refract( + _self: Val, + normal: Val, + eta: f64, + ) -> Val { let output: Val = bevy::math::DVec4::refract( _self.into_inner(), normal.into_inner(), @@ -10986,7 +16021,16 @@ impl bevy::math::DVec4 { .into(); output } - fn reject_from(_self: Val, rhs: Val) { + /// Returns the vector rejection of `self` from `rhs`. + /// The vector rejection is the vector perpendicular to the projection of `self` onto + /// `rhs`, in rhs words the result of `self - self.project_onto(rhs)`. + /// `rhs` must be of non-zero length. + /// # Panics + /// Will panic if `rhs` has a length of zero when `glam_assert` is enabled. + fn reject_from( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec4::reject_from( _self.into_inner(), rhs.into_inner(), @@ -10994,10 +16038,16 @@ impl bevy::math::DVec4 { .into(); output } + /// Returns the vector rejection of `self` from `rhs`. + /// The vector rejection is the vector perpendicular to the projection of `self` onto + /// `rhs`, in rhs words the result of `self - self.project_onto(rhs)`. + /// `rhs` must be normalized. + /// # Panics + /// Will panic if `rhs` is not normalized when `glam_assert` is enabled. fn reject_from_normalized( _self: Val, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::DVec4::reject_from_normalized( _self.into_inner(), rhs.into_inner(), @@ -11005,28 +16055,39 @@ impl bevy::math::DVec4 { .into(); output } - fn rem(_self: Val, rhs: Ref) { + fn rem( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::rem(_self.into_inner(), &rhs) .into(); output } - fn rem(_self: Val, rhs: Val) { + fn rem( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) .into(); output } - fn rem(_self: Val, rhs: f64) { + fn rem(_self: Val, rhs: f64) -> Val { let output: Val = >::rem(_self.into_inner(), rhs) .into(); output } - fn rem_euclid(_self: Val, rhs: Val) { + /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. + /// [Euclidean division]: f64::rem_euclid + fn rem_euclid( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DVec4::rem_euclid( _self.into_inner(), rhs.into_inner(), @@ -11034,16 +16095,22 @@ impl bevy::math::DVec4 { .into(); output } - fn round(_self: Val) { + /// Returns a vector containing the nearest integer to a number for each element of `self`. + /// Round half-way cases away from 0.0. + fn round(_self: Val) -> Val { let output: Val = bevy::math::DVec4::round(_self.into_inner()) .into(); output } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. fn select( mask: Val, if_true: Val, if_false: Val, - ) { + ) -> Val { let output: Val = bevy::math::DVec4::select( mask.into_inner(), if_true.into_inner(), @@ -11052,55 +16119,72 @@ impl bevy::math::DVec4 { .into(); output } - fn signum(_self: Val) { + /// Returns a vector with elements representing the sign of `self`. + /// - `1.0` if the number is positive, `+0.0` or `INFINITY` + /// - `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY` + /// - `NAN` if the number is `NAN` + fn signum(_self: Val) -> Val { let output: Val = bevy::math::DVec4::signum( _self.into_inner(), ) .into(); output } - fn splat(v: f64) { + /// Creates a vector with all elements set to `v`. + fn splat(v: f64) -> Val { let output: Val = bevy::math::DVec4::splat(v).into(); output } - fn sub(_self: Val, rhs: Ref) { + fn sub( + _self: Val, + rhs: Ref, + ) -> Val { let output: Val = >::sub(_self.into_inner(), &rhs) .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub(_self: Val, rhs: f64) { + fn sub(_self: Val, rhs: f64) -> Val { let output: Val = >::sub(_self.into_inner(), rhs) .into(); output } - fn to_array(_self: Ref) { + /// `[x, y, z, w]` + fn to_array(_self: Ref) -> [f64; 4] { let output: [f64; 4] = bevy::math::DVec4::to_array(&_self).into(); output } - fn trunc(_self: Val) { + /// Returns a vector containing the integer part each element of `self`. This means numbers are + /// always truncated towards zero. + fn trunc(_self: Val) -> Val { let output: Val = bevy::math::DVec4::trunc(_self.into_inner()) .into(); output } - fn truncate(_self: Val) { + /// Creates a 3D vector from the `x`, `y` and `z` elements of `self`, discarding `w`. + /// Truncation to [`DVec3`] may also be performed by using [`self.xyz()`][crate::swizzles::Vec4Swizzles::xyz()]. + fn truncate(_self: Val) -> Val { let output: Val = bevy::math::DVec4::truncate( _self.into_inner(), ) .into(); output } - fn with_w(_self: Val, w: f64) { + /// Creates a 4D vector from `self` with the given value of `w`. + fn with_w(_self: Val, w: f64) -> Val { let output: Val = bevy::math::DVec4::with_w( _self.into_inner(), w, @@ -11108,7 +16192,8 @@ impl bevy::math::DVec4 { .into(); output } - fn with_x(_self: Val, x: f64) { + /// Creates a 4D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: f64) -> Val { let output: Val = bevy::math::DVec4::with_x( _self.into_inner(), x, @@ -11116,7 +16201,8 @@ impl bevy::math::DVec4 { .into(); output } - fn with_y(_self: Val, y: f64) { + /// Creates a 4D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: f64) -> Val { let output: Val = bevy::math::DVec4::with_y( _self.into_inner(), y, @@ -11124,7 +16210,8 @@ impl bevy::math::DVec4 { .into(); output } - fn with_z(_self: Val, z: f64) { + /// Creates a 4D vector from `self` with the given value of `z`. + fn with_z(_self: Val, z: f64) -> Val { let output: Val = bevy::math::DVec4::with_z( _self.into_inner(), z, @@ -11139,15 +16226,23 @@ impl bevy::math::DVec4 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::Mat2 { - fn abs(_self: Ref) { + /// Takes the absolute value of each element in `self` + fn abs(_self: Ref) -> Val { let output: Val = bevy::math::Mat2::abs(&_self).into(); output } + /// Returns true if the absolute difference of all elements between `self` and `rhs` + /// is less than or equal to `max_abs_diff`. + /// This can be used to compare if two matrices contain similar elements. It works best + /// when comparing with a known value. The `max_abs_diff` that should be used used + /// depends on the values being compared against. + /// For more see + /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). fn abs_diff_eq( _self: Ref, rhs: Val, max_abs_diff: f32, - ) { + ) -> bool { let output: bool = bevy::math::Mat2::abs_diff_eq( &_self, rhs.into_inner(), @@ -11156,61 +16251,78 @@ impl bevy::math::Mat2 { .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add_mat2(_self: Ref, rhs: Ref) { + /// Adds two 2x2 matrices. + fn add_mat2( + _self: Ref, + rhs: Ref, + ) -> Val { let output: Val = bevy::math::Mat2::add_mat2(&_self, &rhs) .into(); output } - fn as_dmat2(_self: Ref) { + fn as_dmat2(_self: Ref) -> Val { let output: Val = bevy::math::Mat2::as_dmat2(&_self).into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn col(_self: Ref, index: usize) { + /// Returns the matrix column for the given `index`. + /// # Panics + /// Panics if `index` is greater than 1. + fn col(_self: Ref, index: usize) -> Val { let output: Val = bevy::math::Mat2::col(&_self, index).into(); output } - fn determinant(_self: Ref) { + /// Returns the determinant of `self`. + fn determinant(_self: Ref) -> f32 { let output: f32 = bevy::math::Mat2::determinant(&_self).into(); output } - fn div(_self: Val, rhs: f32) { + fn div(_self: Val, rhs: f32) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn div_scalar(_self: Ref, rhs: f32) { + /// Divides a 2x2 matrix by a scalar. + fn div_scalar(_self: Ref, rhs: f32) -> Val { let output: Val = bevy::math::Mat2::div_scalar(&_self, rhs) .into(); output } - fn eq(_self: Ref, rhs: Ref) { + fn eq(_self: Ref, rhs: Ref) -> bool { let output: bool = >::eq(&_self, &rhs) .into(); output } - fn from_angle(angle: f32) { + /// Creates a 2x2 matrix containing a rotation of `angle` (in radians). + fn from_angle(angle: f32) -> Val { let output: Val = bevy::math::Mat2::from_angle(angle).into(); output } - fn from_cols(x_axis: Val, y_axis: Val) { + /// Creates a 2x2 matrix from two column vectors. + fn from_cols( + x_axis: Val, + y_axis: Val, + ) -> Val { let output: Val = bevy::math::Mat2::from_cols( x_axis.into_inner(), y_axis.into_inner(), @@ -11218,19 +16330,29 @@ impl bevy::math::Mat2 { .into(); output } - fn from_diagonal(diagonal: Val) { + /// Creates a 2x2 matrix with its diagonal set to `diagonal` and all other entries set to 0. + fn from_diagonal(diagonal: Val) -> Val { let output: Val = bevy::math::Mat2::from_diagonal( diagonal.into_inner(), ) .into(); output } - fn from_mat3(m: Val) { + /// Creates a 2x2 matrix from a 3x3 matrix, discarding the 2nd row and column. + fn from_mat3(m: Val) -> Val { let output: Val = bevy::math::Mat2::from_mat3(m.into_inner()) .into(); output } - fn from_mat3_minor(m: Val, i: usize, j: usize) { + /// Creates a 2x2 matrix from the minor of the given 3x3 matrix, discarding the `i`th column + /// and `j`th row. + /// # Panics + /// Panics if `i` or `j` is greater than 2. + fn from_mat3_minor( + m: Val, + i: usize, + j: usize, + ) -> Val { let output: Val = bevy::math::Mat2::from_mat3_minor( m.into_inner(), i, @@ -11239,12 +16361,21 @@ impl bevy::math::Mat2 { .into(); output } - fn from_mat3a(m: Val) { + /// Creates a 2x2 matrix from a 3x3 matrix, discarding the 2nd row and column. + fn from_mat3a(m: Val) -> Val { let output: Val = bevy::math::Mat2::from_mat3a(m.into_inner()) .into(); output } - fn from_mat3a_minor(m: Val, i: usize, j: usize) { + /// Creates a 2x2 matrix from the minor of the given 3x3 matrix, discarding the `i`th column + /// and `j`th row. + /// # Panics + /// Panics if `i` or `j` is greater than 2. + fn from_mat3a_minor( + m: Val, + i: usize, + j: usize, + ) -> Val { let output: Val = bevy::math::Mat2::from_mat3a_minor( m.into_inner(), i, @@ -11253,7 +16384,12 @@ impl bevy::math::Mat2 { .into(); output } - fn from_scale_angle(scale: Val, angle: f32) { + /// Creates a 2x2 matrix containing the combining non-uniform `scale` and rotation of + /// `angle` (in radians). + fn from_scale_angle( + scale: Val, + angle: f32, + ) -> Val { let output: Val = bevy::math::Mat2::from_scale_angle( scale.into_inner(), angle, @@ -11261,50 +16397,72 @@ impl bevy::math::Mat2 { .into(); output } - fn inverse(_self: Ref) { + /// Returns the inverse of `self`. + /// If the matrix is not invertible the returned matrix will be invalid. + /// # Panics + /// Will panic if the determinant of `self` is zero when `glam_assert` is enabled. + fn inverse(_self: Ref) -> Val { let output: Val = bevy::math::Mat2::inverse(&_self).into(); output } - fn is_finite(_self: Ref) { + /// Returns `true` if, and only if, all elements are finite. + /// If any element is either `NaN`, positive or negative infinity, this will return `false`. + fn is_finite(_self: Ref) -> bool { let output: bool = bevy::math::Mat2::is_finite(&_self).into(); output } - fn is_nan(_self: Ref) { + /// Returns `true` if any elements are `NaN`. + fn is_nan(_self: Ref) -> bool { let output: bool = bevy::math::Mat2::is_nan(&_self).into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: f32) { + fn mul(_self: Val, rhs: f32) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn mul_mat2(_self: Ref, rhs: Ref) { + /// Multiplies two 2x2 matrices. + fn mul_mat2( + _self: Ref, + rhs: Ref, + ) -> Val { let output: Val = bevy::math::Mat2::mul_mat2(&_self, &rhs) .into(); output } - fn mul_scalar(_self: Ref, rhs: f32) { + /// Multiplies a 2x2 matrix by a scalar. + fn mul_scalar(_self: Ref, rhs: f32) -> Val { let output: Val = bevy::math::Mat2::mul_scalar(&_self, rhs) .into(); output } - fn mul_vec2(_self: Ref, rhs: Val) { + /// Transforms a 2D vector. + fn mul_vec2( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Mat2::mul_vec2( &_self, rhs.into_inner(), @@ -11312,38 +16470,53 @@ impl bevy::math::Mat2 { .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } - fn row(_self: Ref, index: usize) { + /// Returns the matrix row for the given `index`. + /// # Panics + /// Panics if `index` is greater than 1. + fn row(_self: Ref, index: usize) -> Val { let output: Val = bevy::math::Mat2::row(&_self, index).into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub_mat2(_self: Ref, rhs: Ref) { + /// Subtracts two 2x2 matrices. + fn sub_mat2( + _self: Ref, + rhs: Ref, + ) -> Val { let output: Val = bevy::math::Mat2::sub_mat2(&_self, &rhs) .into(); output } - fn to_cols_array(_self: Ref) { + /// Creates a `[f32; 4]` array storing data in column major order. + /// If you require data in row major order `transpose` the matrix first. + fn to_cols_array(_self: Ref) -> [f32; 4] { let output: [f32; 4] = bevy::math::Mat2::to_cols_array(&_self).into(); output } - fn to_cols_array_2d(_self: Ref) { + /// Creates a `[[f32; 2]; 2]` 2D array storing data in column major order. + /// If you require data in row major order `transpose` the matrix first. + fn to_cols_array_2d(_self: Ref) -> [[f32; 2]; 2] { let output: [[f32; 2]; 2] = bevy::math::Mat2::to_cols_array_2d(&_self).into(); output } - fn transpose(_self: Ref) { + /// Returns the transpose of `self`. + fn transpose(_self: Ref) -> Val { let output: Val = bevy::math::Mat2::transpose(&_self).into(); output } @@ -11354,15 +16527,23 @@ impl bevy::math::Mat2 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::Mat3 { - fn abs(_self: Ref) { + /// Takes the absolute value of each element in `self` + fn abs(_self: Ref) -> Val { let output: Val = bevy::math::Mat3::abs(&_self).into(); output } + /// Returns true if the absolute difference of all elements between `self` and `rhs` + /// is less than or equal to `max_abs_diff`. + /// This can be used to compare if two matrices contain similar elements. It works best + /// when comparing with a known value. The `max_abs_diff` that should be used used + /// depends on the values being compared against. + /// For more see + /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). fn abs_diff_eq( _self: Ref, rhs: Val, max_abs_diff: f32, - ) { + ) -> bool { let output: bool = bevy::math::Mat3::abs_diff_eq( &_self, rhs.into_inner(), @@ -11371,61 +16552,84 @@ impl bevy::math::Mat3 { .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add_mat3(_self: Ref, rhs: Ref) { + /// Adds two 3x3 matrices. + fn add_mat3( + _self: Ref, + rhs: Ref, + ) -> Val { let output: Val = bevy::math::Mat3::add_mat3(&_self, &rhs) .into(); output } - fn as_dmat3(_self: Ref) { + fn as_dmat3(_self: Ref) -> Val { let output: Val = bevy::math::Mat3::as_dmat3(&_self).into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn col(_self: Ref, index: usize) { + /// Returns the matrix column for the given `index`. + /// # Panics + /// Panics if `index` is greater than 2. + fn col(_self: Ref, index: usize) -> Val { let output: Val = bevy::math::Mat3::col(&_self, index).into(); output } - fn determinant(_self: Ref) { + /// Returns the determinant of `self`. + fn determinant(_self: Ref) -> f32 { let output: f32 = bevy::math::Mat3::determinant(&_self).into(); output } - fn div(_self: Val, rhs: f32) { + fn div(_self: Val, rhs: f32) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn div_scalar(_self: Ref, rhs: f32) { + /// Divides a 3x3 matrix by a scalar. + fn div_scalar(_self: Ref, rhs: f32) -> Val { let output: Val = bevy::math::Mat3::div_scalar(&_self, rhs) .into(); output } - fn eq(_self: Ref, rhs: Ref) { + fn eq(_self: Ref, rhs: Ref) -> bool { let output: bool = >::eq(&_self, &rhs) .into(); output } - fn from_angle(angle: f32) { + /// Creates an affine transformation matrix from the given 2D rotation `angle` (in + /// radians). + /// The resulting matrix can be used to transform 2D points and vectors. See + /// [`Self::transform_point2()`] and [`Self::transform_vector2()`]. + fn from_angle(angle: f32) -> Val { let output: Val = bevy::math::Mat3::from_angle(angle).into(); output } - fn from_axis_angle(axis: Val, angle: f32) { + /// Creates a 3D rotation matrix from a normalized rotation `axis` and `angle` (in + /// radians). + /// # Panics + /// Will panic if `axis` is not normalized when `glam_assert` is enabled. + fn from_axis_angle( + axis: Val, + angle: f32, + ) -> Val { let output: Val = bevy::math::Mat3::from_axis_angle( axis.into_inner(), angle, @@ -11433,11 +16637,12 @@ impl bevy::math::Mat3 { .into(); output } + /// Creates a 3x3 matrix from three column vectors. fn from_cols( x_axis: Val, y_axis: Val, z_axis: Val, - ) { + ) -> Val { let output: Val = bevy::math::Mat3::from_cols( x_axis.into_inner(), y_axis.into_inner(), @@ -11446,14 +16651,22 @@ impl bevy::math::Mat3 { .into(); output } - fn from_diagonal(diagonal: Val) { + /// Creates a 3x3 matrix with its diagonal set to `diagonal` and all other entries set to 0. + fn from_diagonal(diagonal: Val) -> Val { let output: Val = bevy::math::Mat3::from_diagonal( diagonal.into_inner(), ) .into(); output } - fn from_euler(order: Val, a: f32, b: f32, c: f32) { + /// Creates a 3D rotation matrix from the given euler rotation sequence and the angles (in + /// radians). + fn from_euler( + order: Val, + a: f32, + b: f32, + c: f32, + ) -> Val { let output: Val = bevy::math::Mat3::from_euler( order.into_inner(), a, @@ -11463,17 +16676,29 @@ impl bevy::math::Mat3 { .into(); output } - fn from_mat2(m: Val) { + /// Creates an affine transformation matrix from the given 2x2 matrix. + /// The resulting matrix can be used to transform 2D points and vectors. See + /// [`Self::transform_point2()`] and [`Self::transform_vector2()`]. + fn from_mat2(m: Val) -> Val { let output: Val = bevy::math::Mat3::from_mat2(m.into_inner()) .into(); output } - fn from_mat4(m: Val) { + /// Creates a 3x3 matrix from a 4x4 matrix, discarding the 4th row and column. + fn from_mat4(m: Val) -> Val { let output: Val = bevy::math::Mat3::from_mat4(m.into_inner()) .into(); output } - fn from_mat4_minor(m: Val, i: usize, j: usize) { + /// Creates a 3x3 matrix from the minor of the given 4x4 matrix, discarding the `i`th column + /// and `j`th row. + /// # Panics + /// Panics if `i` or `j` is greater than 3. + fn from_mat4_minor( + m: Val, + i: usize, + j: usize, + ) -> Val { let output: Val = bevy::math::Mat3::from_mat4_minor( m.into_inner(), i, @@ -11482,40 +16707,55 @@ impl bevy::math::Mat3 { .into(); output } - fn from_quat(rotation: Val) { + /// Creates a 3D rotation matrix from the given quaternion. + /// # Panics + /// Will panic if `rotation` is not normalized when `glam_assert` is enabled. + fn from_quat(rotation: Val) -> Val { let output: Val = bevy::math::Mat3::from_quat( rotation.into_inner(), ) .into(); output } - fn from_rotation_x(angle: f32) { + /// Creates a 3D rotation matrix from `angle` (in radians) around the x axis. + fn from_rotation_x(angle: f32) -> Val { let output: Val = bevy::math::Mat3::from_rotation_x(angle) .into(); output } - fn from_rotation_y(angle: f32) { + /// Creates a 3D rotation matrix from `angle` (in radians) around the y axis. + fn from_rotation_y(angle: f32) -> Val { let output: Val = bevy::math::Mat3::from_rotation_y(angle) .into(); output } - fn from_rotation_z(angle: f32) { + /// Creates a 3D rotation matrix from `angle` (in radians) around the z axis. + fn from_rotation_z(angle: f32) -> Val { let output: Val = bevy::math::Mat3::from_rotation_z(angle) .into(); output } - fn from_scale(scale: Val) { + /// Creates an affine transformation matrix from the given non-uniform 2D `scale`. + /// The resulting matrix can be used to transform 2D points and vectors. See + /// [`Self::transform_point2()`] and [`Self::transform_vector2()`]. + /// # Panics + /// Will panic if all elements of `scale` are zero when `glam_assert` is enabled. + fn from_scale(scale: Val) -> Val { let output: Val = bevy::math::Mat3::from_scale( scale.into_inner(), ) .into(); output } + /// Creates an affine transformation matrix from the given 2D `scale`, rotation `angle` (in + /// radians) and `translation`. + /// The resulting matrix can be used to transform 2D points and vectors. See + /// [`Self::transform_point2()`] and [`Self::transform_vector2()`]. fn from_scale_angle_translation( scale: Val, angle: f32, translation: Val, - ) { + ) -> Val { let output: Val = bevy::math::Mat3::from_scale_angle_translation( scale.into_inner(), angle, @@ -11524,71 +16764,102 @@ impl bevy::math::Mat3 { .into(); output } - fn from_translation(translation: Val) { + /// Creates an affine transformation matrix from the given 2D `translation`. + /// The resulting matrix can be used to transform 2D points and vectors. See + /// [`Self::transform_point2()`] and [`Self::transform_vector2()`]. + fn from_translation(translation: Val) -> Val { let output: Val = bevy::math::Mat3::from_translation( translation.into_inner(), ) .into(); output } - fn inverse(_self: Ref) { + /// Returns the inverse of `self`. + /// If the matrix is not invertible the returned matrix will be invalid. + /// # Panics + /// Will panic if the determinant of `self` is zero when `glam_assert` is enabled. + fn inverse(_self: Ref) -> Val { let output: Val = bevy::math::Mat3::inverse(&_self).into(); output } - fn is_finite(_self: Ref) { + /// Returns `true` if, and only if, all elements are finite. + /// If any element is either `NaN`, positive or negative infinity, this will return `false`. + fn is_finite(_self: Ref) -> bool { let output: bool = bevy::math::Mat3::is_finite(&_self).into(); output } - fn is_nan(_self: Ref) { + /// Returns `true` if any elements are `NaN`. + fn is_nan(_self: Ref) -> bool { let output: bool = bevy::math::Mat3::is_nan(&_self).into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: f32) { + fn mul(_self: Val, rhs: f32) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn mul_mat3(_self: Ref, rhs: Ref) { + /// Multiplies two 3x3 matrices. + fn mul_mat3( + _self: Ref, + rhs: Ref, + ) -> Val { let output: Val = bevy::math::Mat3::mul_mat3(&_self, &rhs) .into(); output } - fn mul_scalar(_self: Ref, rhs: f32) { + /// Multiplies a 3x3 matrix by a scalar. + fn mul_scalar(_self: Ref, rhs: f32) -> Val { let output: Val = bevy::math::Mat3::mul_scalar(&_self, rhs) .into(); output } - fn mul_vec3(_self: Ref, rhs: Val) { + /// Transforms a 3D vector. + fn mul_vec3( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Mat3::mul_vec3( &_self, rhs.into_inner(), @@ -11596,7 +16867,11 @@ impl bevy::math::Mat3 { .into(); output } - fn mul_vec3a(_self: Ref, rhs: Val) { + /// Transforms a [`Vec3A`]. + fn mul_vec3a( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Mat3::mul_vec3a( &_self, rhs.into_inner(), @@ -11604,38 +16879,60 @@ impl bevy::math::Mat3 { .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } - fn row(_self: Ref, index: usize) { + /// Returns the matrix row for the given `index`. + /// # Panics + /// Panics if `index` is greater than 2. + fn row(_self: Ref, index: usize) -> Val { let output: Val = bevy::math::Mat3::row(&_self, index).into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub_mat3(_self: Ref, rhs: Ref) { + /// Subtracts two 3x3 matrices. + fn sub_mat3( + _self: Ref, + rhs: Ref, + ) -> Val { let output: Val = bevy::math::Mat3::sub_mat3(&_self, &rhs) .into(); output } - fn to_cols_array(_self: Ref) { + /// Creates a `[f32; 9]` array storing data in column major order. + /// If you require data in row major order `transpose` the matrix first. + fn to_cols_array(_self: Ref) -> [f32; 9] { let output: [f32; 9] = bevy::math::Mat3::to_cols_array(&_self).into(); output } - fn to_cols_array_2d(_self: Ref) { + /// Creates a `[[f32; 3]; 3]` 3D array storing data in column major order. + /// If you require data in row major order `transpose` the matrix first. + fn to_cols_array_2d(_self: Ref) -> [[f32; 3]; 3] { let output: [[f32; 3]; 3] = bevy::math::Mat3::to_cols_array_2d(&_self).into(); output } - fn to_euler(_self: Ref, order: Val) { + /// Extract Euler angles with the given Euler rotation order. + /// Note if the input matrix contains scales, shears, or other non-rotation transformations then + /// the resulting Euler angles will be ill-defined. + /// # Panics + /// Will panic if any input matrix column is not normalized when `glam_assert` is enabled. + fn to_euler( + _self: Ref, + order: Val, + ) -> (f32, f32, f32) { let output: (f32, f32, f32) = bevy::math::Mat3::to_euler( &_self, order.into_inner(), @@ -11643,7 +16940,15 @@ impl bevy::math::Mat3 { .into(); output } - fn transform_point2(_self: Ref, rhs: Val) { + /// Transforms the given 2D vector as a point. + /// This is the equivalent of multiplying `rhs` as a 3D vector where `z` is `1`. + /// This method assumes that `self` contains a valid affine transform. + /// # Panics + /// Will panic if the 2nd row of `self` is not `(0, 0, 1)` when `glam_assert` is enabled. + fn transform_point2( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Mat3::transform_point2( &_self, rhs.into_inner(), @@ -11651,7 +16956,15 @@ impl bevy::math::Mat3 { .into(); output } - fn transform_vector2(_self: Ref, rhs: Val) { + /// Rotates the given 2D vector. + /// This is the equivalent of multiplying `rhs` as a 3D vector where `z` is `0`. + /// This method assumes that `self` contains a valid affine transform. + /// # Panics + /// Will panic if the 2nd row of `self` is not `(0, 0, 1)` when `glam_assert` is enabled. + fn transform_vector2( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Mat3::transform_vector2( &_self, rhs.into_inner(), @@ -11659,7 +16972,8 @@ impl bevy::math::Mat3 { .into(); output } - fn transpose(_self: Ref) { + /// Returns the transpose of `self`. + fn transpose(_self: Ref) -> Val { let output: Val = bevy::math::Mat3::transpose(&_self).into(); output } @@ -11670,15 +16984,23 @@ impl bevy::math::Mat3 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::Mat3A { - fn abs(_self: Ref) { + /// Takes the absolute value of each element in `self` + fn abs(_self: Ref) -> Val { let output: Val = bevy::math::Mat3A::abs(&_self).into(); output } + /// Returns true if the absolute difference of all elements between `self` and `rhs` + /// is less than or equal to `max_abs_diff`. + /// This can be used to compare if two matrices contain similar elements. It works best + /// when comparing with a known value. The `max_abs_diff` that should be used used + /// depends on the values being compared against. + /// For more see + /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). fn abs_diff_eq( _self: Ref, rhs: Val, max_abs_diff: f32, - ) { + ) -> bool { let output: bool = bevy::math::Mat3A::abs_diff_eq( &_self, rhs.into_inner(), @@ -11687,62 +17009,85 @@ impl bevy::math::Mat3A { .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add_mat3(_self: Ref, rhs: Ref) { + /// Adds two 3x3 matrices. + fn add_mat3( + _self: Ref, + rhs: Ref, + ) -> Val { let output: Val = bevy::math::Mat3A::add_mat3(&_self, &rhs) .into(); output } - fn as_dmat3(_self: Ref) { + fn as_dmat3(_self: Ref) -> Val { let output: Val = bevy::math::Mat3A::as_dmat3(&_self).into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn col(_self: Ref, index: usize) { + /// Returns the matrix column for the given `index`. + /// # Panics + /// Panics if `index` is greater than 2. + fn col(_self: Ref, index: usize) -> Val { let output: Val = bevy::math::Mat3A::col(&_self, index) .into(); output } - fn determinant(_self: Ref) { + /// Returns the determinant of `self`. + fn determinant(_self: Ref) -> f32 { let output: f32 = bevy::math::Mat3A::determinant(&_self).into(); output } - fn div(_self: Val, rhs: f32) { + fn div(_self: Val, rhs: f32) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn div_scalar(_self: Ref, rhs: f32) { + /// Divides a 3x3 matrix by a scalar. + fn div_scalar(_self: Ref, rhs: f32) -> Val { let output: Val = bevy::math::Mat3A::div_scalar(&_self, rhs) .into(); output } - fn eq(_self: Ref, rhs: Ref) { + fn eq(_self: Ref, rhs: Ref) -> bool { let output: bool = >::eq(&_self, &rhs) .into(); output } - fn from_angle(angle: f32) { + /// Creates an affine transformation matrix from the given 2D rotation `angle` (in + /// radians). + /// The resulting matrix can be used to transform 2D points and vectors. See + /// [`Self::transform_point2()`] and [`Self::transform_vector2()`]. + fn from_angle(angle: f32) -> Val { let output: Val = bevy::math::Mat3A::from_angle(angle).into(); output } - fn from_axis_angle(axis: Val, angle: f32) { + /// Creates a 3D rotation matrix from a normalized rotation `axis` and `angle` (in + /// radians). + /// # Panics + /// Will panic if `axis` is not normalized when `glam_assert` is enabled. + fn from_axis_angle( + axis: Val, + angle: f32, + ) -> Val { let output: Val = bevy::math::Mat3A::from_axis_angle( axis.into_inner(), angle, @@ -11750,11 +17095,12 @@ impl bevy::math::Mat3A { .into(); output } + /// Creates a 3x3 matrix from three column vectors. fn from_cols( x_axis: Val, y_axis: Val, z_axis: Val, - ) { + ) -> Val { let output: Val = bevy::math::Mat3A::from_cols( x_axis.into_inner(), y_axis.into_inner(), @@ -11763,14 +17109,22 @@ impl bevy::math::Mat3A { .into(); output } - fn from_diagonal(diagonal: Val) { + /// Creates a 3x3 matrix with its diagonal set to `diagonal` and all other entries set to 0. + fn from_diagonal(diagonal: Val) -> Val { let output: Val = bevy::math::Mat3A::from_diagonal( diagonal.into_inner(), ) .into(); output } - fn from_euler(order: Val, a: f32, b: f32, c: f32) { + /// Creates a 3D rotation matrix from the given euler rotation sequence and the angles (in + /// radians). + fn from_euler( + order: Val, + a: f32, + b: f32, + c: f32, + ) -> Val { let output: Val = bevy::math::Mat3A::from_euler( order.into_inner(), a, @@ -11780,17 +17134,29 @@ impl bevy::math::Mat3A { .into(); output } - fn from_mat2(m: Val) { + /// Creates an affine transformation matrix from the given 2x2 matrix. + /// The resulting matrix can be used to transform 2D points and vectors. See + /// [`Self::transform_point2()`] and [`Self::transform_vector2()`]. + fn from_mat2(m: Val) -> Val { let output: Val = bevy::math::Mat3A::from_mat2(m.into_inner()) .into(); output } - fn from_mat4(m: Val) { + /// Creates a 3x3 matrix from a 4x4 matrix, discarding the 4th row and column. + fn from_mat4(m: Val) -> Val { let output: Val = bevy::math::Mat3A::from_mat4(m.into_inner()) .into(); output } - fn from_mat4_minor(m: Val, i: usize, j: usize) { + /// Creates a 3x3 matrix from the minor of the given 4x4 matrix, discarding the `i`th column + /// and `j`th row. + /// # Panics + /// Panics if `i` or `j` is greater than 3. + fn from_mat4_minor( + m: Val, + i: usize, + j: usize, + ) -> Val { let output: Val = bevy::math::Mat3A::from_mat4_minor( m.into_inner(), i, @@ -11799,40 +17165,55 @@ impl bevy::math::Mat3A { .into(); output } - fn from_quat(rotation: Val) { + /// Creates a 3D rotation matrix from the given quaternion. + /// # Panics + /// Will panic if `rotation` is not normalized when `glam_assert` is enabled. + fn from_quat(rotation: Val) -> Val { let output: Val = bevy::math::Mat3A::from_quat( rotation.into_inner(), ) .into(); output } - fn from_rotation_x(angle: f32) { + /// Creates a 3D rotation matrix from `angle` (in radians) around the x axis. + fn from_rotation_x(angle: f32) -> Val { let output: Val = bevy::math::Mat3A::from_rotation_x(angle) .into(); output } - fn from_rotation_y(angle: f32) { + /// Creates a 3D rotation matrix from `angle` (in radians) around the y axis. + fn from_rotation_y(angle: f32) -> Val { let output: Val = bevy::math::Mat3A::from_rotation_y(angle) .into(); output } - fn from_rotation_z(angle: f32) { + /// Creates a 3D rotation matrix from `angle` (in radians) around the z axis. + fn from_rotation_z(angle: f32) -> Val { let output: Val = bevy::math::Mat3A::from_rotation_z(angle) .into(); output } - fn from_scale(scale: Val) { + /// Creates an affine transformation matrix from the given non-uniform 2D `scale`. + /// The resulting matrix can be used to transform 2D points and vectors. See + /// [`Self::transform_point2()`] and [`Self::transform_vector2()`]. + /// # Panics + /// Will panic if all elements of `scale` are zero when `glam_assert` is enabled. + fn from_scale(scale: Val) -> Val { let output: Val = bevy::math::Mat3A::from_scale( scale.into_inner(), ) .into(); output } + /// Creates an affine transformation matrix from the given 2D `scale`, rotation `angle` (in + /// radians) and `translation`. + /// The resulting matrix can be used to transform 2D points and vectors. See + /// [`Self::transform_point2()`] and [`Self::transform_vector2()`]. fn from_scale_angle_translation( scale: Val, angle: f32, translation: Val, - ) { + ) -> Val { let output: Val = bevy::math::Mat3A::from_scale_angle_translation( scale.into_inner(), angle, @@ -11841,71 +17222,102 @@ impl bevy::math::Mat3A { .into(); output } - fn from_translation(translation: Val) { + /// Creates an affine transformation matrix from the given 2D `translation`. + /// The resulting matrix can be used to transform 2D points and vectors. See + /// [`Self::transform_point2()`] and [`Self::transform_vector2()`]. + fn from_translation(translation: Val) -> Val { let output: Val = bevy::math::Mat3A::from_translation( translation.into_inner(), ) .into(); output } - fn inverse(_self: Ref) { + /// Returns the inverse of `self`. + /// If the matrix is not invertible the returned matrix will be invalid. + /// # Panics + /// Will panic if the determinant of `self` is zero when `glam_assert` is enabled. + fn inverse(_self: Ref) -> Val { let output: Val = bevy::math::Mat3A::inverse(&_self).into(); output } - fn is_finite(_self: Ref) { + /// Returns `true` if, and only if, all elements are finite. + /// If any element is either `NaN`, positive or negative infinity, this will return `false`. + fn is_finite(_self: Ref) -> bool { let output: bool = bevy::math::Mat3A::is_finite(&_self).into(); output } - fn is_nan(_self: Ref) { + /// Returns `true` if any elements are `NaN`. + fn is_nan(_self: Ref) -> bool { let output: bool = bevy::math::Mat3A::is_nan(&_self).into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: f32) { + fn mul(_self: Val, rhs: f32) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn mul_mat3(_self: Ref, rhs: Ref) { + /// Multiplies two 3x3 matrices. + fn mul_mat3( + _self: Ref, + rhs: Ref, + ) -> Val { let output: Val = bevy::math::Mat3A::mul_mat3(&_self, &rhs) .into(); output } - fn mul_scalar(_self: Ref, rhs: f32) { + /// Multiplies a 3x3 matrix by a scalar. + fn mul_scalar(_self: Ref, rhs: f32) -> Val { let output: Val = bevy::math::Mat3A::mul_scalar(&_self, rhs) .into(); output } - fn mul_vec3(_self: Ref, rhs: Val) { + /// Transforms a 3D vector. + fn mul_vec3( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Mat3A::mul_vec3( &_self, rhs.into_inner(), @@ -11913,7 +17325,11 @@ impl bevy::math::Mat3A { .into(); output } - fn mul_vec3a(_self: Ref, rhs: Val) { + /// Transforms a [`Vec3A`]. + fn mul_vec3a( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Mat3A::mul_vec3a( &_self, rhs.into_inner(), @@ -11921,39 +17337,61 @@ impl bevy::math::Mat3A { .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } - fn row(_self: Ref, index: usize) { + /// Returns the matrix row for the given `index`. + /// # Panics + /// Panics if `index` is greater than 2. + fn row(_self: Ref, index: usize) -> Val { let output: Val = bevy::math::Mat3A::row(&_self, index) .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub_mat3(_self: Ref, rhs: Ref) { + /// Subtracts two 3x3 matrices. + fn sub_mat3( + _self: Ref, + rhs: Ref, + ) -> Val { let output: Val = bevy::math::Mat3A::sub_mat3(&_self, &rhs) .into(); output } - fn to_cols_array(_self: Ref) { + /// Creates a `[f32; 9]` array storing data in column major order. + /// If you require data in row major order `transpose` the matrix first. + fn to_cols_array(_self: Ref) -> [f32; 9] { let output: [f32; 9] = bevy::math::Mat3A::to_cols_array(&_self).into(); output } - fn to_cols_array_2d(_self: Ref) { + /// Creates a `[[f32; 3]; 3]` 3D array storing data in column major order. + /// If you require data in row major order `transpose` the matrix first. + fn to_cols_array_2d(_self: Ref) -> [[f32; 3]; 3] { let output: [[f32; 3]; 3] = bevy::math::Mat3A::to_cols_array_2d(&_self).into(); output } - fn to_euler(_self: Ref, order: Val) { + /// Extract Euler angles with the given Euler rotation order. + /// Note if the input matrix contains scales, shears, or other non-rotation transformations then + /// the resulting Euler angles will be ill-defined. + /// # Panics + /// Will panic if any input matrix column is not normalized when `glam_assert` is enabled. + fn to_euler( + _self: Ref, + order: Val, + ) -> (f32, f32, f32) { let output: (f32, f32, f32) = bevy::math::Mat3A::to_euler( &_self, order.into_inner(), @@ -11961,7 +17399,15 @@ impl bevy::math::Mat3A { .into(); output } - fn transform_point2(_self: Ref, rhs: Val) { + /// Transforms the given 2D vector as a point. + /// This is the equivalent of multiplying `rhs` as a 3D vector where `z` is `1`. + /// This method assumes that `self` contains a valid affine transform. + /// # Panics + /// Will panic if the 2nd row of `self` is not `(0, 0, 1)` when `glam_assert` is enabled. + fn transform_point2( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Mat3A::transform_point2( &_self, rhs.into_inner(), @@ -11969,7 +17415,15 @@ impl bevy::math::Mat3A { .into(); output } - fn transform_vector2(_self: Ref, rhs: Val) { + /// Rotates the given 2D vector. + /// This is the equivalent of multiplying `rhs` as a 3D vector where `z` is `0`. + /// This method assumes that `self` contains a valid affine transform. + /// # Panics + /// Will panic if the 2nd row of `self` is not `(0, 0, 1)` when `glam_assert` is enabled. + fn transform_vector2( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Mat3A::transform_vector2( &_self, rhs.into_inner(), @@ -11977,7 +17431,8 @@ impl bevy::math::Mat3A { .into(); output } - fn transpose(_self: Ref) { + /// Returns the transpose of `self`. + fn transpose(_self: Ref) -> Val { let output: Val = bevy::math::Mat3A::transpose(&_self).into(); output } @@ -11988,15 +17443,23 @@ impl bevy::math::Mat3A { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::Mat4 { - fn abs(_self: Ref) { + /// Takes the absolute value of each element in `self` + fn abs(_self: Ref) -> Val { let output: Val = bevy::math::Mat4::abs(&_self).into(); output } + /// Returns true if the absolute difference of all elements between `self` and `rhs` + /// is less than or equal to `max_abs_diff`. + /// This can be used to compare if two matrices contain similar elements. It works best + /// when comparing with a known value. The `max_abs_diff` that should be used used + /// depends on the values being compared against. + /// For more see + /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). fn abs_diff_eq( _self: Ref, rhs: Val, max_abs_diff: f32, - ) { + ) -> bool { let output: bool = bevy::math::Mat4::abs_diff_eq( &_self, rhs.into_inner(), @@ -12005,57 +17468,78 @@ impl bevy::math::Mat4 { .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add_mat4(_self: Ref, rhs: Ref) { + /// Adds two 4x4 matrices. + fn add_mat4( + _self: Ref, + rhs: Ref, + ) -> Val { let output: Val = bevy::math::Mat4::add_mat4(&_self, &rhs) .into(); output } - fn as_dmat4(_self: Ref) { + fn as_dmat4(_self: Ref) -> Val { let output: Val = bevy::math::Mat4::as_dmat4(&_self).into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn col(_self: Ref, index: usize) { + /// Returns the matrix column for the given `index`. + /// # Panics + /// Panics if `index` is greater than 3. + fn col(_self: Ref, index: usize) -> Val { let output: Val = bevy::math::Mat4::col(&_self, index).into(); output } - fn determinant(_self: Ref) { + /// Returns the determinant of `self`. + fn determinant(_self: Ref) -> f32 { let output: f32 = bevy::math::Mat4::determinant(&_self).into(); output } - fn div(_self: Val, rhs: f32) { + fn div(_self: Val, rhs: f32) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn div_scalar(_self: Ref, rhs: f32) { + /// Divides a 4x4 matrix by a scalar. + fn div_scalar(_self: Ref, rhs: f32) -> Val { let output: Val = bevy::math::Mat4::div_scalar(&_self, rhs) .into(); output } - fn eq(_self: Ref, rhs: Ref) { + fn eq(_self: Ref, rhs: Ref) -> bool { let output: bool = >::eq(&_self, &rhs) .into(); output } - fn from_axis_angle(axis: Val, angle: f32) { + /// Creates an affine transformation matrix containing a 3D rotation around a normalized + /// rotation `axis` of `angle` (in radians). + /// The resulting matrix can be used to transform 3D points and vectors. See + /// [`Self::transform_point3()`] and [`Self::transform_vector3()`]. + /// # Panics + /// Will panic if `axis` is not normalized when `glam_assert` is enabled. + fn from_axis_angle( + axis: Val, + angle: f32, + ) -> Val { let output: Val = bevy::math::Mat4::from_axis_angle( axis.into_inner(), angle, @@ -12063,12 +17547,13 @@ impl bevy::math::Mat4 { .into(); output } + /// Creates a 4x4 matrix from four column vectors. fn from_cols( x_axis: Val, y_axis: Val, z_axis: Val, w_axis: Val, - ) { + ) -> Val { let output: Val = bevy::math::Mat4::from_cols( x_axis.into_inner(), y_axis.into_inner(), @@ -12078,14 +17563,24 @@ impl bevy::math::Mat4 { .into(); output } - fn from_diagonal(diagonal: Val) { + /// Creates a 4x4 matrix with its diagonal set to `diagonal` and all other entries set to 0. + fn from_diagonal(diagonal: Val) -> Val { let output: Val = bevy::math::Mat4::from_diagonal( diagonal.into_inner(), ) .into(); output } - fn from_euler(order: Val, a: f32, b: f32, c: f32) { + /// Creates a affine transformation matrix containing a rotation from the given euler + /// rotation sequence and angles (in radians). + /// The resulting matrix can be used to transform 3D points and vectors. See + /// [`Self::transform_point3()`] and [`Self::transform_vector3()`]. + fn from_euler( + order: Val, + a: f32, + b: f32, + c: f32, + ) -> Val { let output: Val = bevy::math::Mat4::from_euler( order.into_inner(), a, @@ -12095,27 +17590,45 @@ impl bevy::math::Mat4 { .into(); output } - fn from_mat3(m: Val) { + /// Creates an affine transformation matrix from the given 3x3 linear transformation + /// matrix. + /// The resulting matrix can be used to transform 3D points and vectors. See + /// [`Self::transform_point3()`] and [`Self::transform_vector3()`]. + fn from_mat3(m: Val) -> Val { let output: Val = bevy::math::Mat4::from_mat3(m.into_inner()) .into(); output } - fn from_mat3a(m: Val) { + /// Creates an affine transformation matrix from the given 3x3 linear transformation + /// matrix. + /// The resulting matrix can be used to transform 3D points and vectors. See + /// [`Self::transform_point3()`] and [`Self::transform_vector3()`]. + fn from_mat3a(m: Val) -> Val { let output: Val = bevy::math::Mat4::from_mat3a(m.into_inner()) .into(); output } - fn from_quat(rotation: Val) { + /// Creates an affine transformation matrix from the given `rotation` quaternion. + /// The resulting matrix can be used to transform 3D points and vectors. See + /// [`Self::transform_point3()`] and [`Self::transform_vector3()`]. + /// # Panics + /// Will panic if `rotation` is not normalized when `glam_assert` is enabled. + fn from_quat(rotation: Val) -> Val { let output: Val = bevy::math::Mat4::from_quat( rotation.into_inner(), ) .into(); output } + /// Creates an affine transformation matrix from the given 3D `translation`. + /// The resulting matrix can be used to transform 3D points and vectors. See + /// [`Self::transform_point3()`] and [`Self::transform_vector3()`]. + /// # Panics + /// Will panic if `rotation` is not normalized when `glam_assert` is enabled. fn from_rotation_translation( rotation: Val, translation: Val, - ) { + ) -> Val { let output: Val = bevy::math::Mat4::from_rotation_translation( rotation.into_inner(), translation.into_inner(), @@ -12123,33 +17636,56 @@ impl bevy::math::Mat4 { .into(); output } - fn from_rotation_x(angle: f32) { + /// Creates an affine transformation matrix containing a 3D rotation around the x axis of + /// `angle` (in radians). + /// The resulting matrix can be used to transform 3D points and vectors. See + /// [`Self::transform_point3()`] and [`Self::transform_vector3()`]. + fn from_rotation_x(angle: f32) -> Val { let output: Val = bevy::math::Mat4::from_rotation_x(angle) .into(); output } - fn from_rotation_y(angle: f32) { + /// Creates an affine transformation matrix containing a 3D rotation around the y axis of + /// `angle` (in radians). + /// The resulting matrix can be used to transform 3D points and vectors. See + /// [`Self::transform_point3()`] and [`Self::transform_vector3()`]. + fn from_rotation_y(angle: f32) -> Val { let output: Val = bevy::math::Mat4::from_rotation_y(angle) .into(); output } - fn from_rotation_z(angle: f32) { + /// Creates an affine transformation matrix containing a 3D rotation around the z axis of + /// `angle` (in radians). + /// The resulting matrix can be used to transform 3D points and vectors. See + /// [`Self::transform_point3()`] and [`Self::transform_vector3()`]. + fn from_rotation_z(angle: f32) -> Val { let output: Val = bevy::math::Mat4::from_rotation_z(angle) .into(); output } - fn from_scale(scale: Val) { + /// Creates an affine transformation matrix containing the given 3D non-uniform `scale`. + /// The resulting matrix can be used to transform 3D points and vectors. See + /// [`Self::transform_point3()`] and [`Self::transform_vector3()`]. + /// # Panics + /// Will panic if all elements of `scale` are zero when `glam_assert` is enabled. + fn from_scale(scale: Val) -> Val { let output: Val = bevy::math::Mat4::from_scale( scale.into_inner(), ) .into(); output } + /// Creates an affine transformation matrix from the given 3D `scale`, `rotation` and + /// `translation`. + /// The resulting matrix can be used to transform 3D points and vectors. See + /// [`Self::transform_point3()`] and [`Self::transform_vector3()`]. + /// # Panics + /// Will panic if `rotation` is not normalized when `glam_assert` is enabled. fn from_scale_rotation_translation( scale: Val, rotation: Val, translation: Val, - ) { + ) -> Val { let output: Val = bevy::math::Mat4::from_scale_rotation_translation( scale.into_inner(), rotation.into_inner(), @@ -12158,30 +17694,45 @@ impl bevy::math::Mat4 { .into(); output } - fn from_translation(translation: Val) { + /// Creates an affine transformation matrix from the given 3D `translation`. + /// The resulting matrix can be used to transform 3D points and vectors. See + /// [`Self::transform_point3()`] and [`Self::transform_vector3()`]. + fn from_translation(translation: Val) -> Val { let output: Val = bevy::math::Mat4::from_translation( translation.into_inner(), ) .into(); output } - fn inverse(_self: Ref) { + /// Returns the inverse of `self`. + /// If the matrix is not invertible the returned matrix will be invalid. + /// # Panics + /// Will panic if the determinant of `self` is zero when `glam_assert` is enabled. + fn inverse(_self: Ref) -> Val { let output: Val = bevy::math::Mat4::inverse(&_self).into(); output } - fn is_finite(_self: Ref) { + /// Returns `true` if, and only if, all elements are finite. + /// If any element is either `NaN`, positive or negative infinity, this will return `false`. + fn is_finite(_self: Ref) -> bool { let output: bool = bevy::math::Mat4::is_finite(&_self).into(); output } - fn is_nan(_self: Ref) { + /// Returns `true` if any elements are `NaN`. + fn is_nan(_self: Ref) -> bool { let output: bool = bevy::math::Mat4::is_nan(&_self).into(); output } + /// Creates a left-handed view matrix using a camera position, an up direction, and a focal + /// point. + /// For a view coordinate system with `+X=right`, `+Y=up` and `+Z=forward`. + /// # Panics + /// Will panic if `up` is not normalized when `glam_assert` is enabled. fn look_at_lh( eye: Val, center: Val, up: Val, - ) { + ) -> Val { let output: Val = bevy::math::Mat4::look_at_lh( eye.into_inner(), center.into_inner(), @@ -12190,11 +17741,16 @@ impl bevy::math::Mat4 { .into(); output } + /// Creates a right-handed view matrix using a camera position, an up direction, and a focal + /// point. + /// For a view coordinate system with `+X=right`, `+Y=up` and `+Z=back`. + /// # Panics + /// Will panic if `up` is not normalized when `glam_assert` is enabled. fn look_at_rh( eye: Val, center: Val, up: Val, - ) { + ) -> Val { let output: Val = bevy::math::Mat4::look_at_rh( eye.into_inner(), center.into_inner(), @@ -12203,11 +17759,14 @@ impl bevy::math::Mat4 { .into(); output } + /// Creates a left-handed view matrix using a camera position, an up direction, and a facing + /// direction. + /// For a view coordinate system with `+X=right`, `+Y=up` and `+Z=forward`. fn look_to_lh( eye: Val, dir: Val, up: Val, - ) { + ) -> Val { let output: Val = bevy::math::Mat4::look_to_lh( eye.into_inner(), dir.into_inner(), @@ -12216,11 +17775,14 @@ impl bevy::math::Mat4 { .into(); output } + /// Creates a right-handed view matrix using a camera position, an up direction, and a facing + /// direction. + /// For a view coordinate system with `+X=right`, `+Y=up` and `+Z=back`. fn look_to_rh( eye: Val, dir: Val, up: Val, - ) { + ) -> Val { let output: Val = bevy::math::Mat4::look_to_rh( eye.into_inner(), dir.into_inner(), @@ -12229,45 +17791,63 @@ impl bevy::math::Mat4 { .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: f32) { + fn mul(_self: Val, rhs: f32) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn mul_mat4(_self: Ref, rhs: Ref) { + /// Multiplies two 4x4 matrices. + fn mul_mat4( + _self: Ref, + rhs: Ref, + ) -> Val { let output: Val = bevy::math::Mat4::mul_mat4(&_self, &rhs) .into(); output } - fn mul_scalar(_self: Ref, rhs: f32) { + /// Multiplies a 4x4 matrix by a scalar. + fn mul_scalar(_self: Ref, rhs: f32) -> Val { let output: Val = bevy::math::Mat4::mul_scalar(&_self, rhs) .into(); output } - fn mul_vec4(_self: Ref, rhs: Val) { + /// Transforms a 4D vector. + fn mul_vec4( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Mat4::mul_vec4( &_self, rhs.into_inner(), @@ -12275,13 +17855,15 @@ impl bevy::math::Mat4 { .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } + /// Creates a left-handed orthographic projection matrix with `[0,1]` depth range. + /// Useful to map a left-handed coordinate system to the normalized device coordinates that WebGPU/Direct3D/Metal expect. fn orthographic_lh( left: f32, right: f32, @@ -12289,7 +17871,7 @@ impl bevy::math::Mat4 { top: f32, near: f32, far: f32, - ) { + ) -> Val { let output: Val = bevy::math::Mat4::orthographic_lh( left, right, @@ -12301,6 +17883,8 @@ impl bevy::math::Mat4 { .into(); output } + /// Creates a right-handed orthographic projection matrix with `[0,1]` depth range. + /// Useful to map a right-handed coordinate system to the normalized device coordinates that WebGPU/Direct3D/Metal expect. fn orthographic_rh( left: f32, right: f32, @@ -12308,7 +17892,7 @@ impl bevy::math::Mat4 { top: f32, near: f32, far: f32, - ) { + ) -> Val { let output: Val = bevy::math::Mat4::orthographic_rh( left, right, @@ -12320,6 +17904,11 @@ impl bevy::math::Mat4 { .into(); output } + /// Creates a right-handed orthographic projection matrix with `[-1,1]` depth + /// range. This is the same as the OpenGL `glOrtho` function in OpenGL. + /// See + /// + /// Useful to map a right-handed coordinate system to the normalized device coordinates that OpenGL expects. fn orthographic_rh_gl( left: f32, right: f32, @@ -12327,7 +17916,7 @@ impl bevy::math::Mat4 { top: f32, near: f32, far: f32, - ) { + ) -> Val { let output: Val = bevy::math::Mat4::orthographic_rh_gl( left, right, @@ -12339,7 +17928,17 @@ impl bevy::math::Mat4 { .into(); output } - fn perspective_infinite_lh(fov_y_radians: f32, aspect_ratio: f32, z_near: f32) { + /// Creates an infinite left-handed perspective projection matrix with `[0,1]` depth range. + /// Like `perspective_lh`, but with an infinite value for `z_far`. + /// The result is that points near `z_near` are mapped to depth `0`, and as they move towards infinity the depth approaches `1`. + /// # Panics + /// Will panic if `z_near` or `z_far` are less than or equal to zero when `glam_assert` is + /// enabled. + fn perspective_infinite_lh( + fov_y_radians: f32, + aspect_ratio: f32, + z_near: f32, + ) -> Val { let output: Val = bevy::math::Mat4::perspective_infinite_lh( fov_y_radians, aspect_ratio, @@ -12348,11 +17947,15 @@ impl bevy::math::Mat4 { .into(); output } + /// Creates an infinite reverse left-handed perspective projection matrix with `[0,1]` depth range. + /// Similar to `perspective_infinite_lh`, but maps `Z = z_near` to a depth of `1` and `Z = infinity` to a depth of `0`. + /// # Panics + /// Will panic if `z_near` is less than or equal to zero when `glam_assert` is enabled. fn perspective_infinite_reverse_lh( fov_y_radians: f32, aspect_ratio: f32, z_near: f32, - ) { + ) -> Val { let output: Val = bevy::math::Mat4::perspective_infinite_reverse_lh( fov_y_radians, aspect_ratio, @@ -12361,11 +17964,15 @@ impl bevy::math::Mat4 { .into(); output } + /// Creates an infinite reverse right-handed perspective projection matrix with `[0,1]` depth range. + /// Similar to `perspective_infinite_rh`, but maps `Z = z_near` to a depth of `1` and `Z = infinity` to a depth of `0`. + /// # Panics + /// Will panic if `z_near` is less than or equal to zero when `glam_assert` is enabled. fn perspective_infinite_reverse_rh( fov_y_radians: f32, aspect_ratio: f32, z_near: f32, - ) { + ) -> Val { let output: Val = bevy::math::Mat4::perspective_infinite_reverse_rh( fov_y_radians, aspect_ratio, @@ -12374,7 +17981,17 @@ impl bevy::math::Mat4 { .into(); output } - fn perspective_infinite_rh(fov_y_radians: f32, aspect_ratio: f32, z_near: f32) { + /// Creates an infinite right-handed perspective projection matrix with `[0,1]` depth range. + /// Like `perspective_rh`, but with an infinite value for `z_far`. + /// The result is that points near `z_near` are mapped to depth `0`, and as they move towards infinity the depth approaches `1`. + /// # Panics + /// Will panic if `z_near` or `z_far` are less than or equal to zero when `glam_assert` is + /// enabled. + fn perspective_infinite_rh( + fov_y_radians: f32, + aspect_ratio: f32, + z_near: f32, + ) -> Val { let output: Val = bevy::math::Mat4::perspective_infinite_rh( fov_y_radians, aspect_ratio, @@ -12383,7 +18000,17 @@ impl bevy::math::Mat4 { .into(); output } - fn perspective_lh(fov_y_radians: f32, aspect_ratio: f32, z_near: f32, z_far: f32) { + /// Creates a left-handed perspective projection matrix with `[0,1]` depth range. + /// Useful to map the standard left-handed coordinate system into what WebGPU/Metal/Direct3D expect. + /// # Panics + /// Will panic if `z_near` or `z_far` are less than or equal to zero when `glam_assert` is + /// enabled. + fn perspective_lh( + fov_y_radians: f32, + aspect_ratio: f32, + z_near: f32, + z_far: f32, + ) -> Val { let output: Val = bevy::math::Mat4::perspective_lh( fov_y_radians, aspect_ratio, @@ -12393,7 +18020,17 @@ impl bevy::math::Mat4 { .into(); output } - fn perspective_rh(fov_y_radians: f32, aspect_ratio: f32, z_near: f32, z_far: f32) { + /// Creates a right-handed perspective projection matrix with `[0,1]` depth range. + /// Useful to map the standard right-handed coordinate system into what WebGPU/Metal/Direct3D expect. + /// # Panics + /// Will panic if `z_near` or `z_far` are less than or equal to zero when `glam_assert` is + /// enabled. + fn perspective_rh( + fov_y_radians: f32, + aspect_ratio: f32, + z_near: f32, + z_far: f32, + ) -> Val { let output: Val = bevy::math::Mat4::perspective_rh( fov_y_radians, aspect_ratio, @@ -12403,12 +18040,16 @@ impl bevy::math::Mat4 { .into(); output } + /// Creates a right-handed perspective projection matrix with `[-1,1]` depth range. + /// Useful to map the standard right-handed coordinate system into what OpenGL expects. + /// This is the same as the OpenGL `gluPerspective` function. + /// See fn perspective_rh_gl( fov_y_radians: f32, aspect_ratio: f32, z_near: f32, z_far: f32, - ) { + ) -> Val { let output: Val = bevy::math::Mat4::perspective_rh_gl( fov_y_radians, aspect_ratio, @@ -12418,7 +18059,14 @@ impl bevy::math::Mat4 { .into(); output } - fn project_point3(_self: Ref, rhs: Val) { + /// Transforms the given 3D vector as a point, applying perspective correction. + /// This is the equivalent of multiplying the 3D vector as a 4D vector where `w` is `1.0`. + /// The perspective divide is performed meaning the resulting 3D vector is divided by `w`. + /// This method assumes that `self` contains a projective transform. + fn project_point3( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Mat4::project_point3( &_self, rhs.into_inner(), @@ -12426,7 +18074,14 @@ impl bevy::math::Mat4 { .into(); output } - fn project_point3a(_self: Ref, rhs: Val) { + /// Transforms the given [`Vec3A`] as a 3D point, applying perspective correction. + /// This is the equivalent of multiplying the [`Vec3A`] as a 4D vector where `w` is `1.0`. + /// The perspective divide is performed meaning the resulting 3D vector is divided by `w`. + /// This method assumes that `self` contains a projective transform. + fn project_point3a( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Mat4::project_point3a( &_self, rhs.into_inner(), @@ -12434,31 +18089,54 @@ impl bevy::math::Mat4 { .into(); output } - fn row(_self: Ref, index: usize) { + /// Returns the matrix row for the given `index`. + /// # Panics + /// Panics if `index` is greater than 3. + fn row(_self: Ref, index: usize) -> Val { let output: Val = bevy::math::Mat4::row(&_self, index).into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub_mat4(_self: Ref, rhs: Ref) { + /// Subtracts two 4x4 matrices. + fn sub_mat4( + _self: Ref, + rhs: Ref, + ) -> Val { let output: Val = bevy::math::Mat4::sub_mat4(&_self, &rhs) .into(); output } - fn to_cols_array(_self: Ref) { + /// Creates a `[f32; 16]` array storing data in column major order. + /// If you require data in row major order `transpose` the matrix first. + fn to_cols_array(_self: Ref) -> [f32; 16] { let output: [f32; 16] = bevy::math::Mat4::to_cols_array(&_self).into(); output } - fn to_cols_array_2d(_self: Ref) { + /// Creates a `[[f32; 4]; 4]` 4D array storing data in column major order. + /// If you require data in row major order `transpose` the matrix first. + fn to_cols_array_2d(_self: Ref) -> [[f32; 4]; 4] { let output: [[f32; 4]; 4] = bevy::math::Mat4::to_cols_array_2d(&_self).into(); output } - fn to_euler(_self: Ref, order: Val) { + /// Extract Euler angles with the given Euler rotation order. + /// Note if the upper 3x3 matrix contain scales, shears, or other non-rotation transformations + /// then the resulting Euler angles will be ill-defined. + /// # Panics + /// Will panic if any column of the upper 3x3 rotation matrix is not normalized when + /// `glam_assert` is enabled. + fn to_euler( + _self: Ref, + order: Val, + ) -> (f32, f32, f32) { let output: (f32, f32, f32) = bevy::math::Mat4::to_euler( &_self, order.into_inner(), @@ -12466,7 +18144,18 @@ impl bevy::math::Mat4 { .into(); output } - fn transform_point3(_self: Ref, rhs: Val) { + /// Transforms the given 3D vector as a point. + /// This is the equivalent of multiplying the 3D vector as a 4D vector where `w` is + /// `1.0`. + /// This method assumes that `self` contains a valid affine transform. It does not perform + /// a perspective divide, if `self` contains a perspective transform, or if you are unsure, + /// the [`Self::project_point3()`] method should be used instead. + /// # Panics + /// Will panic if the 3rd row of `self` is not `(0, 0, 0, 1)` when `glam_assert` is enabled. + fn transform_point3( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Mat4::transform_point3( &_self, rhs.into_inner(), @@ -12474,7 +18163,12 @@ impl bevy::math::Mat4 { .into(); output } - fn transform_point3a(_self: Ref, rhs: Val) { + /// Transforms the given [`Vec3A`] as 3D point. + /// This is the equivalent of multiplying the [`Vec3A`] as a 4D vector where `w` is `1.0`. + fn transform_point3a( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Mat4::transform_point3a( &_self, rhs.into_inner(), @@ -12482,7 +18176,16 @@ impl bevy::math::Mat4 { .into(); output } - fn transform_vector3(_self: Ref, rhs: Val) { + /// Transforms the give 3D vector as a direction. + /// This is the equivalent of multiplying the 3D vector as a 4D vector where `w` is + /// `0.0`. + /// This method assumes that `self` contains a valid affine transform. + /// # Panics + /// Will panic if the 3rd row of `self` is not `(0, 0, 0, 1)` when `glam_assert` is enabled. + fn transform_vector3( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Mat4::transform_vector3( &_self, rhs.into_inner(), @@ -12490,7 +18193,12 @@ impl bevy::math::Mat4 { .into(); output } - fn transform_vector3a(_self: Ref, rhs: Val) { + /// Transforms the give [`Vec3A`] as 3D vector. + /// This is the equivalent of multiplying the [`Vec3A`] as a 4D vector where `w` is `0.0`. + fn transform_vector3a( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Mat4::transform_vector3a( &_self, rhs.into_inner(), @@ -12498,7 +18206,8 @@ impl bevy::math::Mat4 { .into(); output } - fn transpose(_self: Ref) { + /// Returns the transpose of `self`. + fn transpose(_self: Ref) -> Val { let output: Val = bevy::math::Mat4::transpose(&_self).into(); output } @@ -12509,15 +18218,23 @@ impl bevy::math::Mat4 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::DMat2 { - fn abs(_self: Ref) { + /// Takes the absolute value of each element in `self` + fn abs(_self: Ref) -> Val { let output: Val = bevy::math::DMat2::abs(&_self).into(); output } + /// Returns true if the absolute difference of all elements between `self` and `rhs` + /// is less than or equal to `max_abs_diff`. + /// This can be used to compare if two matrices contain similar elements. It works best + /// when comparing with a known value. The `max_abs_diff` that should be used used + /// depends on the values being compared against. + /// For more see + /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). fn abs_diff_eq( _self: Ref, rhs: Val, max_abs_diff: f64, - ) { + ) -> bool { let output: bool = bevy::math::DMat2::abs_diff_eq( &_self, rhs.into_inner(), @@ -12526,62 +18243,79 @@ impl bevy::math::DMat2 { .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add_mat2(_self: Ref, rhs: Ref) { + /// Adds two 2x2 matrices. + fn add_mat2( + _self: Ref, + rhs: Ref, + ) -> Val { let output: Val = bevy::math::DMat2::add_mat2(&_self, &rhs) .into(); output } - fn as_mat2(_self: Ref) { + fn as_mat2(_self: Ref) -> Val { let output: Val = bevy::math::DMat2::as_mat2(&_self).into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn col(_self: Ref, index: usize) { + /// Returns the matrix column for the given `index`. + /// # Panics + /// Panics if `index` is greater than 1. + fn col(_self: Ref, index: usize) -> Val { let output: Val = bevy::math::DMat2::col(&_self, index) .into(); output } - fn determinant(_self: Ref) { + /// Returns the determinant of `self`. + fn determinant(_self: Ref) -> f64 { let output: f64 = bevy::math::DMat2::determinant(&_self).into(); output } - fn div(_self: Val, rhs: f64) { + fn div(_self: Val, rhs: f64) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn div_scalar(_self: Ref, rhs: f64) { + /// Divides a 2x2 matrix by a scalar. + fn div_scalar(_self: Ref, rhs: f64) -> Val { let output: Val = bevy::math::DMat2::div_scalar(&_self, rhs) .into(); output } - fn eq(_self: Ref, rhs: Ref) { + fn eq(_self: Ref, rhs: Ref) -> bool { let output: bool = >::eq(&_self, &rhs) .into(); output } - fn from_angle(angle: f64) { + /// Creates a 2x2 matrix containing a rotation of `angle` (in radians). + fn from_angle(angle: f64) -> Val { let output: Val = bevy::math::DMat2::from_angle(angle).into(); output } - fn from_cols(x_axis: Val, y_axis: Val) { + /// Creates a 2x2 matrix from two column vectors. + fn from_cols( + x_axis: Val, + y_axis: Val, + ) -> Val { let output: Val = bevy::math::DMat2::from_cols( x_axis.into_inner(), y_axis.into_inner(), @@ -12589,19 +18323,29 @@ impl bevy::math::DMat2 { .into(); output } - fn from_diagonal(diagonal: Val) { + /// Creates a 2x2 matrix with its diagonal set to `diagonal` and all other entries set to 0. + fn from_diagonal(diagonal: Val) -> Val { let output: Val = bevy::math::DMat2::from_diagonal( diagonal.into_inner(), ) .into(); output } - fn from_mat3(m: Val) { + /// Creates a 2x2 matrix from a 3x3 matrix, discarding the 2nd row and column. + fn from_mat3(m: Val) -> Val { let output: Val = bevy::math::DMat2::from_mat3(m.into_inner()) .into(); output } - fn from_mat3_minor(m: Val, i: usize, j: usize) { + /// Creates a 2x2 matrix from the minor of the given 3x3 matrix, discarding the `i`th column + /// and `j`th row. + /// # Panics + /// Panics if `i` or `j` is greater than 2. + fn from_mat3_minor( + m: Val, + i: usize, + j: usize, + ) -> Val { let output: Val = bevy::math::DMat2::from_mat3_minor( m.into_inner(), i, @@ -12610,7 +18354,12 @@ impl bevy::math::DMat2 { .into(); output } - fn from_scale_angle(scale: Val, angle: f64) { + /// Creates a 2x2 matrix containing the combining non-uniform `scale` and rotation of + /// `angle` (in radians). + fn from_scale_angle( + scale: Val, + angle: f64, + ) -> Val { let output: Val = bevy::math::DMat2::from_scale_angle( scale.into_inner(), angle, @@ -12618,50 +18367,72 @@ impl bevy::math::DMat2 { .into(); output } - fn inverse(_self: Ref) { + /// Returns the inverse of `self`. + /// If the matrix is not invertible the returned matrix will be invalid. + /// # Panics + /// Will panic if the determinant of `self` is zero when `glam_assert` is enabled. + fn inverse(_self: Ref) -> Val { let output: Val = bevy::math::DMat2::inverse(&_self).into(); output } - fn is_finite(_self: Ref) { + /// Returns `true` if, and only if, all elements are finite. + /// If any element is either `NaN`, positive or negative infinity, this will return `false`. + fn is_finite(_self: Ref) -> bool { let output: bool = bevy::math::DMat2::is_finite(&_self).into(); output } - fn is_nan(_self: Ref) { + /// Returns `true` if any elements are `NaN`. + fn is_nan(_self: Ref) -> bool { let output: bool = bevy::math::DMat2::is_nan(&_self).into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: f64) { + fn mul(_self: Val, rhs: f64) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn mul_mat2(_self: Ref, rhs: Ref) { + /// Multiplies two 2x2 matrices. + fn mul_mat2( + _self: Ref, + rhs: Ref, + ) -> Val { let output: Val = bevy::math::DMat2::mul_mat2(&_self, &rhs) .into(); output } - fn mul_scalar(_self: Ref, rhs: f64) { + /// Multiplies a 2x2 matrix by a scalar. + fn mul_scalar(_self: Ref, rhs: f64) -> Val { let output: Val = bevy::math::DMat2::mul_scalar(&_self, rhs) .into(); output } - fn mul_vec2(_self: Ref, rhs: Val) { + /// Transforms a 2D vector. + fn mul_vec2( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DMat2::mul_vec2( &_self, rhs.into_inner(), @@ -12669,39 +18440,54 @@ impl bevy::math::DMat2 { .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } - fn row(_self: Ref, index: usize) { + /// Returns the matrix row for the given `index`. + /// # Panics + /// Panics if `index` is greater than 1. + fn row(_self: Ref, index: usize) -> Val { let output: Val = bevy::math::DMat2::row(&_self, index) .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub_mat2(_self: Ref, rhs: Ref) { + /// Subtracts two 2x2 matrices. + fn sub_mat2( + _self: Ref, + rhs: Ref, + ) -> Val { let output: Val = bevy::math::DMat2::sub_mat2(&_self, &rhs) .into(); output } - fn to_cols_array(_self: Ref) { + /// Creates a `[f64; 4]` array storing data in column major order. + /// If you require data in row major order `transpose` the matrix first. + fn to_cols_array(_self: Ref) -> [f64; 4] { let output: [f64; 4] = bevy::math::DMat2::to_cols_array(&_self).into(); output } - fn to_cols_array_2d(_self: Ref) { + /// Creates a `[[f64; 2]; 2]` 2D array storing data in column major order. + /// If you require data in row major order `transpose` the matrix first. + fn to_cols_array_2d(_self: Ref) -> [[f64; 2]; 2] { let output: [[f64; 2]; 2] = bevy::math::DMat2::to_cols_array_2d(&_self).into(); output } - fn transpose(_self: Ref) { + /// Returns the transpose of `self`. + fn transpose(_self: Ref) -> Val { let output: Val = bevy::math::DMat2::transpose(&_self).into(); output } @@ -12712,15 +18498,23 @@ impl bevy::math::DMat2 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::DMat3 { - fn abs(_self: Ref) { + /// Takes the absolute value of each element in `self` + fn abs(_self: Ref) -> Val { let output: Val = bevy::math::DMat3::abs(&_self).into(); output } + /// Returns true if the absolute difference of all elements between `self` and `rhs` + /// is less than or equal to `max_abs_diff`. + /// This can be used to compare if two matrices contain similar elements. It works best + /// when comparing with a known value. The `max_abs_diff` that should be used used + /// depends on the values being compared against. + /// For more see + /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). fn abs_diff_eq( _self: Ref, rhs: Val, max_abs_diff: f64, - ) { + ) -> bool { let output: bool = bevy::math::DMat3::abs_diff_eq( &_self, rhs.into_inner(), @@ -12729,62 +18523,85 @@ impl bevy::math::DMat3 { .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add_mat3(_self: Ref, rhs: Ref) { + /// Adds two 3x3 matrices. + fn add_mat3( + _self: Ref, + rhs: Ref, + ) -> Val { let output: Val = bevy::math::DMat3::add_mat3(&_self, &rhs) .into(); output } - fn as_mat3(_self: Ref) { + fn as_mat3(_self: Ref) -> Val { let output: Val = bevy::math::DMat3::as_mat3(&_self).into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn col(_self: Ref, index: usize) { + /// Returns the matrix column for the given `index`. + /// # Panics + /// Panics if `index` is greater than 2. + fn col(_self: Ref, index: usize) -> Val { let output: Val = bevy::math::DMat3::col(&_self, index) .into(); output } - fn determinant(_self: Ref) { + /// Returns the determinant of `self`. + fn determinant(_self: Ref) -> f64 { let output: f64 = bevy::math::DMat3::determinant(&_self).into(); output } - fn div(_self: Val, rhs: f64) { + fn div(_self: Val, rhs: f64) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn div_scalar(_self: Ref, rhs: f64) { + /// Divides a 3x3 matrix by a scalar. + fn div_scalar(_self: Ref, rhs: f64) -> Val { let output: Val = bevy::math::DMat3::div_scalar(&_self, rhs) .into(); output } - fn eq(_self: Ref, rhs: Ref) { + fn eq(_self: Ref, rhs: Ref) -> bool { let output: bool = >::eq(&_self, &rhs) .into(); output } - fn from_angle(angle: f64) { + /// Creates an affine transformation matrix from the given 2D rotation `angle` (in + /// radians). + /// The resulting matrix can be used to transform 2D points and vectors. See + /// [`Self::transform_point2()`] and [`Self::transform_vector2()`]. + fn from_angle(angle: f64) -> Val { let output: Val = bevy::math::DMat3::from_angle(angle).into(); output } - fn from_axis_angle(axis: Val, angle: f64) { + /// Creates a 3D rotation matrix from a normalized rotation `axis` and `angle` (in + /// radians). + /// # Panics + /// Will panic if `axis` is not normalized when `glam_assert` is enabled. + fn from_axis_angle( + axis: Val, + angle: f64, + ) -> Val { let output: Val = bevy::math::DMat3::from_axis_angle( axis.into_inner(), angle, @@ -12792,11 +18609,12 @@ impl bevy::math::DMat3 { .into(); output } + /// Creates a 3x3 matrix from three column vectors. fn from_cols( x_axis: Val, y_axis: Val, z_axis: Val, - ) { + ) -> Val { let output: Val = bevy::math::DMat3::from_cols( x_axis.into_inner(), y_axis.into_inner(), @@ -12805,14 +18623,22 @@ impl bevy::math::DMat3 { .into(); output } - fn from_diagonal(diagonal: Val) { + /// Creates a 3x3 matrix with its diagonal set to `diagonal` and all other entries set to 0. + fn from_diagonal(diagonal: Val) -> Val { let output: Val = bevy::math::DMat3::from_diagonal( diagonal.into_inner(), ) .into(); output } - fn from_euler(order: Val, a: f64, b: f64, c: f64) { + /// Creates a 3D rotation matrix from the given euler rotation sequence and the angles (in + /// radians). + fn from_euler( + order: Val, + a: f64, + b: f64, + c: f64, + ) -> Val { let output: Val = bevy::math::DMat3::from_euler( order.into_inner(), a, @@ -12822,17 +18648,29 @@ impl bevy::math::DMat3 { .into(); output } - fn from_mat2(m: Val) { + /// Creates an affine transformation matrix from the given 2x2 matrix. + /// The resulting matrix can be used to transform 2D points and vectors. See + /// [`Self::transform_point2()`] and [`Self::transform_vector2()`]. + fn from_mat2(m: Val) -> Val { let output: Val = bevy::math::DMat3::from_mat2(m.into_inner()) .into(); output } - fn from_mat4(m: Val) { + /// Creates a 3x3 matrix from a 4x4 matrix, discarding the 4th row and column. + fn from_mat4(m: Val) -> Val { let output: Val = bevy::math::DMat3::from_mat4(m.into_inner()) .into(); output } - fn from_mat4_minor(m: Val, i: usize, j: usize) { + /// Creates a 3x3 matrix from the minor of the given 4x4 matrix, discarding the `i`th column + /// and `j`th row. + /// # Panics + /// Panics if `i` or `j` is greater than 3. + fn from_mat4_minor( + m: Val, + i: usize, + j: usize, + ) -> Val { let output: Val = bevy::math::DMat3::from_mat4_minor( m.into_inner(), i, @@ -12841,40 +18679,55 @@ impl bevy::math::DMat3 { .into(); output } - fn from_quat(rotation: Val) { + /// Creates a 3D rotation matrix from the given quaternion. + /// # Panics + /// Will panic if `rotation` is not normalized when `glam_assert` is enabled. + fn from_quat(rotation: Val) -> Val { let output: Val = bevy::math::DMat3::from_quat( rotation.into_inner(), ) .into(); output } - fn from_rotation_x(angle: f64) { + /// Creates a 3D rotation matrix from `angle` (in radians) around the x axis. + fn from_rotation_x(angle: f64) -> Val { let output: Val = bevy::math::DMat3::from_rotation_x(angle) .into(); output } - fn from_rotation_y(angle: f64) { + /// Creates a 3D rotation matrix from `angle` (in radians) around the y axis. + fn from_rotation_y(angle: f64) -> Val { let output: Val = bevy::math::DMat3::from_rotation_y(angle) .into(); output } - fn from_rotation_z(angle: f64) { + /// Creates a 3D rotation matrix from `angle` (in radians) around the z axis. + fn from_rotation_z(angle: f64) -> Val { let output: Val = bevy::math::DMat3::from_rotation_z(angle) .into(); output } - fn from_scale(scale: Val) { + /// Creates an affine transformation matrix from the given non-uniform 2D `scale`. + /// The resulting matrix can be used to transform 2D points and vectors. See + /// [`Self::transform_point2()`] and [`Self::transform_vector2()`]. + /// # Panics + /// Will panic if all elements of `scale` are zero when `glam_assert` is enabled. + fn from_scale(scale: Val) -> Val { let output: Val = bevy::math::DMat3::from_scale( scale.into_inner(), ) .into(); output } + /// Creates an affine transformation matrix from the given 2D `scale`, rotation `angle` (in + /// radians) and `translation`. + /// The resulting matrix can be used to transform 2D points and vectors. See + /// [`Self::transform_point2()`] and [`Self::transform_vector2()`]. fn from_scale_angle_translation( scale: Val, angle: f64, translation: Val, - ) { + ) -> Val { let output: Val = bevy::math::DMat3::from_scale_angle_translation( scale.into_inner(), angle, @@ -12883,64 +18736,92 @@ impl bevy::math::DMat3 { .into(); output } - fn from_translation(translation: Val) { + /// Creates an affine transformation matrix from the given 2D `translation`. + /// The resulting matrix can be used to transform 2D points and vectors. See + /// [`Self::transform_point2()`] and [`Self::transform_vector2()`]. + fn from_translation(translation: Val) -> Val { let output: Val = bevy::math::DMat3::from_translation( translation.into_inner(), ) .into(); output } - fn inverse(_self: Ref) { + /// Returns the inverse of `self`. + /// If the matrix is not invertible the returned matrix will be invalid. + /// # Panics + /// Will panic if the determinant of `self` is zero when `glam_assert` is enabled. + fn inverse(_self: Ref) -> Val { let output: Val = bevy::math::DMat3::inverse(&_self).into(); output } - fn is_finite(_self: Ref) { + /// Returns `true` if, and only if, all elements are finite. + /// If any element is either `NaN`, positive or negative infinity, this will return `false`. + fn is_finite(_self: Ref) -> bool { let output: bool = bevy::math::DMat3::is_finite(&_self).into(); output } - fn is_nan(_self: Ref) { + /// Returns `true` if any elements are `NaN`. + fn is_nan(_self: Ref) -> bool { let output: bool = bevy::math::DMat3::is_nan(&_self).into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: f64) { + fn mul(_self: Val, rhs: f64) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn mul_mat3(_self: Ref, rhs: Ref) { + /// Multiplies two 3x3 matrices. + fn mul_mat3( + _self: Ref, + rhs: Ref, + ) -> Val { let output: Val = bevy::math::DMat3::mul_mat3(&_self, &rhs) .into(); output } - fn mul_scalar(_self: Ref, rhs: f64) { + /// Multiplies a 3x3 matrix by a scalar. + fn mul_scalar(_self: Ref, rhs: f64) -> Val { let output: Val = bevy::math::DMat3::mul_scalar(&_self, rhs) .into(); output } - fn mul_vec3(_self: Ref, rhs: Val) { + /// Transforms a 3D vector. + fn mul_vec3( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DMat3::mul_vec3( &_self, rhs.into_inner(), @@ -12948,39 +18829,61 @@ impl bevy::math::DMat3 { .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } - fn row(_self: Ref, index: usize) { + /// Returns the matrix row for the given `index`. + /// # Panics + /// Panics if `index` is greater than 2. + fn row(_self: Ref, index: usize) -> Val { let output: Val = bevy::math::DMat3::row(&_self, index) .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub_mat3(_self: Ref, rhs: Ref) { + /// Subtracts two 3x3 matrices. + fn sub_mat3( + _self: Ref, + rhs: Ref, + ) -> Val { let output: Val = bevy::math::DMat3::sub_mat3(&_self, &rhs) .into(); output } - fn to_cols_array(_self: Ref) { + /// Creates a `[f64; 9]` array storing data in column major order. + /// If you require data in row major order `transpose` the matrix first. + fn to_cols_array(_self: Ref) -> [f64; 9] { let output: [f64; 9] = bevy::math::DMat3::to_cols_array(&_self).into(); output } - fn to_cols_array_2d(_self: Ref) { + /// Creates a `[[f64; 3]; 3]` 3D array storing data in column major order. + /// If you require data in row major order `transpose` the matrix first. + fn to_cols_array_2d(_self: Ref) -> [[f64; 3]; 3] { let output: [[f64; 3]; 3] = bevy::math::DMat3::to_cols_array_2d(&_self).into(); output } - fn to_euler(_self: Ref, order: Val) { + /// Extract Euler angles with the given Euler rotation order. + /// Note if the input matrix contains scales, shears, or other non-rotation transformations then + /// the resulting Euler angles will be ill-defined. + /// # Panics + /// Will panic if any input matrix column is not normalized when `glam_assert` is enabled. + fn to_euler( + _self: Ref, + order: Val, + ) -> (f64, f64, f64) { let output: (f64, f64, f64) = bevy::math::DMat3::to_euler( &_self, order.into_inner(), @@ -12988,7 +18891,15 @@ impl bevy::math::DMat3 { .into(); output } - fn transform_point2(_self: Ref, rhs: Val) { + /// Transforms the given 2D vector as a point. + /// This is the equivalent of multiplying `rhs` as a 3D vector where `z` is `1`. + /// This method assumes that `self` contains a valid affine transform. + /// # Panics + /// Will panic if the 2nd row of `self` is not `(0, 0, 1)` when `glam_assert` is enabled. + fn transform_point2( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DMat3::transform_point2( &_self, rhs.into_inner(), @@ -12996,7 +18907,15 @@ impl bevy::math::DMat3 { .into(); output } - fn transform_vector2(_self: Ref, rhs: Val) { + /// Rotates the given 2D vector. + /// This is the equivalent of multiplying `rhs` as a 3D vector where `z` is `0`. + /// This method assumes that `self` contains a valid affine transform. + /// # Panics + /// Will panic if the 2nd row of `self` is not `(0, 0, 1)` when `glam_assert` is enabled. + fn transform_vector2( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DMat3::transform_vector2( &_self, rhs.into_inner(), @@ -13004,7 +18923,8 @@ impl bevy::math::DMat3 { .into(); output } - fn transpose(_self: Ref) { + /// Returns the transpose of `self`. + fn transpose(_self: Ref) -> Val { let output: Val = bevy::math::DMat3::transpose(&_self).into(); output } @@ -13015,15 +18935,23 @@ impl bevy::math::DMat3 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::DMat4 { - fn abs(_self: Ref) { + /// Takes the absolute value of each element in `self` + fn abs(_self: Ref) -> Val { let output: Val = bevy::math::DMat4::abs(&_self).into(); output } + /// Returns true if the absolute difference of all elements between `self` and `rhs` + /// is less than or equal to `max_abs_diff`. + /// This can be used to compare if two matrices contain similar elements. It works best + /// when comparing with a known value. The `max_abs_diff` that should be used used + /// depends on the values being compared against. + /// For more see + /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). fn abs_diff_eq( _self: Ref, rhs: Val, max_abs_diff: f64, - ) { + ) -> bool { let output: bool = bevy::math::DMat4::abs_diff_eq( &_self, rhs.into_inner(), @@ -13032,58 +18960,79 @@ impl bevy::math::DMat4 { .into(); output } - fn add(_self: Val, rhs: Val) { + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn add_mat4(_self: Ref, rhs: Ref) { + /// Adds two 4x4 matrices. + fn add_mat4( + _self: Ref, + rhs: Ref, + ) -> Val { let output: Val = bevy::math::DMat4::add_mat4(&_self, &rhs) .into(); output } - fn as_mat4(_self: Ref) { + fn as_mat4(_self: Ref) -> Val { let output: Val = bevy::math::DMat4::as_mat4(&_self).into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn col(_self: Ref, index: usize) { + /// Returns the matrix column for the given `index`. + /// # Panics + /// Panics if `index` is greater than 3. + fn col(_self: Ref, index: usize) -> Val { let output: Val = bevy::math::DMat4::col(&_self, index) .into(); output } - fn determinant(_self: Ref) { + /// Returns the determinant of `self`. + fn determinant(_self: Ref) -> f64 { let output: f64 = bevy::math::DMat4::determinant(&_self).into(); output } - fn div(_self: Val, rhs: f64) { + fn div(_self: Val, rhs: f64) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn div_scalar(_self: Ref, rhs: f64) { + /// Divides a 4x4 matrix by a scalar. + fn div_scalar(_self: Ref, rhs: f64) -> Val { let output: Val = bevy::math::DMat4::div_scalar(&_self, rhs) .into(); output } - fn eq(_self: Ref, rhs: Ref) { + fn eq(_self: Ref, rhs: Ref) -> bool { let output: bool = >::eq(&_self, &rhs) .into(); output } - fn from_axis_angle(axis: Val, angle: f64) { + /// Creates an affine transformation matrix containing a 3D rotation around a normalized + /// rotation `axis` of `angle` (in radians). + /// The resulting matrix can be used to transform 3D points and vectors. See + /// [`Self::transform_point3()`] and [`Self::transform_vector3()`]. + /// # Panics + /// Will panic if `axis` is not normalized when `glam_assert` is enabled. + fn from_axis_angle( + axis: Val, + angle: f64, + ) -> Val { let output: Val = bevy::math::DMat4::from_axis_angle( axis.into_inner(), angle, @@ -13091,12 +19040,13 @@ impl bevy::math::DMat4 { .into(); output } + /// Creates a 4x4 matrix from four column vectors. fn from_cols( x_axis: Val, y_axis: Val, z_axis: Val, w_axis: Val, - ) { + ) -> Val { let output: Val = bevy::math::DMat4::from_cols( x_axis.into_inner(), y_axis.into_inner(), @@ -13106,14 +19056,24 @@ impl bevy::math::DMat4 { .into(); output } - fn from_diagonal(diagonal: Val) { + /// Creates a 4x4 matrix with its diagonal set to `diagonal` and all other entries set to 0. + fn from_diagonal(diagonal: Val) -> Val { let output: Val = bevy::math::DMat4::from_diagonal( diagonal.into_inner(), ) .into(); output } - fn from_euler(order: Val, a: f64, b: f64, c: f64) { + /// Creates a affine transformation matrix containing a rotation from the given euler + /// rotation sequence and angles (in radians). + /// The resulting matrix can be used to transform 3D points and vectors. See + /// [`Self::transform_point3()`] and [`Self::transform_vector3()`]. + fn from_euler( + order: Val, + a: f64, + b: f64, + c: f64, + ) -> Val { let output: Val = bevy::math::DMat4::from_euler( order.into_inner(), a, @@ -13123,22 +19083,36 @@ impl bevy::math::DMat4 { .into(); output } - fn from_mat3(m: Val) { + /// Creates an affine transformation matrix from the given 3x3 linear transformation + /// matrix. + /// The resulting matrix can be used to transform 3D points and vectors. See + /// [`Self::transform_point3()`] and [`Self::transform_vector3()`]. + fn from_mat3(m: Val) -> Val { let output: Val = bevy::math::DMat4::from_mat3(m.into_inner()) .into(); output } - fn from_quat(rotation: Val) { + /// Creates an affine transformation matrix from the given `rotation` quaternion. + /// The resulting matrix can be used to transform 3D points and vectors. See + /// [`Self::transform_point3()`] and [`Self::transform_vector3()`]. + /// # Panics + /// Will panic if `rotation` is not normalized when `glam_assert` is enabled. + fn from_quat(rotation: Val) -> Val { let output: Val = bevy::math::DMat4::from_quat( rotation.into_inner(), ) .into(); output } + /// Creates an affine transformation matrix from the given 3D `translation`. + /// The resulting matrix can be used to transform 3D points and vectors. See + /// [`Self::transform_point3()`] and [`Self::transform_vector3()`]. + /// # Panics + /// Will panic if `rotation` is not normalized when `glam_assert` is enabled. fn from_rotation_translation( rotation: Val, translation: Val, - ) { + ) -> Val { let output: Val = bevy::math::DMat4::from_rotation_translation( rotation.into_inner(), translation.into_inner(), @@ -13146,33 +19120,56 @@ impl bevy::math::DMat4 { .into(); output } - fn from_rotation_x(angle: f64) { + /// Creates an affine transformation matrix containing a 3D rotation around the x axis of + /// `angle` (in radians). + /// The resulting matrix can be used to transform 3D points and vectors. See + /// [`Self::transform_point3()`] and [`Self::transform_vector3()`]. + fn from_rotation_x(angle: f64) -> Val { let output: Val = bevy::math::DMat4::from_rotation_x(angle) .into(); output } - fn from_rotation_y(angle: f64) { + /// Creates an affine transformation matrix containing a 3D rotation around the y axis of + /// `angle` (in radians). + /// The resulting matrix can be used to transform 3D points and vectors. See + /// [`Self::transform_point3()`] and [`Self::transform_vector3()`]. + fn from_rotation_y(angle: f64) -> Val { let output: Val = bevy::math::DMat4::from_rotation_y(angle) .into(); output } - fn from_rotation_z(angle: f64) { + /// Creates an affine transformation matrix containing a 3D rotation around the z axis of + /// `angle` (in radians). + /// The resulting matrix can be used to transform 3D points and vectors. See + /// [`Self::transform_point3()`] and [`Self::transform_vector3()`]. + fn from_rotation_z(angle: f64) -> Val { let output: Val = bevy::math::DMat4::from_rotation_z(angle) .into(); output } - fn from_scale(scale: Val) { + /// Creates an affine transformation matrix containing the given 3D non-uniform `scale`. + /// The resulting matrix can be used to transform 3D points and vectors. See + /// [`Self::transform_point3()`] and [`Self::transform_vector3()`]. + /// # Panics + /// Will panic if all elements of `scale` are zero when `glam_assert` is enabled. + fn from_scale(scale: Val) -> Val { let output: Val = bevy::math::DMat4::from_scale( scale.into_inner(), ) .into(); output } + /// Creates an affine transformation matrix from the given 3D `scale`, `rotation` and + /// `translation`. + /// The resulting matrix can be used to transform 3D points and vectors. See + /// [`Self::transform_point3()`] and [`Self::transform_vector3()`]. + /// # Panics + /// Will panic if `rotation` is not normalized when `glam_assert` is enabled. fn from_scale_rotation_translation( scale: Val, rotation: Val, translation: Val, - ) { + ) -> Val { let output: Val = bevy::math::DMat4::from_scale_rotation_translation( scale.into_inner(), rotation.into_inner(), @@ -13181,30 +19178,45 @@ impl bevy::math::DMat4 { .into(); output } - fn from_translation(translation: Val) { + /// Creates an affine transformation matrix from the given 3D `translation`. + /// The resulting matrix can be used to transform 3D points and vectors. See + /// [`Self::transform_point3()`] and [`Self::transform_vector3()`]. + fn from_translation(translation: Val) -> Val { let output: Val = bevy::math::DMat4::from_translation( translation.into_inner(), ) .into(); output } - fn inverse(_self: Ref) { + /// Returns the inverse of `self`. + /// If the matrix is not invertible the returned matrix will be invalid. + /// # Panics + /// Will panic if the determinant of `self` is zero when `glam_assert` is enabled. + fn inverse(_self: Ref) -> Val { let output: Val = bevy::math::DMat4::inverse(&_self).into(); output } - fn is_finite(_self: Ref) { + /// Returns `true` if, and only if, all elements are finite. + /// If any element is either `NaN`, positive or negative infinity, this will return `false`. + fn is_finite(_self: Ref) -> bool { let output: bool = bevy::math::DMat4::is_finite(&_self).into(); output } - fn is_nan(_self: Ref) { + /// Returns `true` if any elements are `NaN`. + fn is_nan(_self: Ref) -> bool { let output: bool = bevy::math::DMat4::is_nan(&_self).into(); output } + /// Creates a left-handed view matrix using a camera position, an up direction, and a focal + /// point. + /// For a view coordinate system with `+X=right`, `+Y=up` and `+Z=forward`. + /// # Panics + /// Will panic if `up` is not normalized when `glam_assert` is enabled. fn look_at_lh( eye: Val, center: Val, up: Val, - ) { + ) -> Val { let output: Val = bevy::math::DMat4::look_at_lh( eye.into_inner(), center.into_inner(), @@ -13213,11 +19225,16 @@ impl bevy::math::DMat4 { .into(); output } + /// Creates a right-handed view matrix using a camera position, an up direction, and a focal + /// point. + /// For a view coordinate system with `+X=right`, `+Y=up` and `+Z=back`. + /// # Panics + /// Will panic if `up` is not normalized when `glam_assert` is enabled. fn look_at_rh( eye: Val, center: Val, up: Val, - ) { + ) -> Val { let output: Val = bevy::math::DMat4::look_at_rh( eye.into_inner(), center.into_inner(), @@ -13226,11 +19243,14 @@ impl bevy::math::DMat4 { .into(); output } + /// Creates a left-handed view matrix using a camera position, an up direction, and a facing + /// direction. + /// For a view coordinate system with `+X=right`, `+Y=up` and `+Z=forward`. fn look_to_lh( eye: Val, dir: Val, up: Val, - ) { + ) -> Val { let output: Val = bevy::math::DMat4::look_to_lh( eye.into_inner(), dir.into_inner(), @@ -13239,11 +19259,14 @@ impl bevy::math::DMat4 { .into(); output } + /// Creates a right-handed view matrix using a camera position, an up direction, and a facing + /// direction. + /// For a view coordinate system with `+X=right`, `+Y=up` and `+Z=back`. fn look_to_rh( eye: Val, dir: Val, up: Val, - ) { + ) -> Val { let output: Val = bevy::math::DMat4::look_to_rh( eye.into_inner(), dir.into_inner(), @@ -13252,45 +19275,63 @@ impl bevy::math::DMat4 { .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: f64) { + fn mul(_self: Val, rhs: f64) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn mul_mat4(_self: Ref, rhs: Ref) { + /// Multiplies two 4x4 matrices. + fn mul_mat4( + _self: Ref, + rhs: Ref, + ) -> Val { let output: Val = bevy::math::DMat4::mul_mat4(&_self, &rhs) .into(); output } - fn mul_scalar(_self: Ref, rhs: f64) { + /// Multiplies a 4x4 matrix by a scalar. + fn mul_scalar(_self: Ref, rhs: f64) -> Val { let output: Val = bevy::math::DMat4::mul_scalar(&_self, rhs) .into(); output } - fn mul_vec4(_self: Ref, rhs: Val) { + /// Transforms a 4D vector. + fn mul_vec4( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DMat4::mul_vec4( &_self, rhs.into_inner(), @@ -13298,13 +19339,15 @@ impl bevy::math::DMat4 { .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } + /// Creates a left-handed orthographic projection matrix with `[0,1]` depth range. + /// Useful to map a left-handed coordinate system to the normalized device coordinates that WebGPU/Direct3D/Metal expect. fn orthographic_lh( left: f64, right: f64, @@ -13312,7 +19355,7 @@ impl bevy::math::DMat4 { top: f64, near: f64, far: f64, - ) { + ) -> Val { let output: Val = bevy::math::DMat4::orthographic_lh( left, right, @@ -13324,6 +19367,8 @@ impl bevy::math::DMat4 { .into(); output } + /// Creates a right-handed orthographic projection matrix with `[0,1]` depth range. + /// Useful to map a right-handed coordinate system to the normalized device coordinates that WebGPU/Direct3D/Metal expect. fn orthographic_rh( left: f64, right: f64, @@ -13331,7 +19376,7 @@ impl bevy::math::DMat4 { top: f64, near: f64, far: f64, - ) { + ) -> Val { let output: Val = bevy::math::DMat4::orthographic_rh( left, right, @@ -13343,6 +19388,11 @@ impl bevy::math::DMat4 { .into(); output } + /// Creates a right-handed orthographic projection matrix with `[-1,1]` depth + /// range. This is the same as the OpenGL `glOrtho` function in OpenGL. + /// See + /// + /// Useful to map a right-handed coordinate system to the normalized device coordinates that OpenGL expects. fn orthographic_rh_gl( left: f64, right: f64, @@ -13350,7 +19400,7 @@ impl bevy::math::DMat4 { top: f64, near: f64, far: f64, - ) { + ) -> Val { let output: Val = bevy::math::DMat4::orthographic_rh_gl( left, right, @@ -13362,7 +19412,17 @@ impl bevy::math::DMat4 { .into(); output } - fn perspective_infinite_lh(fov_y_radians: f64, aspect_ratio: f64, z_near: f64) { + /// Creates an infinite left-handed perspective projection matrix with `[0,1]` depth range. + /// Like `perspective_lh`, but with an infinite value for `z_far`. + /// The result is that points near `z_near` are mapped to depth `0`, and as they move towards infinity the depth approaches `1`. + /// # Panics + /// Will panic if `z_near` or `z_far` are less than or equal to zero when `glam_assert` is + /// enabled. + fn perspective_infinite_lh( + fov_y_radians: f64, + aspect_ratio: f64, + z_near: f64, + ) -> Val { let output: Val = bevy::math::DMat4::perspective_infinite_lh( fov_y_radians, aspect_ratio, @@ -13371,11 +19431,15 @@ impl bevy::math::DMat4 { .into(); output } + /// Creates an infinite reverse left-handed perspective projection matrix with `[0,1]` depth range. + /// Similar to `perspective_infinite_lh`, but maps `Z = z_near` to a depth of `1` and `Z = infinity` to a depth of `0`. + /// # Panics + /// Will panic if `z_near` is less than or equal to zero when `glam_assert` is enabled. fn perspective_infinite_reverse_lh( fov_y_radians: f64, aspect_ratio: f64, z_near: f64, - ) { + ) -> Val { let output: Val = bevy::math::DMat4::perspective_infinite_reverse_lh( fov_y_radians, aspect_ratio, @@ -13384,11 +19448,15 @@ impl bevy::math::DMat4 { .into(); output } + /// Creates an infinite reverse right-handed perspective projection matrix with `[0,1]` depth range. + /// Similar to `perspective_infinite_rh`, but maps `Z = z_near` to a depth of `1` and `Z = infinity` to a depth of `0`. + /// # Panics + /// Will panic if `z_near` is less than or equal to zero when `glam_assert` is enabled. fn perspective_infinite_reverse_rh( fov_y_radians: f64, aspect_ratio: f64, z_near: f64, - ) { + ) -> Val { let output: Val = bevy::math::DMat4::perspective_infinite_reverse_rh( fov_y_radians, aspect_ratio, @@ -13397,7 +19465,17 @@ impl bevy::math::DMat4 { .into(); output } - fn perspective_infinite_rh(fov_y_radians: f64, aspect_ratio: f64, z_near: f64) { + /// Creates an infinite right-handed perspective projection matrix with `[0,1]` depth range. + /// Like `perspective_rh`, but with an infinite value for `z_far`. + /// The result is that points near `z_near` are mapped to depth `0`, and as they move towards infinity the depth approaches `1`. + /// # Panics + /// Will panic if `z_near` or `z_far` are less than or equal to zero when `glam_assert` is + /// enabled. + fn perspective_infinite_rh( + fov_y_radians: f64, + aspect_ratio: f64, + z_near: f64, + ) -> Val { let output: Val = bevy::math::DMat4::perspective_infinite_rh( fov_y_radians, aspect_ratio, @@ -13406,7 +19484,17 @@ impl bevy::math::DMat4 { .into(); output } - fn perspective_lh(fov_y_radians: f64, aspect_ratio: f64, z_near: f64, z_far: f64) { + /// Creates a left-handed perspective projection matrix with `[0,1]` depth range. + /// Useful to map the standard left-handed coordinate system into what WebGPU/Metal/Direct3D expect. + /// # Panics + /// Will panic if `z_near` or `z_far` are less than or equal to zero when `glam_assert` is + /// enabled. + fn perspective_lh( + fov_y_radians: f64, + aspect_ratio: f64, + z_near: f64, + z_far: f64, + ) -> Val { let output: Val = bevy::math::DMat4::perspective_lh( fov_y_radians, aspect_ratio, @@ -13416,7 +19504,17 @@ impl bevy::math::DMat4 { .into(); output } - fn perspective_rh(fov_y_radians: f64, aspect_ratio: f64, z_near: f64, z_far: f64) { + /// Creates a right-handed perspective projection matrix with `[0,1]` depth range. + /// Useful to map the standard right-handed coordinate system into what WebGPU/Metal/Direct3D expect. + /// # Panics + /// Will panic if `z_near` or `z_far` are less than or equal to zero when `glam_assert` is + /// enabled. + fn perspective_rh( + fov_y_radians: f64, + aspect_ratio: f64, + z_near: f64, + z_far: f64, + ) -> Val { let output: Val = bevy::math::DMat4::perspective_rh( fov_y_radians, aspect_ratio, @@ -13426,12 +19524,16 @@ impl bevy::math::DMat4 { .into(); output } + /// Creates a right-handed perspective projection matrix with `[-1,1]` depth range. + /// Useful to map the standard right-handed coordinate system into what OpenGL expects. + /// This is the same as the OpenGL `gluPerspective` function. + /// See fn perspective_rh_gl( fov_y_radians: f64, aspect_ratio: f64, z_near: f64, z_far: f64, - ) { + ) -> Val { let output: Val = bevy::math::DMat4::perspective_rh_gl( fov_y_radians, aspect_ratio, @@ -13441,7 +19543,14 @@ impl bevy::math::DMat4 { .into(); output } - fn project_point3(_self: Ref, rhs: Val) { + /// Transforms the given 3D vector as a point, applying perspective correction. + /// This is the equivalent of multiplying the 3D vector as a 4D vector where `w` is `1.0`. + /// The perspective divide is performed meaning the resulting 3D vector is divided by `w`. + /// This method assumes that `self` contains a projective transform. + fn project_point3( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DMat4::project_point3( &_self, rhs.into_inner(), @@ -13449,32 +19558,55 @@ impl bevy::math::DMat4 { .into(); output } - fn row(_self: Ref, index: usize) { + /// Returns the matrix row for the given `index`. + /// # Panics + /// Panics if `index` is greater than 3. + fn row(_self: Ref, index: usize) -> Val { let output: Val = bevy::math::DMat4::row(&_self, index) .into(); output } - fn sub(_self: Val, rhs: Val) { + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn sub_mat4(_self: Ref, rhs: Ref) { + /// Subtracts two 4x4 matrices. + fn sub_mat4( + _self: Ref, + rhs: Ref, + ) -> Val { let output: Val = bevy::math::DMat4::sub_mat4(&_self, &rhs) .into(); output } - fn to_cols_array(_self: Ref) { + /// Creates a `[f64; 16]` array storing data in column major order. + /// If you require data in row major order `transpose` the matrix first. + fn to_cols_array(_self: Ref) -> [f64; 16] { let output: [f64; 16] = bevy::math::DMat4::to_cols_array(&_self).into(); output } - fn to_cols_array_2d(_self: Ref) { + /// Creates a `[[f64; 4]; 4]` 4D array storing data in column major order. + /// If you require data in row major order `transpose` the matrix first. + fn to_cols_array_2d(_self: Ref) -> [[f64; 4]; 4] { let output: [[f64; 4]; 4] = bevy::math::DMat4::to_cols_array_2d(&_self).into(); output } - fn to_euler(_self: Ref, order: Val) { + /// Extract Euler angles with the given Euler rotation order. + /// Note if the upper 3x3 matrix contain scales, shears, or other non-rotation transformations + /// then the resulting Euler angles will be ill-defined. + /// # Panics + /// Will panic if any column of the upper 3x3 rotation matrix is not normalized when + /// `glam_assert` is enabled. + fn to_euler( + _self: Ref, + order: Val, + ) -> (f64, f64, f64) { let output: (f64, f64, f64) = bevy::math::DMat4::to_euler( &_self, order.into_inner(), @@ -13482,7 +19614,18 @@ impl bevy::math::DMat4 { .into(); output } - fn transform_point3(_self: Ref, rhs: Val) { + /// Transforms the given 3D vector as a point. + /// This is the equivalent of multiplying the 3D vector as a 4D vector where `w` is + /// `1.0`. + /// This method assumes that `self` contains a valid affine transform. It does not perform + /// a perspective divide, if `self` contains a perspective transform, or if you are unsure, + /// the [`Self::project_point3()`] method should be used instead. + /// # Panics + /// Will panic if the 3rd row of `self` is not `(0, 0, 0, 1)` when `glam_assert` is enabled. + fn transform_point3( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DMat4::transform_point3( &_self, rhs.into_inner(), @@ -13490,7 +19633,16 @@ impl bevy::math::DMat4 { .into(); output } - fn transform_vector3(_self: Ref, rhs: Val) { + /// Transforms the give 3D vector as a direction. + /// This is the equivalent of multiplying the 3D vector as a 4D vector where `w` is + /// `0.0`. + /// This method assumes that `self` contains a valid affine transform. + /// # Panics + /// Will panic if the 3rd row of `self` is not `(0, 0, 0, 1)` when `glam_assert` is enabled. + fn transform_vector3( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DMat4::transform_vector3( &_self, rhs.into_inner(), @@ -13498,7 +19650,8 @@ impl bevy::math::DMat4 { .into(); output } - fn transpose(_self: Ref) { + /// Returns the transpose of `self`. + fn transpose(_self: Ref) -> Val { let output: Val = bevy::math::DMat4::transpose(&_self).into(); output } @@ -13509,11 +19662,18 @@ impl bevy::math::DMat4 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::Affine2 { + /// Returns true if the absolute difference of all elements between `self` and `rhs` + /// is less than or equal to `max_abs_diff`. + /// This can be used to compare if two 3x4 matrices contain similar elements. It works + /// best when comparing with a known value. The `max_abs_diff` that should be used used + /// depends on the values being compared against. + /// For more see + /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). fn abs_diff_eq( _self: Ref, rhs: Val, max_abs_diff: f32, - ) { + ) -> bool { let output: bool = bevy::math::Affine2::abs_diff_eq( &_self, rhs.into_inner(), @@ -13522,26 +19682,33 @@ impl bevy::math::Affine2 { .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, rhs: Ref) { + fn eq(_self: Ref, rhs: Ref) -> bool { let output: bool = >::eq(&_self, &rhs) .into(); output } - fn from_angle(angle: f32) { + /// Creates an affine transform from the given rotation `angle`. + fn from_angle(angle: f32) -> Val { let output: Val = bevy::math::Affine2::from_angle(angle) .into(); output } - fn from_angle_translation(angle: f32, translation: Val) { + /// Creates an affine transform from the given 2D rotation `angle` (in radians) and + /// `translation`. + /// Equivalent to `Affine2::from_translation(translation) * Affine2::from_angle(angle)` + fn from_angle_translation( + angle: f32, + translation: Val, + ) -> Val { let output: Val = bevy::math::Affine2::from_angle_translation( angle, translation.into_inner(), @@ -13549,11 +19716,12 @@ impl bevy::math::Affine2 { .into(); output } + /// Creates an affine transform from three column vectors. fn from_cols( x_axis: Val, y_axis: Val, z_axis: Val, - ) { + ) -> Val { let output: Val = bevy::math::Affine2::from_cols( x_axis.into_inner(), y_axis.into_inner(), @@ -13562,17 +19730,22 @@ impl bevy::math::Affine2 { .into(); output } - fn from_mat2(matrix2: Val) { + /// Creates an affine transform from a 2x2 matrix (expressing scale, shear and rotation) + fn from_mat2(matrix2: Val) -> Val { let output: Val = bevy::math::Affine2::from_mat2( matrix2.into_inner(), ) .into(); output } + /// Creates an affine transform from a 2x2 matrix (expressing scale, shear and rotation) and a + /// translation vector. + /// Equivalent to + /// `Affine2::from_translation(translation) * Affine2::from_mat2(mat2)` fn from_mat2_translation( matrix2: Val, translation: Val, - ) { + ) -> Val { let output: Val = bevy::math::Affine2::from_mat2_translation( matrix2.into_inner(), translation.into_inner(), @@ -13580,32 +19753,40 @@ impl bevy::math::Affine2 { .into(); output } - fn from_mat3(m: Val) { + /// The given `Mat3` must be an affine transform, + fn from_mat3(m: Val) -> Val { let output: Val = bevy::math::Affine2::from_mat3( m.into_inner(), ) .into(); output } - fn from_mat3a(m: Val) { + /// The given [`Mat3A`] must be an affine transform, + fn from_mat3a(m: Val) -> Val { let output: Val = bevy::math::Affine2::from_mat3a( m.into_inner(), ) .into(); output } - fn from_scale(scale: Val) { + /// Creates an affine transform that changes scale. + /// Note that if any scale is zero the transform will be non-invertible. + fn from_scale(scale: Val) -> Val { let output: Val = bevy::math::Affine2::from_scale( scale.into_inner(), ) .into(); output } + /// Creates an affine transform from the given 2D `scale`, rotation `angle` (in radians) and + /// `translation`. + /// Equivalent to `Affine2::from_translation(translation) * + /// Affine2::from_angle(angle) * Affine2::from_scale(scale)` fn from_scale_angle_translation( scale: Val, angle: f32, translation: Val, - ) { + ) -> Val { let output: Val = bevy::math::Affine2::from_scale_angle_translation( scale.into_inner(), angle, @@ -13614,56 +19795,80 @@ impl bevy::math::Affine2 { .into(); output } - fn from_translation(translation: Val) { + /// Creates an affine transformation from the given 2D `translation`. + fn from_translation(translation: Val) -> Val { let output: Val = bevy::math::Affine2::from_translation( translation.into_inner(), ) .into(); output } - fn inverse(_self: Ref) { + /// Return the inverse of this transform. + /// Note that if the transform is not invertible the result will be invalid. + fn inverse(_self: Ref) -> Val { let output: Val = bevy::math::Affine2::inverse(&_self) .into(); output } - fn is_finite(_self: Ref) { + /// Returns `true` if, and only if, all elements are finite. + /// If any element is either `NaN`, positive or negative infinity, this will return + /// `false`. + fn is_finite(_self: Ref) -> bool { let output: bool = bevy::math::Affine2::is_finite(&_self).into(); output } - fn is_nan(_self: Ref) { + /// Returns `true` if any elements are `NaN`. + fn is_nan(_self: Ref) -> bool { let output: bool = bevy::math::Affine2::is_nan(&_self).into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn to_cols_array(_self: Ref) { + /// Creates a `[f32; 6]` array storing data in column major order. + fn to_cols_array(_self: Ref) -> [f32; 6] { let output: [f32; 6] = bevy::math::Affine2::to_cols_array(&_self).into(); output } - fn to_cols_array_2d(_self: Ref) { + /// Creates a `[[f32; 2]; 3]` 2D array storing data in + /// column major order. + /// If you require data in row major order `transpose` the matrix first. + fn to_cols_array_2d(_self: Ref) -> [[f32; 2]; 3] { let output: [[f32; 2]; 3] = bevy::math::Affine2::to_cols_array_2d(&_self).into(); output } - fn transform_point2(_self: Ref, rhs: Val) { + /// Transforms the given 2D point, applying shear, scale, rotation and translation. + fn transform_point2( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Affine2::transform_point2( &_self, rhs.into_inner(), @@ -13671,7 +19876,13 @@ impl bevy::math::Affine2 { .into(); output } - fn transform_vector2(_self: Ref, rhs: Val) { + /// Transforms the given 2D vector, applying shear, scale and rotation (but NOT + /// translation). + /// To also apply translation, use [`Self::transform_point2()`] instead. + fn transform_vector2( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Affine2::transform_vector2( &_self, rhs.into_inner(), @@ -13686,11 +19897,18 @@ impl bevy::math::Affine2 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::Affine3A { + /// Returns true if the absolute difference of all elements between `self` and `rhs` + /// is less than or equal to `max_abs_diff`. + /// This can be used to compare if two 3x4 matrices contain similar elements. It works + /// best when comparing with a known value. The `max_abs_diff` that should be used used + /// depends on the values being compared against. + /// For more see + /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). fn abs_diff_eq( _self: Ref, rhs: Val, max_abs_diff: f32, - ) { + ) -> bool { let output: bool = bevy::math::Affine3A::abs_diff_eq( &_self, rhs.into_inner(), @@ -13699,21 +19917,26 @@ impl bevy::math::Affine3A { .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, rhs: Ref) { + fn eq(_self: Ref, rhs: Ref) -> bool { let output: bool = >::eq(&_self, &rhs) .into(); output } - fn from_axis_angle(axis: Val, angle: f32) { + /// Creates an affine transform containing a 3D rotation around a normalized + /// rotation `axis` of `angle` (in radians). + fn from_axis_angle( + axis: Val, + angle: f32, + ) -> Val { let output: Val = bevy::math::Affine3A::from_axis_angle( axis.into_inner(), angle, @@ -13721,12 +19944,13 @@ impl bevy::math::Affine3A { .into(); output } + /// Creates an affine transform from three column vectors. fn from_cols( x_axis: Val, y_axis: Val, z_axis: Val, w_axis: Val, - ) { + ) -> Val { let output: Val = bevy::math::Affine3A::from_cols( x_axis.into_inner(), y_axis.into_inner(), @@ -13736,17 +19960,22 @@ impl bevy::math::Affine3A { .into(); output } - fn from_mat3(mat3: Val) { + /// Creates an affine transform from a 3x3 matrix (expressing scale, shear and + /// rotation) + fn from_mat3(mat3: Val) -> Val { let output: Val = bevy::math::Affine3A::from_mat3( mat3.into_inner(), ) .into(); output } + /// Creates an affine transform from a 3x3 matrix (expressing scale, shear and rotation) + /// and a translation vector. + /// Equivalent to `Affine3A::from_translation(translation) * Affine3A::from_mat3(mat3)` fn from_mat3_translation( mat3: Val, translation: Val, - ) { + ) -> Val { let output: Val = bevy::math::Affine3A::from_mat3_translation( mat3.into_inner(), translation.into_inner(), @@ -13754,24 +19983,29 @@ impl bevy::math::Affine3A { .into(); output } - fn from_mat4(m: Val) { + /// The given `Mat4` must be an affine transform, + /// i.e. contain no perspective transform. + fn from_mat4(m: Val) -> Val { let output: Val = bevy::math::Affine3A::from_mat4( m.into_inner(), ) .into(); output } - fn from_quat(rotation: Val) { + /// Creates an affine transform from the given `rotation` quaternion. + fn from_quat(rotation: Val) -> Val { let output: Val = bevy::math::Affine3A::from_quat( rotation.into_inner(), ) .into(); output } + /// Creates an affine transform from the given 3D `rotation` and `translation`. + /// Equivalent to `Affine3A::from_translation(translation) * Affine3A::from_quat(rotation)` fn from_rotation_translation( rotation: Val, translation: Val, - ) { + ) -> Val { let output: Val = bevy::math::Affine3A::from_rotation_translation( rotation.into_inner(), translation.into_inner(), @@ -13779,39 +20013,51 @@ impl bevy::math::Affine3A { .into(); output } - fn from_rotation_x(angle: f32) { + /// Creates an affine transform containing a 3D rotation around the x axis of + /// `angle` (in radians). + fn from_rotation_x(angle: f32) -> Val { let output: Val = bevy::math::Affine3A::from_rotation_x( angle, ) .into(); output } - fn from_rotation_y(angle: f32) { + /// Creates an affine transform containing a 3D rotation around the y axis of + /// `angle` (in radians). + fn from_rotation_y(angle: f32) -> Val { let output: Val = bevy::math::Affine3A::from_rotation_y( angle, ) .into(); output } - fn from_rotation_z(angle: f32) { + /// Creates an affine transform containing a 3D rotation around the z axis of + /// `angle` (in radians). + fn from_rotation_z(angle: f32) -> Val { let output: Val = bevy::math::Affine3A::from_rotation_z( angle, ) .into(); output } - fn from_scale(scale: Val) { + /// Creates an affine transform that changes scale. + /// Note that if any scale is zero the transform will be non-invertible. + fn from_scale(scale: Val) -> Val { let output: Val = bevy::math::Affine3A::from_scale( scale.into_inner(), ) .into(); output } + /// Creates an affine transform from the given 3D `scale`, `rotation` and + /// `translation`. + /// Equivalent to `Affine3A::from_translation(translation) * + /// Affine3A::from_quat(rotation) * Affine3A::from_scale(scale)` fn from_scale_rotation_translation( scale: Val, rotation: Val, translation: Val, - ) { + ) -> Val { let output: Val = bevy::math::Affine3A::from_scale_rotation_translation( scale.into_inner(), rotation.into_inner(), @@ -13820,31 +20066,45 @@ impl bevy::math::Affine3A { .into(); output } - fn from_translation(translation: Val) { + /// Creates an affine transformation from the given 3D `translation`. + fn from_translation( + translation: Val, + ) -> Val { let output: Val = bevy::math::Affine3A::from_translation( translation.into_inner(), ) .into(); output } - fn inverse(_self: Ref) { + /// Return the inverse of this transform. + /// Note that if the transform is not invertible the result will be invalid. + fn inverse(_self: Ref) -> Val { let output: Val = bevy::math::Affine3A::inverse(&_self) .into(); output } - fn is_finite(_self: Ref) { + /// Returns `true` if, and only if, all elements are finite. + /// If any element is either `NaN`, positive or negative infinity, this will return + /// `false`. + fn is_finite(_self: Ref) -> bool { let output: bool = bevy::math::Affine3A::is_finite(&_self).into(); output } - fn is_nan(_self: Ref) { + /// Returns `true` if any elements are `NaN`. + fn is_nan(_self: Ref) -> bool { let output: bool = bevy::math::Affine3A::is_nan(&_self).into(); output } + /// Creates a left-handed view transform using a camera position, an up direction, and a focal + /// point. + /// For a view coordinate system with `+X=right`, `+Y=up` and `+Z=forward`. + /// # Panics + /// Will panic if `up` is not normalized when `glam_assert` is enabled. fn look_at_lh( eye: Val, center: Val, up: Val, - ) { + ) -> Val { let output: Val = bevy::math::Affine3A::look_at_lh( eye.into_inner(), center.into_inner(), @@ -13853,11 +20113,16 @@ impl bevy::math::Affine3A { .into(); output } + /// Creates a right-handed view transform using a camera position, an up direction, and a focal + /// point. + /// For a view coordinate system with `+X=right`, `+Y=up` and `+Z=back`. + /// # Panics + /// Will panic if `up` is not normalized when `glam_assert` is enabled. fn look_at_rh( eye: Val, center: Val, up: Val, - ) { + ) -> Val { let output: Val = bevy::math::Affine3A::look_at_rh( eye.into_inner(), center.into_inner(), @@ -13866,11 +20131,14 @@ impl bevy::math::Affine3A { .into(); output } + /// Creates a left-handed view transform using a camera position, an up direction, and a facing + /// direction. + /// For a view coordinate system with `+X=right`, `+Y=up` and `+Z=forward`. fn look_to_lh( eye: Val, dir: Val, up: Val, - ) { + ) -> Val { let output: Val = bevy::math::Affine3A::look_to_lh( eye.into_inner(), dir.into_inner(), @@ -13879,11 +20147,14 @@ impl bevy::math::Affine3A { .into(); output } + /// Creates a right-handed view transform using a camera position, an up direction, and a facing + /// direction. + /// For a view coordinate system with `+X=right`, `+Y=up` and `+Z=back`. fn look_to_rh( eye: Val, dir: Val, up: Val, - ) { + ) -> Val { let output: Val = bevy::math::Affine3A::look_to_rh( eye.into_inner(), dir.into_inner(), @@ -13892,30 +20163,44 @@ impl bevy::math::Affine3A { .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn to_cols_array(_self: Ref) { + /// Creates a `[f32; 12]` array storing data in column major order. + fn to_cols_array(_self: Ref) -> [f32; 12] { let output: [f32; 12] = bevy::math::Affine3A::to_cols_array(&_self).into(); output } - fn to_cols_array_2d(_self: Ref) { + /// Creates a `[[f32; 3]; 4]` 3D array storing data in + /// column major order. + /// If you require data in row major order `transpose` the matrix first. + fn to_cols_array_2d(_self: Ref) -> [[f32; 3]; 4] { let output: [[f32; 3]; 4] = bevy::math::Affine3A::to_cols_array_2d(&_self) .into(); output } - fn transform_point3(_self: Ref, rhs: Val) { + /// Transforms the given 3D points, applying shear, scale, rotation and translation. + fn transform_point3( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Affine3A::transform_point3( &_self, rhs.into_inner(), @@ -13923,7 +20208,11 @@ impl bevy::math::Affine3A { .into(); output } - fn transform_point3a(_self: Ref, rhs: Val) { + /// Transforms the given [`Vec3A`], applying shear, scale, rotation and translation. + fn transform_point3a( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Affine3A::transform_point3a( &_self, rhs.into_inner(), @@ -13931,7 +20220,13 @@ impl bevy::math::Affine3A { .into(); output } - fn transform_vector3(_self: Ref, rhs: Val) { + /// Transforms the given 3D vector, applying shear, scale and rotation (but NOT + /// translation). + /// To also apply translation, use [`Self::transform_point3()`] instead. + fn transform_vector3( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::Affine3A::transform_vector3( &_self, rhs.into_inner(), @@ -13939,10 +20234,13 @@ impl bevy::math::Affine3A { .into(); output } + /// Transforms the given [`Vec3A`], applying shear, scale and rotation (but NOT + /// translation). + /// To also apply translation, use [`Self::transform_point3a()`] instead. fn transform_vector3a( _self: Ref, rhs: Val, - ) { + ) -> Val { let output: Val = bevy::math::Affine3A::transform_vector3a( &_self, rhs.into_inner(), @@ -13957,11 +20255,18 @@ impl bevy::math::Affine3A { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::DAffine2 { + /// Returns true if the absolute difference of all elements between `self` and `rhs` + /// is less than or equal to `max_abs_diff`. + /// This can be used to compare if two 3x4 matrices contain similar elements. It works + /// best when comparing with a known value. The `max_abs_diff` that should be used used + /// depends on the values being compared against. + /// For more see + /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). fn abs_diff_eq( _self: Ref, rhs: Val, max_abs_diff: f64, - ) { + ) -> bool { let output: bool = bevy::math::DAffine2::abs_diff_eq( &_self, rhs.into_inner(), @@ -13970,26 +20275,33 @@ impl bevy::math::DAffine2 { .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, rhs: Ref) { + fn eq(_self: Ref, rhs: Ref) -> bool { let output: bool = >::eq(&_self, &rhs) .into(); output } - fn from_angle(angle: f64) { + /// Creates an affine transform from the given rotation `angle`. + fn from_angle(angle: f64) -> Val { let output: Val = bevy::math::DAffine2::from_angle(angle) .into(); output } - fn from_angle_translation(angle: f64, translation: Val) { + /// Creates an affine transform from the given 2D rotation `angle` (in radians) and + /// `translation`. + /// Equivalent to `DAffine2::from_translation(translation) * DAffine2::from_angle(angle)` + fn from_angle_translation( + angle: f64, + translation: Val, + ) -> Val { let output: Val = bevy::math::DAffine2::from_angle_translation( angle, translation.into_inner(), @@ -13997,11 +20309,12 @@ impl bevy::math::DAffine2 { .into(); output } + /// Creates an affine transform from three column vectors. fn from_cols( x_axis: Val, y_axis: Val, z_axis: Val, - ) { + ) -> Val { let output: Val = bevy::math::DAffine2::from_cols( x_axis.into_inner(), y_axis.into_inner(), @@ -14010,17 +20323,22 @@ impl bevy::math::DAffine2 { .into(); output } - fn from_mat2(matrix2: Val) { + /// Creates an affine transform from a 2x2 matrix (expressing scale, shear and rotation) + fn from_mat2(matrix2: Val) -> Val { let output: Val = bevy::math::DAffine2::from_mat2( matrix2.into_inner(), ) .into(); output } + /// Creates an affine transform from a 2x2 matrix (expressing scale, shear and rotation) and a + /// translation vector. + /// Equivalent to + /// `DAffine2::from_translation(translation) * DAffine2::from_mat2(mat2)` fn from_mat2_translation( matrix2: Val, translation: Val, - ) { + ) -> Val { let output: Val = bevy::math::DAffine2::from_mat2_translation( matrix2.into_inner(), translation.into_inner(), @@ -14028,25 +20346,32 @@ impl bevy::math::DAffine2 { .into(); output } - fn from_mat3(m: Val) { + /// The given `DMat3` must be an affine transform, + fn from_mat3(m: Val) -> Val { let output: Val = bevy::math::DAffine2::from_mat3( m.into_inner(), ) .into(); output } - fn from_scale(scale: Val) { + /// Creates an affine transform that changes scale. + /// Note that if any scale is zero the transform will be non-invertible. + fn from_scale(scale: Val) -> Val { let output: Val = bevy::math::DAffine2::from_scale( scale.into_inner(), ) .into(); output } + /// Creates an affine transform from the given 2D `scale`, rotation `angle` (in radians) and + /// `translation`. + /// Equivalent to `DAffine2::from_translation(translation) * + /// DAffine2::from_angle(angle) * DAffine2::from_scale(scale)` fn from_scale_angle_translation( scale: Val, angle: f64, translation: Val, - ) { + ) -> Val { let output: Val = bevy::math::DAffine2::from_scale_angle_translation( scale.into_inner(), angle, @@ -14055,50 +20380,73 @@ impl bevy::math::DAffine2 { .into(); output } - fn from_translation(translation: Val) { + /// Creates an affine transformation from the given 2D `translation`. + fn from_translation( + translation: Val, + ) -> Val { let output: Val = bevy::math::DAffine2::from_translation( translation.into_inner(), ) .into(); output } - fn inverse(_self: Ref) { + /// Return the inverse of this transform. + /// Note that if the transform is not invertible the result will be invalid. + fn inverse(_self: Ref) -> Val { let output: Val = bevy::math::DAffine2::inverse(&_self) .into(); output } - fn is_finite(_self: Ref) { + /// Returns `true` if, and only if, all elements are finite. + /// If any element is either `NaN`, positive or negative infinity, this will return + /// `false`. + fn is_finite(_self: Ref) -> bool { let output: bool = bevy::math::DAffine2::is_finite(&_self).into(); output } - fn is_nan(_self: Ref) { + /// Returns `true` if any elements are `NaN`. + fn is_nan(_self: Ref) -> bool { let output: bool = bevy::math::DAffine2::is_nan(&_self).into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn to_cols_array(_self: Ref) { + /// Creates a `[f64; 6]` array storing data in column major order. + fn to_cols_array(_self: Ref) -> [f64; 6] { let output: [f64; 6] = bevy::math::DAffine2::to_cols_array(&_self).into(); output } - fn to_cols_array_2d(_self: Ref) { + /// Creates a `[[f64; 2]; 3]` 2D array storing data in + /// column major order. + /// If you require data in row major order `transpose` the matrix first. + fn to_cols_array_2d(_self: Ref) -> [[f64; 2]; 3] { let output: [[f64; 2]; 3] = bevy::math::DAffine2::to_cols_array_2d(&_self) .into(); output } - fn transform_point2(_self: Ref, rhs: Val) { + /// Transforms the given 2D point, applying shear, scale, rotation and translation. + fn transform_point2( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DAffine2::transform_point2( &_self, rhs.into_inner(), @@ -14106,7 +20454,13 @@ impl bevy::math::DAffine2 { .into(); output } - fn transform_vector2(_self: Ref, rhs: Val) { + /// Transforms the given 2D vector, applying shear, scale and rotation (but NOT + /// translation). + /// To also apply translation, use [`Self::transform_point2()`] instead. + fn transform_vector2( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DAffine2::transform_vector2( &_self, rhs.into_inner(), @@ -14121,11 +20475,18 @@ impl bevy::math::DAffine2 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::DAffine3 { + /// Returns true if the absolute difference of all elements between `self` and `rhs` + /// is less than or equal to `max_abs_diff`. + /// This can be used to compare if two 3x4 matrices contain similar elements. It works + /// best when comparing with a known value. The `max_abs_diff` that should be used used + /// depends on the values being compared against. + /// For more see + /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). fn abs_diff_eq( _self: Ref, rhs: Val, max_abs_diff: f64, - ) { + ) -> bool { let output: bool = bevy::math::DAffine3::abs_diff_eq( &_self, rhs.into_inner(), @@ -14134,21 +20495,26 @@ impl bevy::math::DAffine3 { .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, rhs: Ref) { + fn eq(_self: Ref, rhs: Ref) -> bool { let output: bool = >::eq(&_self, &rhs) .into(); output } - fn from_axis_angle(axis: Val, angle: f64) { + /// Creates an affine transform containing a 3D rotation around a normalized + /// rotation `axis` of `angle` (in radians). + fn from_axis_angle( + axis: Val, + angle: f64, + ) -> Val { let output: Val = bevy::math::DAffine3::from_axis_angle( axis.into_inner(), angle, @@ -14156,12 +20522,13 @@ impl bevy::math::DAffine3 { .into(); output } + /// Creates an affine transform from three column vectors. fn from_cols( x_axis: Val, y_axis: Val, z_axis: Val, w_axis: Val, - ) { + ) -> Val { let output: Val = bevy::math::DAffine3::from_cols( x_axis.into_inner(), y_axis.into_inner(), @@ -14171,17 +20538,22 @@ impl bevy::math::DAffine3 { .into(); output } - fn from_mat3(mat3: Val) { + /// Creates an affine transform from a 3x3 matrix (expressing scale, shear and + /// rotation) + fn from_mat3(mat3: Val) -> Val { let output: Val = bevy::math::DAffine3::from_mat3( mat3.into_inner(), ) .into(); output } + /// Creates an affine transform from a 3x3 matrix (expressing scale, shear and rotation) + /// and a translation vector. + /// Equivalent to `DAffine3::from_translation(translation) * DAffine3::from_mat3(mat3)` fn from_mat3_translation( mat3: Val, translation: Val, - ) { + ) -> Val { let output: Val = bevy::math::DAffine3::from_mat3_translation( mat3.into_inner(), translation.into_inner(), @@ -14189,24 +20561,29 @@ impl bevy::math::DAffine3 { .into(); output } - fn from_mat4(m: Val) { + /// The given `DMat4` must be an affine transform, + /// i.e. contain no perspective transform. + fn from_mat4(m: Val) -> Val { let output: Val = bevy::math::DAffine3::from_mat4( m.into_inner(), ) .into(); output } - fn from_quat(rotation: Val) { + /// Creates an affine transform from the given `rotation` quaternion. + fn from_quat(rotation: Val) -> Val { let output: Val = bevy::math::DAffine3::from_quat( rotation.into_inner(), ) .into(); output } + /// Creates an affine transform from the given 3D `rotation` and `translation`. + /// Equivalent to `DAffine3::from_translation(translation) * DAffine3::from_quat(rotation)` fn from_rotation_translation( rotation: Val, translation: Val, - ) { + ) -> Val { let output: Val = bevy::math::DAffine3::from_rotation_translation( rotation.into_inner(), translation.into_inner(), @@ -14214,39 +20591,51 @@ impl bevy::math::DAffine3 { .into(); output } - fn from_rotation_x(angle: f64) { + /// Creates an affine transform containing a 3D rotation around the x axis of + /// `angle` (in radians). + fn from_rotation_x(angle: f64) -> Val { let output: Val = bevy::math::DAffine3::from_rotation_x( angle, ) .into(); output } - fn from_rotation_y(angle: f64) { + /// Creates an affine transform containing a 3D rotation around the y axis of + /// `angle` (in radians). + fn from_rotation_y(angle: f64) -> Val { let output: Val = bevy::math::DAffine3::from_rotation_y( angle, ) .into(); output } - fn from_rotation_z(angle: f64) { + /// Creates an affine transform containing a 3D rotation around the z axis of + /// `angle` (in radians). + fn from_rotation_z(angle: f64) -> Val { let output: Val = bevy::math::DAffine3::from_rotation_z( angle, ) .into(); output } - fn from_scale(scale: Val) { + /// Creates an affine transform that changes scale. + /// Note that if any scale is zero the transform will be non-invertible. + fn from_scale(scale: Val) -> Val { let output: Val = bevy::math::DAffine3::from_scale( scale.into_inner(), ) .into(); output } + /// Creates an affine transform from the given 3D `scale`, `rotation` and + /// `translation`. + /// Equivalent to `DAffine3::from_translation(translation) * + /// DAffine3::from_quat(rotation) * DAffine3::from_scale(scale)` fn from_scale_rotation_translation( scale: Val, rotation: Val, translation: Val, - ) { + ) -> Val { let output: Val = bevy::math::DAffine3::from_scale_rotation_translation( scale.into_inner(), rotation.into_inner(), @@ -14255,31 +20644,45 @@ impl bevy::math::DAffine3 { .into(); output } - fn from_translation(translation: Val) { + /// Creates an affine transformation from the given 3D `translation`. + fn from_translation( + translation: Val, + ) -> Val { let output: Val = bevy::math::DAffine3::from_translation( translation.into_inner(), ) .into(); output } - fn inverse(_self: Ref) { + /// Return the inverse of this transform. + /// Note that if the transform is not invertible the result will be invalid. + fn inverse(_self: Ref) -> Val { let output: Val = bevy::math::DAffine3::inverse(&_self) .into(); output } - fn is_finite(_self: Ref) { + /// Returns `true` if, and only if, all elements are finite. + /// If any element is either `NaN`, positive or negative infinity, this will return + /// `false`. + fn is_finite(_self: Ref) -> bool { let output: bool = bevy::math::DAffine3::is_finite(&_self).into(); output } - fn is_nan(_self: Ref) { + /// Returns `true` if any elements are `NaN`. + fn is_nan(_self: Ref) -> bool { let output: bool = bevy::math::DAffine3::is_nan(&_self).into(); output } + /// Creates a left-handed view transform using a camera position, an up direction, and a focal + /// point. + /// For a view coordinate system with `+X=right`, `+Y=up` and `+Z=forward`. + /// # Panics + /// Will panic if `up` is not normalized when `glam_assert` is enabled. fn look_at_lh( eye: Val, center: Val, up: Val, - ) { + ) -> Val { let output: Val = bevy::math::DAffine3::look_at_lh( eye.into_inner(), center.into_inner(), @@ -14288,11 +20691,16 @@ impl bevy::math::DAffine3 { .into(); output } + /// Creates a right-handed view transform using a camera position, an up direction, and a focal + /// point. + /// For a view coordinate system with `+X=right`, `+Y=up` and `+Z=back`. + /// # Panics + /// Will panic if `up` is not normalized when `glam_assert` is enabled. fn look_at_rh( eye: Val, center: Val, up: Val, - ) { + ) -> Val { let output: Val = bevy::math::DAffine3::look_at_rh( eye.into_inner(), center.into_inner(), @@ -14301,11 +20709,14 @@ impl bevy::math::DAffine3 { .into(); output } + /// Creates a left-handed view transform using a camera position, an up direction, and a facing + /// direction. + /// For a view coordinate system with `+X=right`, `+Y=up` and `+Z=forward`. fn look_to_lh( eye: Val, dir: Val, up: Val, - ) { + ) -> Val { let output: Val = bevy::math::DAffine3::look_to_lh( eye.into_inner(), dir.into_inner(), @@ -14314,11 +20725,14 @@ impl bevy::math::DAffine3 { .into(); output } + /// Creates a right-handed view transform using a camera position, an up direction, and a facing + /// direction. + /// For a view coordinate system with `+X=right`, `+Y=up` and `+Z=back`. fn look_to_rh( eye: Val, dir: Val, up: Val, - ) { + ) -> Val { let output: Val = bevy::math::DAffine3::look_to_rh( eye.into_inner(), dir.into_inner(), @@ -14327,30 +20741,44 @@ impl bevy::math::DAffine3 { .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn to_cols_array(_self: Ref) { + /// Creates a `[f64; 12]` array storing data in column major order. + fn to_cols_array(_self: Ref) -> [f64; 12] { let output: [f64; 12] = bevy::math::DAffine3::to_cols_array(&_self).into(); output } - fn to_cols_array_2d(_self: Ref) { + /// Creates a `[[f64; 3]; 4]` 3D array storing data in + /// column major order. + /// If you require data in row major order `transpose` the matrix first. + fn to_cols_array_2d(_self: Ref) -> [[f64; 3]; 4] { let output: [[f64; 3]; 4] = bevy::math::DAffine3::to_cols_array_2d(&_self) .into(); output } - fn transform_point3(_self: Ref, rhs: Val) { + /// Transforms the given 3D points, applying shear, scale, rotation and translation. + fn transform_point3( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DAffine3::transform_point3( &_self, rhs.into_inner(), @@ -14358,7 +20786,13 @@ impl bevy::math::DAffine3 { .into(); output } - fn transform_vector3(_self: Ref, rhs: Val) { + /// Transforms the given 3D vector, applying shear, scale and rotation (but NOT + /// translation). + /// To also apply translation, use [`Self::transform_point3()`] instead. + fn transform_vector3( + _self: Ref, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DAffine3::transform_vector3( &_self, rhs.into_inner(), @@ -14373,11 +20807,18 @@ impl bevy::math::DAffine3 { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::DQuat { + /// Returns true if the absolute difference of all elements between `self` and `rhs` + /// is less than or equal to `max_abs_diff`. + /// This can be used to compare if two quaternions contain similar elements. It works + /// best when comparing with a known value. The `max_abs_diff` that should be used used + /// depends on the values being compared against. + /// For more see + /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). fn abs_diff_eq( _self: Val, rhs: Val, max_abs_diff: f64, - ) { + ) -> bool { let output: bool = bevy::math::DQuat::abs_diff_eq( _self.into_inner(), rhs.into_inner(), @@ -14386,14 +20827,26 @@ impl bevy::math::DQuat { .into(); output } - fn add(_self: Val, rhs: Val) { + /// Adds two quaternions. + /// The sum is not guaranteed to be normalized. + /// Note that addition is not the same as combining the rotations represented by the + /// two quaternions! That corresponds to multiplication. + fn add( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::add(_self.into_inner(), rhs.into_inner()) .into(); output } - fn angle_between(_self: Val, rhs: Val) { + /// Returns the angle (in radians) for the minimal rotation + /// for transforming this quaternion into another. + /// Both quaternions must be normalized. + /// # Panics + /// Will panic if `self` or `rhs` are not normalized when `glam_assert` is enabled. + fn angle_between(_self: Val, rhs: Val) -> f64 { let output: f64 = bevy::math::DQuat::angle_between( _self.into_inner(), rhs.into_inner(), @@ -14401,55 +20854,78 @@ impl bevy::math::DQuat { .into(); output } - fn as_quat(_self: Val) { + fn as_quat(_self: Val) -> Val { let output: Val = bevy::math::DQuat::as_quat( _self.into_inner(), ) .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn conjugate(_self: Val) { + /// Returns the quaternion conjugate of `self`. For a unit quaternion the + /// conjugate is also the inverse. + fn conjugate(_self: Val) -> Val { let output: Val = bevy::math::DQuat::conjugate( _self.into_inner(), ) .into(); output } - fn div(_self: Val, rhs: f64) { + /// Divides a quaternion by a scalar value. + /// The quotient is not guaranteed to be normalized. + fn div(_self: Val, rhs: f64) -> Val { let output: Val = >::div(_self.into_inner(), rhs) .into(); output } - fn dot(_self: Val, rhs: Val) { + /// Computes the dot product of `self` and `rhs`. The dot product is + /// equal to the cosine of the angle between two quaternion rotations. + fn dot(_self: Val, rhs: Val) -> f64 { let output: f64 = bevy::math::DQuat::dot(_self.into_inner(), rhs.into_inner()) .into(); output } - fn eq(_self: Ref, rhs: Ref) { + fn eq(_self: Ref, rhs: Ref) -> bool { let output: bool = >::eq(&_self, &rhs) .into(); output } - fn from_affine3(a: Ref) { + /// Creates a quaternion from a 3x3 rotation matrix inside a 3D affine transform. + /// Note if the input affine matrix contain scales, shears, or other non-rotation + /// transformations then the resulting quaternion will be ill-defined. + /// # Panics + /// Will panic if any input affine matrix column is not normalized when `glam_assert` is + /// enabled. + fn from_affine3(a: Ref) -> Val { let output: Val = bevy::math::DQuat::from_affine3(&a).into(); output } - fn from_array(a: [f64; 4]) { + /// Creates a rotation quaternion from an array. + /// # Preconditions + /// This function does not check if the input is normalized, it is up to the user to + /// provide normalized input or to normalized the resulting quaternion. + fn from_array(a: [f64; 4]) -> Val { let output: Val = bevy::math::DQuat::from_array(a).into(); output } - fn from_axis_angle(axis: Val, angle: f64) { + /// Create a quaternion for a normalized rotation `axis` and `angle` (in radians). + /// The axis must be a unit vector. + /// # Panics + /// Will panic if `axis` is not normalized when `glam_assert` is enabled. + fn from_axis_angle( + axis: Val, + angle: f64, + ) -> Val { let output: Val = bevy::math::DQuat::from_axis_angle( axis.into_inner(), angle, @@ -14457,7 +20933,13 @@ impl bevy::math::DQuat { .into(); output } - fn from_euler(euler: Val, a: f64, b: f64, c: f64) { + /// Creates a quaternion from the given Euler rotation sequence and the angles (in radians). + fn from_euler( + euler: Val, + a: f64, + b: f64, + c: f64, + ) -> Val { let output: Val = bevy::math::DQuat::from_euler( euler.into_inner(), a, @@ -14467,15 +20949,37 @@ impl bevy::math::DQuat { .into(); output } - fn from_mat3(mat: Ref) { + /// Creates a quaternion from a 3x3 rotation matrix. + /// Note if the input matrix contain scales, shears, or other non-rotation transformations then + /// the resulting quaternion will be ill-defined. + /// # Panics + /// Will panic if any input matrix column is not normalized when `glam_assert` is enabled. + fn from_mat3(mat: Ref) -> Val { let output: Val = bevy::math::DQuat::from_mat3(&mat).into(); output } - fn from_mat4(mat: Ref) { + /// Creates a quaternion from the upper 3x3 rotation matrix inside a homogeneous 4x4 matrix. + /// Note if the upper 3x3 matrix contain scales, shears, or other non-rotation transformations + /// then the resulting quaternion will be ill-defined. + /// # Panics + /// Will panic if any column of the upper 3x3 rotation matrix is not normalized when + /// `glam_assert` is enabled. + fn from_mat4(mat: Ref) -> Val { let output: Val = bevy::math::DQuat::from_mat4(&mat).into(); output } - fn from_rotation_arc(from: Val, to: Val) { + /// Gets the minimal rotation for transforming `from` to `to`. The rotation is in the + /// plane spanned by the two vectors. Will rotate at most 180 degrees. + /// The inputs must be unit vectors. + /// `from_rotation_arc(from, to) * from ≈ to`. + /// For near-singular cases (from≈to and from≈-to) the current implementation + /// is only accurate to about 0.001 (for `f32`). + /// # Panics + /// Will panic if `from` or `to` are not normalized when `glam_assert` is enabled. + fn from_rotation_arc( + from: Val, + to: Val, + ) -> Val { let output: Val = bevy::math::DQuat::from_rotation_arc( from.into_inner(), to.into_inner(), @@ -14483,7 +20987,18 @@ impl bevy::math::DQuat { .into(); output } - fn from_rotation_arc_2d(from: Val, to: Val) { + /// Gets the minimal rotation for transforming `from` to `to`. The resulting rotation is + /// around the z axis. Will rotate at most 180 degrees. + /// The inputs must be unit vectors. + /// `from_rotation_arc_2d(from, to) * from ≈ to`. + /// For near-singular cases (from≈to and from≈-to) the current implementation + /// is only accurate to about 0.001 (for `f32`). + /// # Panics + /// Will panic if `from` or `to` are not normalized when `glam_assert` is enabled. + fn from_rotation_arc_2d( + from: Val, + to: Val, + ) -> Val { let output: Val = bevy::math::DQuat::from_rotation_arc_2d( from.into_inner(), to.into_inner(), @@ -14491,10 +21006,18 @@ impl bevy::math::DQuat { .into(); output } + /// Gets the minimal rotation for transforming `from` to either `to` or `-to`. This means + /// that the resulting quaternion will rotate `from` so that it is colinear with `to`. + /// The rotation is in the plane spanned by the two vectors. Will rotate at most 90 + /// degrees. + /// The inputs must be unit vectors. + /// `to.dot(from_rotation_arc_colinear(from, to) * from).abs() ≈ 1`. + /// # Panics + /// Will panic if `from` or `to` are not normalized when `glam_assert` is enabled. fn from_rotation_arc_colinear( from: Val, to: Val, - ) { + ) -> Val { let output: Val = bevy::math::DQuat::from_rotation_arc_colinear( from.into_inner(), to.into_inner(), @@ -14502,75 +21025,118 @@ impl bevy::math::DQuat { .into(); output } - fn from_rotation_x(angle: f64) { + /// Creates a quaternion from the `angle` (in radians) around the x axis. + fn from_rotation_x(angle: f64) -> Val { let output: Val = bevy::math::DQuat::from_rotation_x(angle) .into(); output } - fn from_rotation_y(angle: f64) { + /// Creates a quaternion from the `angle` (in radians) around the y axis. + fn from_rotation_y(angle: f64) -> Val { let output: Val = bevy::math::DQuat::from_rotation_y(angle) .into(); output } - fn from_rotation_z(angle: f64) { + /// Creates a quaternion from the `angle` (in radians) around the z axis. + fn from_rotation_z(angle: f64) -> Val { let output: Val = bevy::math::DQuat::from_rotation_z(angle) .into(); output } - fn from_scaled_axis(v: Val) { + /// Create a quaternion that rotates `v.length()` radians around `v.normalize()`. + /// `from_scaled_axis(Vec3::ZERO)` results in the identity quaternion. + fn from_scaled_axis(v: Val) -> Val { let output: Val = bevy::math::DQuat::from_scaled_axis( v.into_inner(), ) .into(); output } - fn from_vec4(v: Val) { + /// Creates a new rotation quaternion from a 4D vector. + /// # Preconditions + /// This function does not check if the input is normalized, it is up to the user to + /// provide normalized input or to normalized the resulting quaternion. + fn from_vec4(v: Val) -> Val { let output: Val = bevy::math::DQuat::from_vec4(v.into_inner()) .into(); output } - fn from_xyzw(x: f64, y: f64, z: f64, w: f64) { + /// Creates a new rotation quaternion. + /// This should generally not be called manually unless you know what you are doing. + /// Use one of the other constructors instead such as `identity` or `from_axis_angle`. + /// `from_xyzw` is mostly used by unit tests and `serde` deserialization. + /// # Preconditions + /// This function does not check if the input is normalized, it is up to the user to + /// provide normalized input or to normalized the resulting quaternion. + fn from_xyzw(x: f64, y: f64, z: f64, w: f64) -> Val { let output: Val = bevy::math::DQuat::from_xyzw(x, y, z, w) .into(); output } - fn inverse(_self: Val) { + /// Returns the inverse of a normalized quaternion. + /// Typically quaternion inverse returns the conjugate of a normalized quaternion. + /// Because `self` is assumed to already be unit length this method *does not* normalize + /// before returning the conjugate. + /// # Panics + /// Will panic if `self` is not normalized when `glam_assert` is enabled. + fn inverse(_self: Val) -> Val { let output: Val = bevy::math::DQuat::inverse( _self.into_inner(), ) .into(); output } - fn is_finite(_self: Val) { + /// Returns `true` if, and only if, all elements are finite. + /// If any element is either `NaN`, positive or negative infinity, this will return `false`. + fn is_finite(_self: Val) -> bool { let output: bool = bevy::math::DQuat::is_finite(_self.into_inner()).into(); output } - fn is_nan(_self: Val) { + /// Returns `true` if any elements are `NAN`. + fn is_nan(_self: Val) -> bool { let output: bool = bevy::math::DQuat::is_nan(_self.into_inner()).into(); output } - fn is_near_identity(_self: Val) { + fn is_near_identity(_self: Val) -> bool { let output: bool = bevy::math::DQuat::is_near_identity(_self.into_inner()) .into(); output } - fn is_normalized(_self: Val) { + /// Returns whether `self` of length `1.0` or not. + /// Uses a precision threshold of `1e-6`. + fn is_normalized(_self: Val) -> bool { let output: bool = bevy::math::DQuat::is_normalized(_self.into_inner()).into(); output } - fn length(_self: Val) { + /// Computes the length of `self`. + fn length(_self: Val) -> f64 { let output: f64 = bevy::math::DQuat::length(_self.into_inner()).into(); output } - fn length_recip(_self: Val) { + /// Computes `1.0 / length()`. + /// For valid results, `self` must _not_ be of length zero. + fn length_recip(_self: Val) -> f64 { let output: f64 = bevy::math::DQuat::length_recip(_self.into_inner()).into(); output } - fn length_squared(_self: Val) { + /// Computes the squared length of `self`. + /// This is generally faster than `length()` as it avoids a square + /// root operation. + fn length_squared(_self: Val) -> f64 { let output: f64 = bevy::math::DQuat::length_squared(_self.into_inner()).into(); output } - fn lerp(_self: Val, end: Val, s: f64) { + /// Performs a linear interpolation between `self` and `rhs` based on + /// the value `s`. + /// When `s` is `0.0`, the result will be equal to `self`. When `s` + /// is `1.0`, the result will be equal to `rhs`. + /// # Panics + /// Will panic if `self` or `end` are not normalized when `glam_assert` is enabled. + fn lerp( + _self: Val, + end: Val, + s: f64, + ) -> Val { let output: Val = bevy::math::DQuat::lerp( _self.into_inner(), end.into_inner(), @@ -14579,28 +21145,53 @@ impl bevy::math::DQuat { .into(); output } - fn mul(_self: Val, rhs: Val) { + /// Multiplies two quaternions. If they each represent a rotation, the result will + /// represent the combined rotation. + /// Note that due to floating point rounding the result may not be perfectly + /// normalized. + /// # Panics + /// Will panic if `self` or `rhs` are not normalized when `glam_assert` is enabled. + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: Val) { + /// Multiplies a quaternion and a 3D vector, returning the rotated vector. + /// # Panics + /// Will panic if `self` is not normalized when `glam_assert` is enabled. + fn mul( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) .into(); output } - fn mul(_self: Val, rhs: f64) { + /// Multiplies a quaternion by a scalar value. + /// The product is not guaranteed to be normalized. + fn mul(_self: Val, rhs: f64) -> Val { let output: Val = >::mul(_self.into_inner(), rhs) .into(); output } - fn mul_quat(_self: Val, rhs: Val) { + /// Multiplies two quaternions. If they each represent a rotation, the result will + /// represent the combined rotation. + /// Note that due to floating point rounding the result may not be perfectly normalized. + /// # Panics + /// Will panic if `self` or `rhs` are not normalized when `glam_assert` is enabled. + fn mul_quat( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DQuat::mul_quat( _self.into_inner(), rhs.into_inner(), @@ -14608,7 +21199,13 @@ impl bevy::math::DQuat { .into(); output } - fn mul_vec3(_self: Val, rhs: Val) { + /// Multiplies a quaternion and a 3D vector, returning the rotated vector. + /// # Panics + /// Will panic if `self` is not normalized when `glam_assert` is enabled. + fn mul_vec3( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = bevy::math::DQuat::mul_vec3( _self.into_inner(), rhs.into_inner(), @@ -14616,25 +21213,36 @@ impl bevy::math::DQuat { .into(); output } - fn neg(_self: Val) { + fn neg(_self: Val) -> Val { let output: Val = ::neg( _self.into_inner(), ) .into(); output } - fn normalize(_self: Val) { + /// Returns `self` normalized to length 1.0. + /// For valid results, `self` must _not_ be of length zero. + /// Panics + /// Will panic if `self` is zero length when `glam_assert` is enabled. + fn normalize(_self: Val) -> Val { let output: Val = bevy::math::DQuat::normalize( _self.into_inner(), ) .into(); output } + /// Rotates towards `rhs` up to `max_angle` (in radians). + /// When `max_angle` is `0.0`, the result will be equal to `self`. When `max_angle` is equal to + /// `self.angle_between(rhs)`, the result will be equal to `rhs`. If `max_angle` is negative, + /// rotates towards the exact opposite of `rhs`. Will not go past the target. + /// Both quaternions must be normalized. + /// # Panics + /// Will panic if `self` or `rhs` are not normalized when `glam_assert` is enabled. fn rotate_towards( _self: Ref, rhs: Val, max_angle: f64, - ) { + ) -> Val { let output: Val = bevy::math::DQuat::rotate_towards( &_self, rhs.into_inner(), @@ -14643,7 +21251,17 @@ impl bevy::math::DQuat { .into(); output } - fn slerp(_self: Val, end: Val, s: f64) { + /// Performs a spherical linear interpolation between `self` and `end` + /// based on the value `s`. + /// When `s` is `0.0`, the result will be equal to `self`. When `s` + /// is `1.0`, the result will be equal to `end`. + /// # Panics + /// Will panic if `self` or `end` are not normalized when `glam_assert` is enabled. + fn slerp( + _self: Val, + end: Val, + s: f64, + ) -> Val { let output: Val = bevy::math::DQuat::slerp( _self.into_inner(), end.into_inner(), @@ -14652,18 +21270,28 @@ impl bevy::math::DQuat { .into(); output } - fn sub(_self: Val, rhs: Val) { + /// Subtracts the `rhs` quaternion from `self`. + /// The difference is not guaranteed to be normalized. + fn sub( + _self: Val, + rhs: Val, + ) -> Val { let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) .into(); output } - fn to_array(_self: Ref) { + /// `[x, y, z, w]` + fn to_array(_self: Ref) -> [f64; 4] { let output: [f64; 4] = bevy::math::DQuat::to_array(&_self).into(); output } - fn to_euler(_self: Val, order: Val) { + /// Returns the rotation angles for the given euler rotation sequence. + fn to_euler( + _self: Val, + order: Val, + ) -> (f64, f64, f64) { let output: (f64, f64, f64) = bevy::math::DQuat::to_euler( _self.into_inner(), order.into_inner(), @@ -14671,14 +21299,16 @@ impl bevy::math::DQuat { .into(); output } - fn to_scaled_axis(_self: Val) { + /// Returns the rotation axis scaled by the rotation in radians. + fn to_scaled_axis(_self: Val) -> Val { let output: Val = bevy::math::DQuat::to_scaled_axis( _self.into_inner(), ) .into(); output } - fn xyz(_self: Val) { + /// Returns the vector part of the quaternion. + fn xyz(_self: Val) -> Val { let output: Val = bevy::math::DQuat::xyz(_self.into_inner()) .into(); output @@ -14690,21 +21320,21 @@ impl bevy::math::DQuat { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::EulerRot { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) @@ -14718,49 +21348,61 @@ impl bevy::math::EulerRot { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::BVec3A { - fn all(_self: Val) { + /// Returns true if all the elements are true, false otherwise. + fn all(_self: Val) -> bool { let output: bool = bevy::math::BVec3A::all(_self.into_inner()).into(); output } - fn any(_self: Val) { + /// Returns true if any of the elements are true, false otherwise. + fn any(_self: Val) -> bool { let output: bool = bevy::math::BVec3A::any(_self.into_inner()).into(); output } - fn bitmask(_self: Val) { + /// Returns a bitmask with the lowest 3 bits set from the elements of `self`. + /// A true element results in a `1` bit and a false element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn bitmask(_self: Val) -> u32 { let output: u32 = bevy::math::BVec3A::bitmask(_self.into_inner()).into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, rhs: Ref) { + fn eq(_self: Ref, rhs: Ref) -> bool { let output: bool = >::eq(&_self, &rhs) .into(); output } - fn from_array(a: [bool; 3]) { + /// Creates a new vector mask from a bool array. + fn from_array(a: [bool; 3]) -> Val { let output: Val = bevy::math::BVec3A::from_array(a).into(); output } - fn new(x: bool, y: bool, z: bool) { + /// Creates a new vector mask. + fn new(x: bool, y: bool, z: bool) -> Val { let output: Val = bevy::math::BVec3A::new(x, y, z).into(); output } - fn set(mut _self: Mut, index: usize, value: bool) { + /// Sets the element at `index`. + /// Panics if `index` is greater than 2. + fn set(mut _self: Mut, index: usize, value: bool) -> () { let output: () = bevy::math::BVec3A::set(&mut _self, index, value).into(); output } - fn splat(v: bool) { + /// Creates a vector mask with all elements set to `v`. + fn splat(v: bool) -> Val { let output: Val = bevy::math::BVec3A::splat(v).into(); output } - fn test(_self: Ref, index: usize) { + /// Tests the value at `index`. + /// Panics if `index` is greater than 2. + fn test(_self: Ref, index: usize) -> bool { let output: bool = bevy::math::BVec3A::test(&_self, index).into(); output } @@ -14771,49 +21413,61 @@ impl bevy::math::BVec3A { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::math::BVec4A { - fn all(_self: Val) { + /// Returns true if all the elements are true, false otherwise. + fn all(_self: Val) -> bool { let output: bool = bevy::math::BVec4A::all(_self.into_inner()).into(); output } - fn any(_self: Val) { + /// Returns true if any of the elements are true, false otherwise. + fn any(_self: Val) -> bool { let output: bool = bevy::math::BVec4A::any(_self.into_inner()).into(); output } - fn bitmask(_self: Val) { + /// Returns a bitmask with the lowest 4 bits set from the elements of `self`. + /// A true element results in a `1` bit and a false element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn bitmask(_self: Val) -> u32 { let output: u32 = bevy::math::BVec4A::bitmask(_self.into_inner()).into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, rhs: Ref) { + fn eq(_self: Ref, rhs: Ref) -> bool { let output: bool = >::eq(&_self, &rhs) .into(); output } - fn from_array(a: [bool; 4]) { + /// Creates a new vector mask from a bool array. + fn from_array(a: [bool; 4]) -> Val { let output: Val = bevy::math::BVec4A::from_array(a).into(); output } - fn new(x: bool, y: bool, z: bool, w: bool) { + /// Creates a new vector mask. + fn new(x: bool, y: bool, z: bool, w: bool) -> Val { let output: Val = bevy::math::BVec4A::new(x, y, z, w).into(); output } - fn set(mut _self: Mut, index: usize, value: bool) { + /// Sets the element at `index`. + /// Panics if `index` is greater than 3. + fn set(mut _self: Mut, index: usize, value: bool) -> () { let output: () = bevy::math::BVec4A::set(&mut _self, index, value).into(); output } - fn splat(v: bool) { + /// Creates a vector mask with all elements set to `v`. + fn splat(v: bool) -> Val { let output: Val = bevy::math::BVec4A::splat(v).into(); output } - fn test(_self: Ref, index: usize) { + /// Tests the value at `index`. + /// Panics if `index` is greater than 3. + fn test(_self: Ref, index: usize) -> bool { let output: bool = bevy::math::BVec4A::test(&_self, index).into(); output } @@ -14824,33 +21478,33 @@ impl bevy::math::BVec4A { bms_core_path = "bevy_mod_scripting_core" )] impl smol_str::SmolStr { - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn is_empty(_self: Ref) { + fn is_empty(_self: Ref) -> bool { let output: bool = smol_str::SmolStr::is_empty(&_self).into(); output } - fn is_heap_allocated(_self: Ref) { + fn is_heap_allocated(_self: Ref) -> bool { let output: bool = smol_str::SmolStr::is_heap_allocated(&_self).into(); output } - fn len(_self: Ref) { + fn len(_self: Ref) -> usize { let output: usize = smol_str::SmolStr::len(&_self).into(); output } - fn to_string(_self: Ref) { + fn to_string(_self: Ref) -> std::string::String { let output: std::string::String = smol_str::SmolStr::to_string(&_self).into(); output } @@ -14861,99 +21515,354 @@ impl smol_str::SmolStr { bms_core_path = "bevy_mod_scripting_core" )] impl uuid::Uuid { - fn as_u128(_self: Ref) { + /// Returns a 128bit value containing the value. + /// The bytes in the UUID will be packed directly into a `u128`. + /// # Examples + /// ``` + /// # use uuid::Uuid; + /// # fn main() -> Result<(), uuid::Error> { + /// let uuid = Uuid::parse_str("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8")?; + /// assert_eq!( + /// uuid.as_u128(), + /// 0xa1a2a3a4b1b2c1c2d1d2d3d4d5d6d7d8, + /// ); + /// # Ok(()) + /// # } + /// ``` + fn as_u128(_self: Ref) -> u128 { let output: u128 = uuid::Uuid::as_u128(&_self).into(); output } - fn as_u64_pair(_self: Ref) { + /// Returns two 64bit values containing the value. + /// The bytes in the UUID will be split into two `u64`. + /// The first u64 represents the 64 most significant bits, + /// the second one represents the 64 least significant. + /// # Examples + /// ``` + /// # use uuid::Uuid; + /// # fn main() -> Result<(), uuid::Error> { + /// let uuid = Uuid::parse_str("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8")?; + /// assert_eq!( + /// uuid.as_u64_pair(), + /// (0xa1a2a3a4b1b2c1c2, 0xd1d2d3d4d5d6d7d8), + /// ); + /// # Ok(()) + /// # } + /// ``` + fn as_u64_pair(_self: Ref) -> (u64, u64) { let output: (u64, u64) = uuid::Uuid::as_u64_pair(&_self).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn encode_buffer() { + /// A buffer that can be used for `encode_...` calls, that is + /// guaranteed to be long enough for any of the format adapters. + /// # Examples + /// ``` + /// # use uuid::Uuid; + /// let uuid = Uuid::nil(); + /// assert_eq!( + /// uuid.simple().encode_lower(&mut Uuid::encode_buffer()), + /// "00000000000000000000000000000000" + /// ); + /// assert_eq!( + /// uuid.hyphenated() + /// .encode_lower(&mut Uuid::encode_buffer()), + /// "00000000-0000-0000-0000-000000000000" + /// ); + /// assert_eq!( + /// uuid.urn().encode_lower(&mut Uuid::encode_buffer()), + /// "urn:uuid:00000000-0000-0000-0000-000000000000" + /// ); + /// ``` + fn encode_buffer() -> [u8; 45] { let output: [u8; 45] = uuid::Uuid::encode_buffer().into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn from_bytes(bytes: [u8; 16]) { + /// Creates a UUID using the supplied bytes. + /// # Examples + /// Basic usage: + /// ``` + /// # fn main() -> Result<(), uuid::Error> { + /// # use uuid::Uuid; + /// let bytes = [ + /// 0xa1, 0xa2, 0xa3, 0xa4, + /// 0xb1, 0xb2, + /// 0xc1, 0xc2, + /// 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, + /// ]; + /// let uuid = Uuid::from_bytes(bytes); + /// assert_eq!( + /// uuid.hyphenated().to_string(), + /// "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8" + /// ); + /// # Ok(()) + /// # } + /// ``` + fn from_bytes(bytes: [u8; 16]) -> Val { let output: Val = uuid::Uuid::from_bytes(bytes).into(); output } - fn from_bytes_le(b: [u8; 16]) { + /// Creates a UUID using the supplied bytes in little endian order. + /// The individual fields encoded in the buffer will be flipped. + /// # Examples + /// Basic usage: + /// ``` + /// # fn main() -> Result<(), uuid::Error> { + /// # use uuid::Uuid; + /// let bytes = [ + /// 0xa1, 0xa2, 0xa3, 0xa4, + /// 0xb1, 0xb2, + /// 0xc1, 0xc2, + /// 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, + /// ]; + /// let uuid = Uuid::from_bytes_le(bytes); + /// assert_eq!( + /// "a4a3a2a1-b2b1-c2c1-d1d2-d3d4d5d6d7d8", + /// uuid.hyphenated().to_string(), + /// ); + /// # Ok(()) + /// # } + /// ``` + fn from_bytes_le(b: [u8; 16]) -> Val { let output: Val = uuid::Uuid::from_bytes_le(b).into(); output } - fn from_u128(v: u128) { + /// Creates a UUID from a 128bit value. + /// # Examples + /// Basic usage: + /// ``` + /// # use uuid::Uuid; + /// let v = 0xa1a2a3a4b1b2c1c2d1d2d3d4d5d6d7d8u128; + /// let uuid = Uuid::from_u128(v); + /// assert_eq!( + /// "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8", + /// uuid.hyphenated().to_string(), + /// ); + /// ``` + fn from_u128(v: u128) -> Val { let output: Val = uuid::Uuid::from_u128(v).into(); output } - fn from_u128_le(v: u128) { + /// Creates a UUID from a 128bit value in little-endian order. + /// The entire value will be flipped to convert into big-endian order. + /// This is based on the endianness of the UUID, rather than the target + /// environment so bytes will be flipped on both big and little endian + /// machines. + /// # Examples + /// Basic usage: + /// ``` + /// # use uuid::Uuid; + /// let v = 0xa1a2a3a4b1b2c1c2d1d2d3d4d5d6d7d8u128; + /// let uuid = Uuid::from_u128_le(v); + /// assert_eq!( + /// "d8d7d6d5-d4d3-d2d1-c2c1-b2b1a4a3a2a1", + /// uuid.hyphenated().to_string(), + /// ); + /// ``` + fn from_u128_le(v: u128) -> Val { let output: Val = uuid::Uuid::from_u128_le(v).into(); output } - fn from_u64_pair(high_bits: u64, low_bits: u64) { + /// Creates a UUID from two 64bit values. + /// # Examples + /// Basic usage: + /// ``` + /// # use uuid::Uuid; + /// let hi = 0xa1a2a3a4b1b2c1c2u64; + /// let lo = 0xd1d2d3d4d5d6d7d8u64; + /// let uuid = Uuid::from_u64_pair(hi, lo); + /// assert_eq!( + /// "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8", + /// uuid.hyphenated().to_string(), + /// ); + /// ``` + fn from_u64_pair(high_bits: u64, low_bits: u64) -> Val { let output: Val = uuid::Uuid::from_u64_pair(high_bits, low_bits) .into(); output } - fn get_node_id(_self: Ref) { + /// If the UUID is the correct version (v1, or v6) this will return the + /// node value as a 6-byte array. For other versions this will return `None`. + fn get_node_id( + _self: Ref, + ) -> bevy::reflect::erased_serde::__private::serde::__private::Option<[u8; 6]> { let output: bevy::reflect::erased_serde::__private::serde::__private::Option< [u8; 6], > = uuid::Uuid::get_node_id(&_self).into(); output } - fn get_version_num(_self: Ref) { + /// Returns the version number of the UUID. + /// This represents the algorithm used to generate the value. + /// This method is the future-proof alternative to [`Uuid::get_version`]. + /// # Examples + /// Basic usage: + /// ``` + /// # use uuid::Uuid; + /// # fn main() -> Result<(), uuid::Error> { + /// let my_uuid = Uuid::parse_str("02f09a3f-1624-3b1d-8409-44eff7708208")?; + /// assert_eq!(3, my_uuid.get_version_num()); + /// # Ok(()) + /// # } + /// ``` + /// # References + /// * [Version Field in RFC 9562](https://www.ietf.org/rfc/rfc9562.html#section-4.2) + fn get_version_num(_self: Ref) -> usize { let output: usize = uuid::Uuid::get_version_num(&_self).into(); output } - fn into_bytes(_self: Val) { + /// Consumes self and returns the underlying byte value of the UUID. + /// # Examples + /// ``` + /// # use uuid::Uuid; + /// let bytes = [ + /// 0xa1, 0xa2, 0xa3, 0xa4, + /// 0xb1, 0xb2, + /// 0xc1, 0xc2, + /// 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, + /// ]; + /// let uuid = Uuid::from_bytes(bytes); + /// assert_eq!(bytes, uuid.into_bytes()); + /// ``` + fn into_bytes(_self: Val) -> [u8; 16] { let output: [u8; 16] = uuid::Uuid::into_bytes(_self.into_inner()).into(); output } - fn is_max(_self: Ref) { + /// Tests if the UUID is max (all ones). + fn is_max(_self: Ref) -> bool { let output: bool = uuid::Uuid::is_max(&_self).into(); output } - fn is_nil(_self: Ref) { + /// Tests if the UUID is nil (all zeros). + fn is_nil(_self: Ref) -> bool { let output: bool = uuid::Uuid::is_nil(&_self).into(); output } - fn max() { + /// The 'max UUID' (all ones). + /// The max UUID is a special form of UUID that is specified to have all + /// 128 bits set to one. + /// # References + /// * [Max UUID in RFC 9562](https://www.ietf.org/rfc/rfc9562.html#section-5.10) + /// # Examples + /// Basic usage: + /// ``` + /// # use uuid::Uuid; + /// let uuid = Uuid::max(); + /// assert_eq!( + /// "ffffffff-ffff-ffff-ffff-ffffffffffff", + /// uuid.hyphenated().to_string(), + /// ); + /// ``` + fn max() -> Val { let output: Val = uuid::Uuid::max().into(); output } - fn new_v4() { + /// Creates a random UUID. + /// This uses the [`getrandom`] crate to utilise the operating system's RNG + /// as the source of random numbers. If you'd like to use a custom + /// generator, don't use this method: generate random bytes using your + /// custom generator and pass them to the + /// [`uuid::Builder::from_random_bytes`][from_random_bytes] function + /// instead. + /// Note that usage of this method requires the `v4` feature of this crate + /// to be enabled. + /// # Examples + /// Basic usage: + /// ``` + /// # use uuid::{Uuid, Version}; + /// let uuid = Uuid::new_v4(); + /// assert_eq!(Some(Version::Random), uuid.get_version()); + /// ``` + /// # References + /// * [UUID Version 4 in RFC 9562](https://www.ietf.org/rfc/rfc9562.html#section-5.4) + /// [`getrandom`]: https://crates.io/crates/getrandom + /// [from_random_bytes]: struct.Builder.html#method.from_random_bytes + fn new_v4() -> Val { let output: Val = uuid::Uuid::new_v4().into(); output } - fn nil() { + /// The 'nil UUID' (all zeros). + /// The nil UUID is a special form of UUID that is specified to have all + /// 128 bits set to zero. + /// # References + /// * [Nil UUID in RFC 9562](https://www.ietf.org/rfc/rfc9562.html#section-5.9) + /// # Examples + /// Basic usage: + /// ``` + /// # use uuid::Uuid; + /// let uuid = Uuid::nil(); + /// assert_eq!( + /// "00000000-0000-0000-0000-000000000000", + /// uuid.hyphenated().to_string(), + /// ); + /// ``` + fn nil() -> Val { let output: Val = uuid::Uuid::nil().into(); output } - fn to_bytes_le(_self: Ref) { + /// Returns the bytes of the UUID in little-endian order. + /// The bytes will be flipped to convert into little-endian order. This is + /// based on the endianness of the UUID, rather than the target environment + /// so bytes will be flipped on both big and little endian machines. + /// # Examples + /// ``` + /// use uuid::Uuid; + /// # fn main() -> Result<(), uuid::Error> { + /// let uuid = Uuid::parse_str("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8")?; + /// assert_eq!( + /// uuid.to_bytes_le(), + /// ([ + /// 0xa4, 0xa3, 0xa2, 0xa1, 0xb2, 0xb1, 0xc2, 0xc1, 0xd1, 0xd2, + /// 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8 + /// ]) + /// ); + /// # Ok(()) + /// # } + /// ``` + fn to_bytes_le(_self: Ref) -> [u8; 16] { let output: [u8; 16] = uuid::Uuid::to_bytes_le(&_self).into(); output } - fn to_u128_le(_self: Ref) { + /// Returns a 128bit little-endian value containing the value. + /// The bytes in the `u128` will be flipped to convert into big-endian + /// order. This is based on the endianness of the UUID, rather than the + /// target environment so bytes will be flipped on both big and little + /// endian machines. + /// Note that this will produce a different result than + /// [`Uuid::to_fields_le`], because the entire UUID is reversed, rather + /// than reversing the individual fields in-place. + /// # Examples + /// ``` + /// # use uuid::Uuid; + /// # fn main() -> Result<(), uuid::Error> { + /// let uuid = Uuid::parse_str("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8")?; + /// assert_eq!( + /// uuid.to_u128_le(), + /// 0xd8d7d6d5d4d3d2d1c2c1b2b1a4a3a2a1, + /// ); + /// # Ok(()) + /// # } + /// ``` + fn to_u128_le(_self: Ref) -> u128 { let output: u128 = uuid::Uuid::to_u128_le(&_self).into(); output } diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_time.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_time.rs index beb44be1f7..2693af0abb 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_time.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_time.rs @@ -18,7 +18,7 @@ pub struct BevyTimeScriptingPlugin; bms_core_path = "bevy_mod_scripting_core" )] impl bevy::time::prelude::Fixed { - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) @@ -32,7 +32,7 @@ impl bevy::time::prelude::Fixed { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::time::prelude::Real { - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) @@ -46,65 +46,134 @@ impl bevy::time::prelude::Real { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::time::prelude::Timer { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn duration(_self: Ref) { + /// Returns the duration of the timer. + /// # Examples + /// ``` + /// # use bevy_time::*; + /// use std::time::Duration; + /// let timer = Timer::new(Duration::from_secs(1), TimerMode::Once); + /// assert_eq!(timer.duration(), Duration::from_secs(1)); + /// ``` + fn duration(_self: Ref) -> Val { let output: Val = bevy::time::prelude::Timer::duration( &_self, ) .into(); output } - fn elapsed(_self: Ref) { + /// Returns the time elapsed on the timer. Guaranteed to be between 0.0 and `duration`. + /// Will only equal `duration` when the timer is finished and non repeating. + /// See also [`Stopwatch::elapsed`](Stopwatch::elapsed). + /// # Examples + /// ``` + /// # use bevy_time::*; + /// use std::time::Duration; + /// let mut timer = Timer::from_seconds(1.0, TimerMode::Once); + /// timer.tick(Duration::from_secs_f32(0.5)); + /// assert_eq!(timer.elapsed(), Duration::from_secs_f32(0.5)); + /// ``` + fn elapsed(_self: Ref) -> Val { let output: Val = bevy::time::prelude::Timer::elapsed( &_self, ) .into(); output } - fn elapsed_secs(_self: Ref) { + /// Returns the time elapsed on the timer as an `f32`. + /// See also [`Timer::elapsed`](Timer::elapsed). + fn elapsed_secs(_self: Ref) -> f32 { let output: f32 = bevy::time::prelude::Timer::elapsed_secs(&_self).into(); output } - fn elapsed_secs_f64(_self: Ref) { + /// Returns the time elapsed on the timer as an `f64`. + /// See also [`Timer::elapsed`](Timer::elapsed). + fn elapsed_secs_f64(_self: Ref) -> f64 { let output: f64 = bevy::time::prelude::Timer::elapsed_secs_f64(&_self).into(); output } fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn finished(_self: Ref) { + /// Returns `true` if the timer has reached its duration. + /// For repeating timers, this method behaves identically to [`Timer::just_finished`]. + /// # Examples + /// ``` + /// # use bevy_time::*; + /// use std::time::Duration; + /// let mut timer_once = Timer::from_seconds(1.0, TimerMode::Once); + /// timer_once.tick(Duration::from_secs_f32(1.5)); + /// assert!(timer_once.finished()); + /// timer_once.tick(Duration::from_secs_f32(0.5)); + /// assert!(timer_once.finished()); + /// let mut timer_repeating = Timer::from_seconds(1.0, TimerMode::Repeating); + /// timer_repeating.tick(Duration::from_secs_f32(1.1)); + /// assert!(timer_repeating.finished()); + /// timer_repeating.tick(Duration::from_secs_f32(0.8)); + /// assert!(!timer_repeating.finished()); + /// timer_repeating.tick(Duration::from_secs_f32(0.6)); + /// assert!(timer_repeating.finished()); + /// ``` + fn finished(_self: Ref) -> bool { let output: bool = bevy::time::prelude::Timer::finished(&_self).into(); output } - fn fraction(_self: Ref) { + /// Returns the fraction of the timer elapsed time (goes from 0.0 to 1.0). + /// # Examples + /// ``` + /// # use bevy_time::*; + /// use std::time::Duration; + /// let mut timer = Timer::from_seconds(2.0, TimerMode::Once); + /// timer.tick(Duration::from_secs_f32(0.5)); + /// assert_eq!(timer.fraction(), 0.25); + /// ``` + fn fraction(_self: Ref) -> f32 { let output: f32 = bevy::time::prelude::Timer::fraction(&_self).into(); output } - fn fraction_remaining(_self: Ref) { + /// Returns the fraction of the timer remaining time (goes from 1.0 to 0.0). + /// # Examples + /// ``` + /// # use bevy_time::*; + /// use std::time::Duration; + /// let mut timer = Timer::from_seconds(2.0, TimerMode::Once); + /// timer.tick(Duration::from_secs_f32(0.5)); + /// assert_eq!(timer.fraction_remaining(), 0.75); + /// ``` + fn fraction_remaining(_self: Ref) -> f32 { let output: f32 = bevy::time::prelude::Timer::fraction_remaining(&_self).into(); output } - fn from_seconds(duration: f32, mode: Val) { + /// Creates a new timer with a given duration in seconds. + /// # Example + /// ``` + /// # use bevy_time::*; + /// let mut timer = Timer::from_seconds(1.0, TimerMode::Once); + /// ``` + fn from_seconds( + duration: f32, + mode: Val, + ) -> Val { let output: Val = bevy::time::prelude::Timer::from_seconds( duration, mode.into_inner(), @@ -112,21 +181,43 @@ impl bevy::time::prelude::Timer { .into(); output } - fn just_finished(_self: Ref) { + /// Returns `true` only on the tick the timer reached its duration. + /// # Examples + /// ``` + /// # use bevy_time::*; + /// use std::time::Duration; + /// let mut timer = Timer::from_seconds(1.0, TimerMode::Once); + /// timer.tick(Duration::from_secs_f32(1.5)); + /// assert!(timer.just_finished()); + /// timer.tick(Duration::from_secs_f32(0.5)); + /// assert!(!timer.just_finished()); + /// ``` + fn just_finished(_self: Ref) -> bool { let output: bool = bevy::time::prelude::Timer::just_finished(&_self).into(); output } - fn mode(_self: Ref) { + /// Returns the mode of the timer. + /// # Examples + /// ``` + /// # use bevy_time::*; + /// let mut timer = Timer::from_seconds(1.0, TimerMode::Repeating); + /// assert_eq!(timer.mode(), TimerMode::Repeating); + /// ``` + fn mode( + _self: Ref, + ) -> Val { let output: Val = bevy::time::prelude::Timer::mode( &_self, ) .into(); output } + /// Creates a new timer with a given duration. + /// See also [`Timer::from_seconds`](Timer::from_seconds). fn new( duration: Val, mode: Val, - ) { + ) -> Val { let output: Val = bevy::time::prelude::Timer::new( duration.into_inner(), mode.into_inner(), @@ -134,33 +225,98 @@ impl bevy::time::prelude::Timer { .into(); output } - fn pause(mut _self: Mut) { + /// Pauses the Timer. Disables the ticking of the timer. + /// See also [`Stopwatch::pause`](Stopwatch::pause). + /// # Examples + /// ``` + /// # use bevy_time::*; + /// use std::time::Duration; + /// let mut timer = Timer::from_seconds(1.0, TimerMode::Once); + /// timer.pause(); + /// timer.tick(Duration::from_secs_f32(0.5)); + /// assert_eq!(timer.elapsed_secs(), 0.0); + /// ``` + fn pause(mut _self: Mut) -> () { let output: () = bevy::time::prelude::Timer::pause(&mut _self).into(); output } - fn paused(_self: Ref) { + /// Returns `true` if the timer is paused. + /// See also [`Stopwatch::is_paused`](Stopwatch::is_paused). + /// # Examples + /// ``` + /// # use bevy_time::*; + /// let mut timer = Timer::from_seconds(1.0, TimerMode::Once); + /// assert!(!timer.paused()); + /// timer.pause(); + /// assert!(timer.paused()); + /// timer.unpause(); + /// assert!(!timer.paused()); + /// ``` + fn paused(_self: Ref) -> bool { let output: bool = bevy::time::prelude::Timer::paused(&_self).into(); output } - fn remaining(_self: Ref) { + /// Returns the remaining time using Duration + /// # Examples + /// ``` + /// # use bevy_time::*; + /// use std::time::Duration; + /// let mut timer = Timer::from_seconds(2.0, TimerMode::Once); + /// timer.tick(Duration::from_secs_f32(0.5)); + /// assert_eq!(timer.remaining(), Duration::from_secs_f32(1.5)); + /// ``` + fn remaining(_self: Ref) -> Val { let output: Val = bevy::time::prelude::Timer::remaining( &_self, ) .into(); output } - fn remaining_secs(_self: Ref) { + /// Returns the remaining time in seconds + /// # Examples + /// ``` + /// # use bevy_time::*; + /// use std::cmp::Ordering; + /// use std::time::Duration; + /// let mut timer = Timer::from_seconds(2.0, TimerMode::Once); + /// timer.tick(Duration::from_secs_f32(0.5)); + /// let result = timer.remaining_secs().total_cmp(&1.5); + /// assert_eq!(Ordering::Equal, result); + /// ``` + fn remaining_secs(_self: Ref) -> f32 { let output: f32 = bevy::time::prelude::Timer::remaining_secs(&_self).into(); output } - fn reset(mut _self: Mut) { + /// Resets the timer. The reset doesn't affect the `paused` state of the timer. + /// See also [`Stopwatch::reset`](Stopwatch::reset). + /// Examples + /// ``` + /// # use bevy_time::*; + /// use std::time::Duration; + /// let mut timer = Timer::from_seconds(1.0, TimerMode::Once); + /// timer.tick(Duration::from_secs_f32(1.5)); + /// timer.reset(); + /// assert!(!timer.finished()); + /// assert!(!timer.just_finished()); + /// assert_eq!(timer.elapsed_secs(), 0.0); + /// ``` + fn reset(mut _self: Mut) -> () { let output: () = bevy::time::prelude::Timer::reset(&mut _self).into(); output } + /// Sets the duration of the timer. + /// # Examples + /// ``` + /// # use bevy_time::*; + /// use std::time::Duration; + /// let mut timer = Timer::from_seconds(1.5, TimerMode::Once); + /// timer.set_duration(Duration::from_secs(1)); + /// assert_eq!(timer.duration(), Duration::from_secs(1)); + /// ``` fn set_duration( mut _self: Mut, duration: Val, - ) { + ) -> () { let output: () = bevy::time::prelude::Timer::set_duration( &mut _self, duration.into_inner(), @@ -168,10 +324,22 @@ impl bevy::time::prelude::Timer { .into(); output } + /// Sets the elapsed time of the timer without any other considerations. + /// See also [`Stopwatch::set`](Stopwatch::set). + /// # + /// ``` + /// # use bevy_time::*; + /// use std::time::Duration; + /// let mut timer = Timer::from_seconds(1.0, TimerMode::Once); + /// timer.set_elapsed(Duration::from_secs(2)); + /// assert_eq!(timer.elapsed(), Duration::from_secs(2)); + /// // the timer is not finished even if the elapsed time is greater than the duration. + /// assert!(!timer.finished()); + /// ``` fn set_elapsed( mut _self: Mut, time: Val, - ) { + ) -> () { let output: () = bevy::time::prelude::Timer::set_elapsed( &mut _self, time.into_inner(), @@ -179,10 +347,18 @@ impl bevy::time::prelude::Timer { .into(); output } + /// Sets the mode of the timer. + /// # Examples + /// ``` + /// # use bevy_time::*; + /// let mut timer = Timer::from_seconds(1.0, TimerMode::Repeating); + /// timer.set_mode(TimerMode::Once); + /// assert_eq!(timer.mode(), TimerMode::Once); + /// ``` fn set_mode( mut _self: Mut, mode: Val, - ) { + ) -> () { let output: () = bevy::time::prelude::Timer::set_mode( &mut _self, mode.into_inner(), @@ -190,12 +366,41 @@ impl bevy::time::prelude::Timer { .into(); output } - fn times_finished_this_tick(_self: Ref) { + /// Returns the number of times a repeating timer + /// finished during the last [`tick`](Timer::tick) call. + /// For non repeating-timers, this method will only ever + /// return 0 or 1. + /// # Examples + /// ``` + /// # use bevy_time::*; + /// use std::time::Duration; + /// let mut timer = Timer::from_seconds(1.0, TimerMode::Repeating); + /// timer.tick(Duration::from_secs_f32(6.0)); + /// assert_eq!(timer.times_finished_this_tick(), 6); + /// timer.tick(Duration::from_secs_f32(2.0)); + /// assert_eq!(timer.times_finished_this_tick(), 2); + /// timer.tick(Duration::from_secs_f32(0.5)); + /// assert_eq!(timer.times_finished_this_tick(), 0); + /// ``` + fn times_finished_this_tick(_self: Ref) -> u32 { let output: u32 = bevy::time::prelude::Timer::times_finished_this_tick(&_self) .into(); output } - fn unpause(mut _self: Mut) { + /// Unpauses the Timer. Resumes the ticking of the timer. + /// See also [`Stopwatch::unpause()`](Stopwatch::unpause). + /// # Examples + /// ``` + /// # use bevy_time::*; + /// use std::time::Duration; + /// let mut timer = Timer::from_seconds(1.0, TimerMode::Once); + /// timer.pause(); + /// timer.tick(Duration::from_secs_f32(0.5)); + /// timer.unpause(); + /// timer.tick(Duration::from_secs_f32(0.5)); + /// assert_eq!(timer.elapsed_secs(), 0.5); + /// ``` + fn unpause(mut _self: Mut) -> () { let output: () = bevy::time::prelude::Timer::unpause(&mut _self).into(); output } @@ -206,14 +411,16 @@ impl bevy::time::prelude::Timer { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::time::prelude::TimerMode { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -223,7 +430,7 @@ impl bevy::time::prelude::TimerMode { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) @@ -237,7 +444,9 @@ impl bevy::time::prelude::TimerMode { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::time::prelude::Virtual { - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) @@ -251,60 +460,141 @@ impl bevy::time::prelude::Virtual { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::time::Stopwatch { - fn assert_receiver_is_total_eq(_self: Ref) { + fn assert_receiver_is_total_eq(_self: Ref) -> () { let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone(_self: Ref) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn elapsed(_self: Ref) { + /// Returns the elapsed time since the last [`reset`](Stopwatch::reset) + /// of the stopwatch. + /// # Examples + /// ``` + /// # use bevy_time::*; + /// use std::time::Duration; + /// let mut stopwatch = Stopwatch::new(); + /// stopwatch.tick(Duration::from_secs(1)); + /// assert_eq!(stopwatch.elapsed(), Duration::from_secs(1)); + /// ``` + /// # See Also + /// [`elapsed_secs`](Stopwatch::elapsed_secs) - if an `f32` value is desirable instead. + /// [`elapsed_secs_f64`](Stopwatch::elapsed_secs_f64) - if an `f64` is desirable instead. + fn elapsed(_self: Ref) -> Val { let output: Val = bevy::time::Stopwatch::elapsed(&_self) .into(); output } - fn elapsed_secs(_self: Ref) { + /// Returns the elapsed time since the last [`reset`](Stopwatch::reset) + /// of the stopwatch, in seconds. + /// # Examples + /// ``` + /// # use bevy_time::*; + /// use std::time::Duration; + /// let mut stopwatch = Stopwatch::new(); + /// stopwatch.tick(Duration::from_secs(1)); + /// assert_eq!(stopwatch.elapsed_secs(), 1.0); + /// ``` + /// # See Also + /// [`elapsed`](Stopwatch::elapsed) - if a `Duration` is desirable instead. + /// [`elapsed_secs_f64`](Stopwatch::elapsed_secs_f64) - if an `f64` is desirable instead. + fn elapsed_secs(_self: Ref) -> f32 { let output: f32 = bevy::time::Stopwatch::elapsed_secs(&_self).into(); output } - fn elapsed_secs_f64(_self: Ref) { + /// Returns the elapsed time since the last [`reset`](Stopwatch::reset) + /// of the stopwatch, in seconds, as f64. + /// # See Also + /// [`elapsed`](Stopwatch::elapsed) - if a `Duration` is desirable instead. + /// [`elapsed_secs`](Stopwatch::elapsed_secs) - if an `f32` is desirable instead. + fn elapsed_secs_f64(_self: Ref) -> f64 { let output: f64 = bevy::time::Stopwatch::elapsed_secs_f64(&_self).into(); output } - fn eq(_self: Ref, other: Ref) { + fn eq(_self: Ref, other: Ref) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn is_paused(_self: Ref) { + /// Returns `true` if the stopwatch is paused. + /// # Examples + /// ``` + /// # use bevy_time::*; + /// let mut stopwatch = Stopwatch::new(); + /// assert!(!stopwatch.is_paused()); + /// stopwatch.pause(); + /// assert!(stopwatch.is_paused()); + /// stopwatch.unpause(); + /// assert!(!stopwatch.is_paused()); + /// ``` + fn is_paused(_self: Ref) -> bool { let output: bool = bevy::time::Stopwatch::is_paused(&_self).into(); output } - fn new() { + /// Create a new unpaused `Stopwatch` with no elapsed time. + /// # Examples + /// ``` + /// # use bevy_time::*; + /// let stopwatch = Stopwatch::new(); + /// assert_eq!(stopwatch.elapsed_secs(), 0.0); + /// assert_eq!(stopwatch.is_paused(), false); + /// ``` + fn new() -> Val { let output: Val = bevy::time::Stopwatch::new().into(); output } - fn pause(mut _self: Mut) { + /// Pauses the stopwatch. Any call to [`tick`](Stopwatch::tick) while + /// paused will not have any effect on the elapsed time. + /// # Examples + /// ``` + /// # use bevy_time::*; + /// use std::time::Duration; + /// let mut stopwatch = Stopwatch::new(); + /// stopwatch.pause(); + /// stopwatch.tick(Duration::from_secs_f32(1.5)); + /// assert!(stopwatch.is_paused()); + /// assert_eq!(stopwatch.elapsed_secs(), 0.0); + /// ``` + fn pause(mut _self: Mut) -> () { let output: () = bevy::time::Stopwatch::pause(&mut _self).into(); output } - fn reset(mut _self: Mut) { + /// Resets the stopwatch. The reset doesn't affect the paused state of the stopwatch. + /// # Examples + /// ``` + /// # use bevy_time::*; + /// use std::time::Duration; + /// let mut stopwatch = Stopwatch::new(); + /// stopwatch.tick(Duration::from_secs_f32(1.5)); + /// stopwatch.reset(); + /// assert_eq!(stopwatch.elapsed_secs(), 0.0); + /// ``` + fn reset(mut _self: Mut) -> () { let output: () = bevy::time::Stopwatch::reset(&mut _self).into(); output } + /// Sets the elapsed time of the stopwatch. + /// # Examples + /// ``` + /// # use bevy_time::*; + /// use std::time::Duration; + /// let mut stopwatch = Stopwatch::new(); + /// stopwatch.set_elapsed(Duration::from_secs_f32(1.0)); + /// assert_eq!(stopwatch.elapsed_secs(), 1.0); + /// ``` fn set_elapsed( mut _self: Mut, time: Val, - ) { + ) -> () { let output: () = bevy::time::Stopwatch::set_elapsed( &mut _self, time.into_inner(), @@ -312,7 +602,20 @@ impl bevy::time::Stopwatch { .into(); output } - fn unpause(mut _self: Mut) { + /// Unpauses the stopwatch. Resume the effect of ticking on elapsed time. + /// # Examples + /// ``` + /// # use bevy_time::*; + /// use std::time::Duration; + /// let mut stopwatch = Stopwatch::new(); + /// stopwatch.pause(); + /// stopwatch.tick(Duration::from_secs_f32(1.0)); + /// stopwatch.unpause(); + /// stopwatch.tick(Duration::from_secs_f32(1.0)); + /// assert!(!stopwatch.is_paused()); + /// assert_eq!(stopwatch.elapsed_secs(), 1.0); + /// ``` + fn unpause(mut _self: Mut) -> () { let output: () = bevy::time::Stopwatch::unpause(&mut _self).into(); output } diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_transform.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_transform.rs index 4c3fd5c699..a6bb246da4 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_transform.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_transform.rs @@ -18,42 +18,61 @@ pub struct BevyTransformScriptingPlugin; bms_core_path = "bevy_mod_scripting_core" )] impl bevy::transform::components::GlobalTransform { - fn affine(_self: Ref) { + /// Returns the 3d affine transformation matrix as an [`Affine3A`]. + fn affine( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::GlobalTransform::affine( &_self, ) .into(); output } - fn back(_self: Ref) { + /// Return the local back vector (Z). + fn back( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::GlobalTransform::back( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn compute_matrix(_self: Ref) { + /// Returns the 3d affine transformation matrix as a [`Mat4`]. + fn compute_matrix( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::GlobalTransform::compute_matrix( &_self, ) .into(); output } - fn compute_transform(_self: Ref) { + /// Returns the transformation as a [`Transform`]. + /// The transform is expected to be non-degenerate and without shearing, or the output + /// will be invalid. + fn compute_transform( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::GlobalTransform::compute_transform( &_self, ) .into(); output } - fn down(_self: Ref) { + /// Return the local down vector (-Y). + fn down( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::GlobalTransform::down( &_self, ) @@ -63,49 +82,64 @@ impl bevy::transform::components::GlobalTransform { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn forward(_self: Ref) { + /// Return the local forward vector (-Z). + fn forward( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::GlobalTransform::forward( &_self, ) .into(); output } - fn from_isometry(iso: Val) { + fn from_isometry( + iso: Val, + ) -> Val { let output: Val = bevy::transform::components::GlobalTransform::from_isometry( iso.into_inner(), ) .into(); output } - fn from_rotation(rotation: Val) { + fn from_rotation( + rotation: Val, + ) -> Val { let output: Val = bevy::transform::components::GlobalTransform::from_rotation( rotation.into_inner(), ) .into(); output } - fn from_scale(scale: Val) { + fn from_scale( + scale: Val, + ) -> Val { let output: Val = bevy::transform::components::GlobalTransform::from_scale( scale.into_inner(), ) .into(); output } - fn from_translation(translation: Val) { + fn from_translation( + translation: Val, + ) -> Val { let output: Val = bevy::transform::components::GlobalTransform::from_translation( translation.into_inner(), ) .into(); output } - fn from_xyz(x: f32, y: f32, z: f32) { + fn from_xyz( + x: f32, + y: f32, + z: f32, + ) -> Val { let output: Val = bevy::transform::components::GlobalTransform::from_xyz( x, y, @@ -114,7 +148,10 @@ impl bevy::transform::components::GlobalTransform { .into(); output } - fn left(_self: Ref) { + /// Return the local left vector (-X). + fn left( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::GlobalTransform::left( &_self, ) @@ -124,7 +161,7 @@ impl bevy::transform::components::GlobalTransform { fn mul( _self: Val, value: Val, - ) { + ) -> Val { let output: Val = >::mul(_self.into_inner(), value.into_inner()) @@ -134,7 +171,7 @@ impl bevy::transform::components::GlobalTransform { fn mul( _self: Val, global_transform: Val, - ) { + ) -> Val { let output: Val = >::mul(_self.into_inner(), global_transform.into_inner()) @@ -144,17 +181,19 @@ impl bevy::transform::components::GlobalTransform { fn mul( _self: Val, transform: Val, - ) { + ) -> Val { let output: Val = >::mul(_self.into_inner(), transform.into_inner()) .into(); output } + /// Multiplies `self` with `transform` component by component, returning the + /// resulting [`GlobalTransform`] fn mul_transform( _self: Ref, transform: Val, - ) { + ) -> Val { let output: Val = bevy::transform::components::GlobalTransform::mul_transform( &_self, transform.into_inner(), @@ -162,10 +201,11 @@ impl bevy::transform::components::GlobalTransform { .into(); output } + /// Get an upper bound of the radius from the given `extents`. fn radius_vec3a( _self: Ref, extents: Val, - ) { + ) -> f32 { let output: f32 = bevy::transform::components::GlobalTransform::radius_vec3a( &_self, extents.into_inner(), @@ -173,10 +213,40 @@ impl bevy::transform::components::GlobalTransform { .into(); output } + /// Returns the [`Transform`] `self` would have if it was a child of an entity + /// with the `parent` [`GlobalTransform`]. + /// This is useful if you want to "reparent" an [`Entity`](bevy_ecs::entity::Entity). + /// Say you have an entity `e1` that you want to turn into a child of `e2`, + /// but you want `e1` to keep the same global transform, even after re-parenting. You would use: + /// ``` + /// # use bevy_transform::prelude::{GlobalTransform, Transform}; + /// # use bevy_ecs::prelude::{Entity, Query, Component, Commands}; + /// # use bevy_hierarchy::{prelude::Parent, BuildChildren}; + /// #[derive(Component)] + /// struct ToReparent { + /// new_parent: Entity, + /// } + /// fn reparent_system( + /// mut commands: Commands, + /// mut targets: Query<(&mut Transform, Entity, &GlobalTransform, &ToReparent)>, + /// transforms: Query<&GlobalTransform>, + /// ) { + /// for (mut transform, entity, initial, to_reparent) in targets.iter_mut() { + /// if let Ok(parent_transform) = transforms.get(to_reparent.new_parent) { + /// *transform = initial.reparented_to(parent_transform); + /// commands.entity(entity) + /// .remove::() + /// .set_parent(to_reparent.new_parent); + /// } + /// } + /// } + /// ``` + /// The transform is expected to be non-degenerate and without shearing, or the output + /// will be invalid. fn reparented_to( _self: Ref, parent: Ref, - ) { + ) -> Val { let output: Val = bevy::transform::components::GlobalTransform::reparented_to( &_self, &parent, @@ -184,38 +254,90 @@ impl bevy::transform::components::GlobalTransform { .into(); output } - fn right(_self: Ref) { + /// Return the local right vector (X). + fn right( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::GlobalTransform::right( &_self, ) .into(); output } - fn rotation(_self: Ref) { + /// Get the rotation as a [`Quat`]. + /// The transform is expected to be non-degenerate and without shearing, or the output will be invalid. + /// # Warning + /// This is calculated using `to_scale_rotation_translation`, meaning that you + /// should probably use it directly if you also need translation or scale. + fn rotation( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::GlobalTransform::rotation( &_self, ) .into(); output } - fn scale(_self: Ref) { + /// Get the scale as a [`Vec3`]. + /// The transform is expected to be non-degenerate and without shearing, or the output will be invalid. + /// Some of the computations overlap with `to_scale_rotation_translation`, which means you should use + /// it instead if you also need rotation. + fn scale( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::GlobalTransform::scale( &_self, ) .into(); output } - fn to_isometry(_self: Ref) { + /// Returns the isometric part of the transformation as an [isometry]. Any scaling done by the + /// transformation will be ignored. + /// The transform is expected to be non-degenerate and without shearing, or the output + /// will be invalid. + /// [isometry]: Isometry3d + fn to_isometry( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::GlobalTransform::to_isometry( &_self, ) .into(); output } + /// Transforms the given point from local space to global space, applying shear, scale, rotation and translation. + /// It can be used like this: + /// ``` + /// # use bevy_transform::prelude::{GlobalTransform}; + /// # use bevy_math::prelude::Vec3; + /// let global_transform = GlobalTransform::from_xyz(1., 2., 3.); + /// let local_point = Vec3::new(1., 2., 3.); + /// let global_point = global_transform.transform_point(local_point); + /// assert_eq!(global_point, Vec3::new(2., 4., 6.)); + /// ``` + /// ``` + /// # use bevy_transform::prelude::{GlobalTransform}; + /// # use bevy_math::Vec3; + /// let global_point = Vec3::new(2., 4., 6.); + /// let global_transform = GlobalTransform::from_xyz(1., 2., 3.); + /// let local_point = global_transform.affine().inverse().transform_point3(global_point); + /// assert_eq!(local_point, Vec3::new(1., 2., 3.)) + /// ``` + /// To apply shear, scale, and rotation *without* applying translation, different functions are available: + /// ``` + /// # use bevy_transform::prelude::{GlobalTransform}; + /// # use bevy_math::prelude::Vec3; + /// let global_transform = GlobalTransform::from_xyz(1., 2., 3.); + /// let local_direction = Vec3::new(1., 2., 3.); + /// let global_direction = global_transform.affine().transform_vector3(local_direction); + /// assert_eq!(global_direction, Vec3::new(1., 2., 3.)); + /// let roundtripped_local_direction = global_transform.affine().inverse().transform_vector3(global_direction); + /// assert_eq!(roundtripped_local_direction, local_direction); + /// ``` fn transform_point( _self: Ref, point: Val, - ) { + ) -> Val { let output: Val = bevy::transform::components::GlobalTransform::transform_point( &_self, point.into_inner(), @@ -223,21 +345,30 @@ impl bevy::transform::components::GlobalTransform { .into(); output } - fn translation(_self: Ref) { + /// Get the translation as a [`Vec3`]. + fn translation( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::GlobalTransform::translation( &_self, ) .into(); output } - fn translation_vec3a(_self: Ref) { + /// Get the translation as a [`Vec3A`]. + fn translation_vec3a( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::GlobalTransform::translation_vec3a( &_self, ) .into(); output } - fn up(_self: Ref) { + /// Return the local up vector (Y). + fn up( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::GlobalTransform::up( &_self, ) @@ -251,35 +382,51 @@ impl bevy::transform::components::GlobalTransform { bms_core_path = "bevy_mod_scripting_core" )] impl bevy::transform::components::Transform { - fn back(_self: Ref) { + /// Equivalent to [`local_z()`][Transform::local_z] + fn back( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::Transform::back( &_self, ) .into(); output } - fn clone(_self: Ref) { + fn clone( + _self: Ref, + ) -> Val { let output: Val = ::clone( &_self, ) .into(); output } - fn compute_affine(_self: Ref) { + /// Returns the 3d affine transformation matrix from this transforms translation, + /// rotation, and scale. + fn compute_affine( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::Transform::compute_affine( &_self, ) .into(); output } - fn compute_matrix(_self: Ref) { + /// Returns the 3d affine transformation matrix from this transforms translation, + /// rotation, and scale. + fn compute_matrix( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::Transform::compute_matrix( &_self, ) .into(); output } - fn down(_self: Ref) { + /// Equivalent to [`-local_y()`][Transform::local_y] + fn down( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::Transform::down( &_self, ) @@ -289,56 +436,82 @@ impl bevy::transform::components::Transform { fn eq( _self: Ref, other: Ref, - ) { + ) -> bool { let output: bool = >::eq(&_self, &other) .into(); output } - fn forward(_self: Ref) { + /// Equivalent to [`-local_z()`][Transform::local_z] + fn forward( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::Transform::forward( &_self, ) .into(); output } - fn from_isometry(iso: Val) { + /// Creates a new [`Transform`] that is equivalent to the given [isometry]. + /// [isometry]: Isometry3d + fn from_isometry( + iso: Val, + ) -> Val { let output: Val = bevy::transform::components::Transform::from_isometry( iso.into_inner(), ) .into(); output } - fn from_matrix(world_from_local: Val) { + /// Extracts the translation, rotation, and scale from `matrix`. It must be a 3d affine + /// transformation matrix. + fn from_matrix( + world_from_local: Val, + ) -> Val { let output: Val = bevy::transform::components::Transform::from_matrix( world_from_local.into_inner(), ) .into(); output } - fn from_rotation(rotation: Val) { + /// Creates a new [`Transform`], with `rotation`. Translation will be 0 and scale 1 on + /// all axes. + fn from_rotation( + rotation: Val, + ) -> Val { let output: Val = bevy::transform::components::Transform::from_rotation( rotation.into_inner(), ) .into(); output } - fn from_scale(scale: Val) { + /// Creates a new [`Transform`], with `scale`. Translation will be 0 and rotation 0 on + /// all axes. + fn from_scale( + scale: Val, + ) -> Val { let output: Val = bevy::transform::components::Transform::from_scale( scale.into_inner(), ) .into(); output } - fn from_translation(translation: Val) { + /// Creates a new [`Transform`], with `translation`. Rotation will be 0 and scale 1 on + /// all axes. + fn from_translation( + translation: Val, + ) -> Val { let output: Val = bevy::transform::components::Transform::from_translation( translation.into_inner(), ) .into(); output } - fn from_xyz(x: f32, y: f32, z: f32) { + /// Creates a new [`Transform`] at the position `(x, y, z)`. In 2d, the `z` component + /// is used for z-ordering elements: higher `z`-value will be in front of lower + /// `z`-value. + fn from_xyz(x: f32, y: f32, z: f32) -> Val { let output: Val = bevy::transform::components::Transform::from_xyz( x, y, @@ -347,33 +520,48 @@ impl bevy::transform::components::Transform { .into(); output } - fn is_finite(_self: Ref) { + /// Returns `true` if, and only if, translation, rotation and scale all are + /// finite. If any of them contains a `NaN`, positive or negative infinity, + /// this will return `false`. + fn is_finite(_self: Ref) -> bool { let output: bool = bevy::transform::components::Transform::is_finite(&_self) .into(); output } - fn left(_self: Ref) { + /// Equivalent to [`-local_x()`][Transform::local_x()] + fn left( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::Transform::left( &_self, ) .into(); output } - fn local_x(_self: Ref) { + /// Get the unit vector in the local `X` direction. + fn local_x( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::Transform::local_x( &_self, ) .into(); output } - fn local_y(_self: Ref) { + /// Get the unit vector in the local `Y` direction. + fn local_y( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::Transform::local_y( &_self, ) .into(); output } - fn local_z(_self: Ref) { + /// Get the unit vector in the local `Z` direction. + fn local_z( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::Transform::local_z( &_self, ) @@ -383,7 +571,7 @@ impl bevy::transform::components::Transform { fn mul( _self: Val, value: Val, - ) { + ) -> Val { let output: Val = >::mul(_self.into_inner(), value.into_inner()) @@ -393,7 +581,7 @@ impl bevy::transform::components::Transform { fn mul( _self: Val, global_transform: Val, - ) { + ) -> Val { let output: Val = >::mul(_self.into_inner(), global_transform.into_inner()) @@ -403,17 +591,19 @@ impl bevy::transform::components::Transform { fn mul( _self: Val, transform: Val, - ) { + ) -> Val { let output: Val = >::mul(_self.into_inner(), transform.into_inner()) .into(); output } + /// Multiplies `self` with `transform` component by component, returning the + /// resulting [`Transform`] fn mul_transform( _self: Ref, transform: Val, - ) { + ) -> Val { let output: Val = bevy::transform::components::Transform::mul_transform( &_self, transform.into_inner(), @@ -421,17 +611,25 @@ impl bevy::transform::components::Transform { .into(); output } - fn right(_self: Ref) { + /// Equivalent to [`local_x()`][Transform::local_x()] + fn right( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::Transform::right( &_self, ) .into(); output } + /// Rotates this [`Transform`] by the given rotation. + /// If this [`Transform`] has a parent, the `rotation` is relative to the rotation of the parent. + /// # Examples + /// - [`3d_rotation`] + /// [`3d_rotation`]: https://github.com/bevyengine/bevy/blob/latest/examples/transforms/3d_rotation.rs fn rotate( mut _self: Mut, rotation: Val, - ) { + ) -> () { let output: () = bevy::transform::components::Transform::rotate( &mut _self, rotation.into_inner(), @@ -439,11 +637,13 @@ impl bevy::transform::components::Transform { .into(); output } + /// Rotates this [`Transform`] around a `point` in space. + /// If this [`Transform`] has a parent, the `point` is relative to the [`Transform`] of the parent. fn rotate_around( mut _self: Mut, point: Val, rotation: Val, - ) { + ) -> () { let output: () = bevy::transform::components::Transform::rotate_around( &mut _self, point.into_inner(), @@ -452,11 +652,13 @@ impl bevy::transform::components::Transform { .into(); output } + /// Rotates this [`Transform`] around the given `axis` by `angle` (in radians). + /// If this [`Transform`] has a parent, the `axis` is relative to the rotation of the parent. fn rotate_axis( mut _self: Mut, axis: Val, angle: f32, - ) { + ) -> () { let output: () = bevy::transform::components::Transform::rotate_axis( &mut _self, axis.into_inner(), @@ -465,10 +667,12 @@ impl bevy::transform::components::Transform { .into(); output } + /// Rotates this [`Transform`] by the given `rotation`. + /// The `rotation` is relative to this [`Transform`]'s current rotation. fn rotate_local( mut _self: Mut, rotation: Val, - ) { + ) -> () { let output: () = bevy::transform::components::Transform::rotate_local( &mut _self, rotation.into_inner(), @@ -476,11 +680,12 @@ impl bevy::transform::components::Transform { .into(); output } + /// Rotates this [`Transform`] around its local `axis` by `angle` (in radians). fn rotate_local_axis( mut _self: Mut, axis: Val, angle: f32, - ) { + ) -> () { let output: () = bevy::transform::components::Transform::rotate_local_axis( &mut _self, axis.into_inner(), @@ -489,10 +694,11 @@ impl bevy::transform::components::Transform { .into(); output } + /// Rotates this [`Transform`] around its local `X` axis by `angle` (in radians). fn rotate_local_x( mut _self: Mut, angle: f32, - ) { + ) -> () { let output: () = bevy::transform::components::Transform::rotate_local_x( &mut _self, angle, @@ -500,10 +706,11 @@ impl bevy::transform::components::Transform { .into(); output } + /// Rotates this [`Transform`] around its local `Y` axis by `angle` (in radians). fn rotate_local_y( mut _self: Mut, angle: f32, - ) { + ) -> () { let output: () = bevy::transform::components::Transform::rotate_local_y( &mut _self, angle, @@ -511,10 +718,11 @@ impl bevy::transform::components::Transform { .into(); output } + /// Rotates this [`Transform`] around its local `Z` axis by `angle` (in radians). fn rotate_local_z( mut _self: Mut, angle: f32, - ) { + ) -> () { let output: () = bevy::transform::components::Transform::rotate_local_z( &mut _self, angle, @@ -522,7 +730,12 @@ impl bevy::transform::components::Transform { .into(); output } - fn rotate_x(mut _self: Mut, angle: f32) { + /// Rotates this [`Transform`] around the `X` axis by `angle` (in radians). + /// If this [`Transform`] has a parent, the axis is relative to the rotation of the parent. + fn rotate_x( + mut _self: Mut, + angle: f32, + ) -> () { let output: () = bevy::transform::components::Transform::rotate_x( &mut _self, angle, @@ -530,7 +743,12 @@ impl bevy::transform::components::Transform { .into(); output } - fn rotate_y(mut _self: Mut, angle: f32) { + /// Rotates this [`Transform`] around the `Y` axis by `angle` (in radians). + /// If this [`Transform`] has a parent, the axis is relative to the rotation of the parent. + fn rotate_y( + mut _self: Mut, + angle: f32, + ) -> () { let output: () = bevy::transform::components::Transform::rotate_y( &mut _self, angle, @@ -538,7 +756,12 @@ impl bevy::transform::components::Transform { .into(); output } - fn rotate_z(mut _self: Mut, angle: f32) { + /// Rotates this [`Transform`] around the `Z` axis by `angle` (in radians). + /// If this [`Transform`] has a parent, the axis is relative to the rotation of the parent. + fn rotate_z( + mut _self: Mut, + angle: f32, + ) -> () { let output: () = bevy::transform::components::Transform::rotate_z( &mut _self, angle, @@ -546,17 +769,29 @@ impl bevy::transform::components::Transform { .into(); output } - fn to_isometry(_self: Ref) { + /// Get the [isometry] defined by this transform's rotation and translation, ignoring scale. + /// [isometry]: Isometry3d + fn to_isometry( + _self: Ref, + ) -> Val { let output: Val = bevy::transform::components::Transform::to_isometry( &_self, ) .into(); output } + /// Transforms the given `point`, applying scale, rotation and translation. + /// If this [`Transform`] has an ancestor entity with a [`Transform`] component, + /// [`Transform::transform_point`] will transform a point in local space into its + /// parent transform's space. + /// If this [`Transform`] does not have a parent, [`Transform::transform_point`] will + /// transform a point in local space into worldspace coordinates. + /// If you always want to transform a point in local space to worldspace, or if you need + /// the inverse transformations, see [`GlobalTransform::transform_point()`]. fn transform_point( _self: Ref, point: Val, - ) { + ) -> Val { let output: Val = bevy::transform::components::Transform::transform_point( &_self, point.into_inner(), @@ -564,11 +799,13 @@ impl bevy::transform::components::Transform { .into(); output } + /// Translates this [`Transform`] around a `point` in space. + /// If this [`Transform`] has a parent, the `point` is relative to the [`Transform`] of the parent. fn translate_around( mut _self: Mut, point: Val, rotation: Val, - ) { + ) -> () { let output: () = bevy::transform::components::Transform::translate_around( &mut _self, point.into_inner(), @@ -577,17 +814,19 @@ impl bevy::transform::components::Transform { .into(); output } - fn up(_self: Ref) { + /// Equivalent to [`local_y()`][Transform::local_y] + fn up(_self: Ref) -> Val { let output: Val = bevy::transform::components::Transform::up( &_self, ) .into(); output } + /// Returns this [`Transform`] with a new rotation. fn with_rotation( _self: Val, rotation: Val, - ) { + ) -> Val { let output: Val = bevy::transform::components::Transform::with_rotation( _self.into_inner(), rotation.into_inner(), @@ -595,10 +834,11 @@ impl bevy::transform::components::Transform { .into(); output } + /// Returns this [`Transform`] with a new scale. fn with_scale( _self: Val, scale: Val, - ) { + ) -> Val { let output: Val = bevy::transform::components::Transform::with_scale( _self.into_inner(), scale.into_inner(), @@ -606,10 +846,11 @@ impl bevy::transform::components::Transform { .into(); output } + /// Returns this [`Transform`] with a new translation. fn with_translation( _self: Val, translation: Val, - ) { + ) -> Val { let output: Val = bevy::transform::components::Transform::with_translation( _self.into_inner(), translation.into_inner(), From 02f38d691d2f03327f243748f7c0ff0e9520b24a Mon Sep 17 00:00:00 2001 From: makspll Date: Mon, 10 Feb 2025 15:30:39 +0000 Subject: [PATCH 13/13] make return type matter in the macro and fix resulting errors --- crates/bevy_mod_scripting_derive/src/lib.rs | 13 +++++- .../bevy_mod_scripting_functions/src/core.rs | 45 ++++++++++--------- 2 files changed, 37 insertions(+), 21 deletions(-) diff --git a/crates/bevy_mod_scripting_derive/src/lib.rs b/crates/bevy_mod_scripting_derive/src/lib.rs index 24b4cddce3..9a6d133389 100644 --- a/crates/bevy_mod_scripting_derive/src/lib.rs +++ b/crates/bevy_mod_scripting_derive/src/lib.rs @@ -166,10 +166,21 @@ fn process_impl_fn(fun: &ImplItemFn) -> TokenStream { .unwrap_or(syn::LitStr::new("", Span::call_site())); let fun_name = syn::LitStr::new(&fun.sig.ident.to_string(), Span::call_site()); let fun_span = fun.sig.ident.span(); + let out_type = match &fun.sig.output { + syn::ReturnType::Default => quote_spanned! {fun_span=> + () + }, + syn::ReturnType::Type(_, ty) => quote_spanned! {fun_span=> + #ty + }, + }; quote_spanned! {fun_span=> .register_documented( #fun_name, - |#args| #body, + |#args| { + let output: #out_type = {#body}; + output + }, #docstring, &[#(#args_names),*] ) diff --git a/crates/bevy_mod_scripting_functions/src/core.rs b/crates/bevy_mod_scripting_functions/src/core.rs index 953f279dbb..4f12517c40 100644 --- a/crates/bevy_mod_scripting_functions/src/core.rs +++ b/crates/bevy_mod_scripting_functions/src/core.rs @@ -1,7 +1,9 @@ //! Contains functions defined by the [`bevy_mod_scripting_core`] crate use bevy::{prelude::*, reflect::ParsedPath}; -use bevy_mod_scripting_core::*; +use bevy_mod_scripting_core::{ + bindings::function::script_function::DynamicScriptFunctionMut, docgen::info::FunctionInfo, *, +}; use bevy_mod_scripting_derive::script_bindings; use bindings::{ function::{ @@ -31,7 +33,10 @@ pub fn register_bevy_bindings(app: &mut App) { unregistered )] impl World { - fn get_type_by_name(ctxt: FunctionCallContext, type_name: String) -> Option { + fn get_type_by_name( + ctxt: FunctionCallContext, + type_name: String, + ) -> Result, InteropError> { profiling::function_scope!("get_type_by_name"); let world = ctxt.world()?; let val = world.get_type_by_name(type_name); @@ -249,10 +254,7 @@ impl World { unregistered )] impl ReflectReference { - fn display_ref( - ctxt: FunctionCallContext, - s: ReflectReference, - ) -> Result { + fn display_ref(ctxt: FunctionCallContext, s: ReflectReference) -> Result { profiling::function_scope!("display_ref"); let world = ctxt.world()?; Ok(s.display_with_world(world)) @@ -261,7 +263,7 @@ impl ReflectReference { fn display_value( ctxt: FunctionCallContext, s: ReflectReference, - ) -> Result { + ) -> Result { profiling::function_scope!("display_value"); let world = ctxt.world()?; Ok(s.display_value_with_world(world)) @@ -321,7 +323,7 @@ impl ReflectReference { ctxt: FunctionCallContext, s: ReflectReference, v: ScriptValue, - ) -> Result { + ) -> Result<(), InteropError> { profiling::function_scope!("push"); let world = ctxt.world()?; let target_type_id = s.element_type_id(world.clone())?.ok_or_else(|| { @@ -353,7 +355,7 @@ impl ReflectReference { s: ReflectReference, k: ScriptValue, v: ScriptValue, - ) -> Result { + ) -> Result<(), InteropError> { profiling::function_scope!("insert"); let world = ctxt.world()?; let key_type_id = s.key_type_id(world.clone())?.ok_or_else(|| { @@ -383,13 +385,13 @@ impl ReflectReference { s.with_reflect_mut(world, |s| s.try_insert_boxed(key, value))? } - fn clear(ctxt: FunctionCallContext, s: ReflectReference) -> Result { + fn clear(ctxt: FunctionCallContext, s: ReflectReference) -> Result<(), InteropError> { profiling::function_scope!("clear"); let world = ctxt.world()?; s.with_reflect_mut(world, |s| s.try_clear())? } - fn len(ctxt: FunctionCallContext, s: ReflectReference) -> Result { + fn len(ctxt: FunctionCallContext, s: ReflectReference) -> Result, InteropError> { profiling::function_scope!("len"); let world = ctxt.world()?; s.len(world) @@ -430,7 +432,10 @@ impl ReflectReference { } } - fn iter(ctxt: FunctionCallContext, s: ReflectReference) -> Result { + fn iter( + ctxt: FunctionCallContext, + s: ReflectReference, + ) -> Result { profiling::function_scope!("iter"); let world = ctxt.world()?; let mut len = s.len(world.clone())?.unwrap_or_default(); @@ -458,7 +463,7 @@ impl ReflectReference { fn functions( ctxt: FunctionCallContext, s: ReflectReference, - ) -> Result { + ) -> Result>, InteropError> { profiling::function_scope!("functions"); let world = ctxt.world()?; let type_id = s.tail_type_id(world.clone())?.or_fake_id(); @@ -481,12 +486,12 @@ impl ReflectReference { impl ScriptTypeRegistration { fn type_name(s: Ref) -> String { profiling::function_scope!("type_name"); - s.type_name() + s.type_name().to_string() } fn short_name(s: Ref) -> String { profiling::function_scope!("short_name"); - s.short_name() + s.short_name().to_string() } } @@ -497,12 +502,12 @@ impl ScriptTypeRegistration { unregistered )] impl ScriptComponentRegistration { - fn type_name(s: Ref) -> String { + fn type_name(s: Ref) -> &'static str { profiling::function_scope!("type_name"); s.type_registration().type_name() } - fn short_name(s: Ref) -> String { + fn short_name(s: Ref) -> &'static str { profiling::function_scope!("short_name"); s.type_registration().short_name() } @@ -515,12 +520,12 @@ impl ScriptComponentRegistration { unregistered )] impl ScriptResourceRegistration { - fn type_name(s: Ref) -> String { + fn type_name(s: Ref) -> &'static str { profiling::function_scope!("type_name"); s.type_registration().type_name() } - fn short_name(s: Ref) -> String { + fn short_name(s: Ref) -> &'static str { profiling::function_scope!("short_name"); s.type_registration().short_name() } @@ -588,7 +593,7 @@ impl ScriptQueryResult { Val::new(s.entity) } - fn components(s: Ref) -> Vec> { + fn components(s: Ref) -> Vec { profiling::function_scope!("components"); s.components.to_vec() }