From c222a0304ce8bea3d8f32e426ae3cbb95a292e4c Mon Sep 17 00:00:00 2001 From: Maksymilian Mozolewski Date: Tue, 3 Dec 2024 09:03:47 +0000 Subject: [PATCH] Bump bevy & bevy console (#153) * bump bevy console * bump rest of bevy * remove bevy_gltf --- Cargo.toml | 43 +- crates/bevy_mod_scripting_core/Cargo.toml | 1 - .../src/providers/bevy_a11y.rs | 69 - .../src/providers/bevy_core.rs | 12 +- .../bevy_script_api/src/providers/bevy_ecs.rs | 107 +- .../src/providers/bevy_hierarchy.rs | 8 +- .../src/providers/bevy_input.rs | 451 +- .../src/providers/bevy_math.rs | 1041 +-- .../src/providers/bevy_reflect.rs | 6282 ++++++++--------- .../src/providers/bevy_time.rs | 64 +- .../src/providers/bevy_transform.rs | 86 +- .../src/providers/bevy_window.rs | 1879 ----- crates/bevy_script_api/src/providers/mod.rs | 8 - crates/macro_tests/Cargo.toml | 2 +- examples/lua/game_of_life.rs | 2 +- examples/rhai/game_of_life.rs | 2 +- makefile | 4 +- 17 files changed, 4082 insertions(+), 5979 deletions(-) delete mode 100644 crates/bevy_script_api/src/providers/bevy_a11y.rs delete mode 100644 crates/bevy_script_api/src/providers/bevy_window.rs diff --git a/Cargo.toml b/Cargo.toml index f515af7b..8a84bc61 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -70,7 +70,7 @@ bevy_script_api = { path = "crates/bevy_script_api", version = "0.8.0-alpha.1", [workspace.dependencies] -bevy = { version = "0.15.0-rc.3", default-features = false } +bevy = { version = "0.15.0", default-features = false } bevy_mod_scripting_core = { path = "crates/bevy_mod_scripting_core", version = "0.8.0-alpha.1" } bevy_mod_scripting_common = { path = "crates/bevy_mod_scripting_common", version = "0.8.0-alpha.1" } @@ -78,7 +78,7 @@ bevy_mod_scripting_common = { path = "crates/bevy_mod_scripting_common", version bevy = { workspace = true, default-features = true } clap = { version = "4.1", features = ["derive"] } rand = "0.8.5" -bevy_console = "0.12" +bevy_console = "0.13" rhai-rand = "0.1" [workspace] @@ -111,26 +111,25 @@ codegen-units = 8 incremental = false debug = false -# TODO: bump once bevy is released and the lib is updated -# [[example]] -# name = "console_integration_lua" -# path = "examples/lua/console_integration.rs" -# required-features = [ -# "lua54", -# "lua_script_api", -# "bevy/file_watcher", -# "bevy/multi_threaded", -# ] - -# [[example]] -# name = "console_integration_rhai" -# path = "examples/rhai/console_integration.rs" -# required-features = [ -# "rhai", -# "rhai_script_api", -# "bevy/file_watcher", -# "bevy/multi_threaded", -# ] +[[example]] +name = "console_integration_lua" +path = "examples/lua/console_integration.rs" +required-features = [ + "lua54", + "lua_script_api", + "bevy/file_watcher", + "bevy/multi_threaded", +] + +[[example]] +name = "console_integration_rhai" +path = "examples/rhai/console_integration.rs" +required-features = [ + "rhai", + "rhai_script_api", + "bevy/file_watcher", + "bevy/multi_threaded", +] [[example]] name = "complex_game_loop_lua" diff --git a/crates/bevy_mod_scripting_core/Cargo.toml b/crates/bevy_mod_scripting_core/Cargo.toml index 027bd286..4f5e07f6 100644 --- a/crates/bevy_mod_scripting_core/Cargo.toml +++ b/crates/bevy_mod_scripting_core/Cargo.toml @@ -23,7 +23,6 @@ doc_always = [] [dependencies] bevy = { workspace = true, default-features = false, features = [ "bevy_asset", - "bevy_gltf", "bevy_animation", "bevy_core_pipeline", "bevy_ui", diff --git a/crates/bevy_script_api/src/providers/bevy_a11y.rs b/crates/bevy_script_api/src/providers/bevy_a11y.rs deleted file mode 100644 index b6ef3788..00000000 --- a/crates/bevy_script_api/src/providers/bevy_a11y.rs +++ /dev/null @@ -1,69 +0,0 @@ -// @generated by cargo bevy-api-gen generate, modify the templates not this file -#![allow(clippy::all)] -#![allow(unused, deprecated, dead_code)] -#![cfg_attr(rustfmt, rustfmt_skip)] -use super::bevy_ecs::*; -use super::bevy_reflect::*; -extern crate self as bevy_script_api; -use bevy_script_api::{ - lua::RegisterForeignLuaType, ReflectedValue, common::bevy::GetWorld, -}; -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy(derive(), remote = "bevy::a11y::Focus", functions[])] -struct Focus(ReflectedValue); -#[derive(Default)] -pub(crate) struct Globals; -impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { - fn add_instances< - 'lua, - T: bevy_mod_scripting_lua::tealr::mlu::InstanceCollector<'lua>, - >(self, instances: &mut T) -> bevy_mod_scripting_lua::tealr::mlu::mlua::Result<()> { - Ok(()) - } -} -pub struct BevyA11YAPIProvider; -impl bevy_mod_scripting_core::hosts::APIProvider for BevyA11YAPIProvider { - type APITarget = std::sync::Mutex; - type ScriptContext = std::sync::Mutex; - type DocTarget = bevy_mod_scripting_lua::docs::LuaDocFragment; - fn attach_api( - &mut self, - ctx: &mut Self::APITarget, - ) -> Result<(), bevy_mod_scripting_core::error::ScriptError> { - let ctx = ctx.get_mut().expect("Unable to acquire lock on Lua context"); - bevy_mod_scripting_lua::tealr::mlu::set_global_env(Globals, ctx) - .map_err(|e| bevy_mod_scripting_core::error::ScriptError::Other( - e.to_string(), - )) - } - fn get_doc_fragment(&self) -> Option { - Some( - bevy_mod_scripting_lua::docs::LuaDocFragment::new( - "BevyA11YAPI", - |tw| { - tw.document_global_instance::() - .expect("Something went wrong documenting globals") - .process_type::() - }, - ), - ) - } - fn setup_script( - &mut self, - script_data: &bevy_mod_scripting_core::hosts::ScriptData, - ctx: &mut Self::ScriptContext, - ) -> Result<(), bevy_mod_scripting_core::error::ScriptError> { - Ok(()) - } - fn setup_script_runtime( - &mut self, - world_ptr: bevy_mod_scripting_core::world::WorldPointer, - _script_data: &bevy_mod_scripting_core::hosts::ScriptData, - ctx: &mut Self::ScriptContext, - ) -> Result<(), bevy_mod_scripting_core::error::ScriptError> { - Ok(()) - } - fn register_with_app(&self, app: &mut bevy::app::App) { - app.register_foreign_lua_type::(); - } -} diff --git a/crates/bevy_script_api/src/providers/bevy_core.rs b/crates/bevy_script_api/src/providers/bevy_core.rs index f205ff73..762e6fb7 100644 --- a/crates/bevy_script_api/src/providers/bevy_core.rs +++ b/crates/bevy_script_api/src/providers/bevy_core.rs @@ -14,12 +14,6 @@ use bevy_script_api::{ remote = "bevy::core::prelude::Name", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::core::prelude::Name; - -"#, - r#" - #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -28,6 +22,12 @@ use bevy_script_api::{ )] fn eq(&self, #[proxy] other: &name::Name) -> bool; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::core::prelude::Name; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] diff --git a/crates/bevy_script_api/src/providers/bevy_ecs.rs b/crates/bevy_script_api/src/providers/bevy_ecs.rs index 8f3b5d4e..a790dbc9 100644 --- a/crates/bevy_script_api/src/providers/bevy_ecs.rs +++ b/crates/bevy_script_api/src/providers/bevy_ecs.rs @@ -13,8 +13,13 @@ use bevy_script_api::{ remote = "bevy::ecs::entity::Entity", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::ecs::entity::Entity; + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &entity::Entity) -> bool; "#, r#" @@ -73,13 +78,8 @@ use bevy_script_api::{ "#, r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &entity::Entity) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::ecs::entity::Entity; "#, r#" @@ -143,17 +143,6 @@ struct OnReplace {} derive(clone), remote = "bevy::ecs::component::ComponentId", functions[r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &component::ComponentId) -> bool; - -"#, - r#" /// 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. @@ -174,6 +163,17 @@ struct OnReplace {} #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::ecs::component::ComponentId; +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &component::ComponentId) -> bool; + "#, r#" @@ -195,8 +195,8 @@ struct ComponentId(); remote = "bevy::ecs::component::Tick", functions[r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::ecs::component::Tick; "#, r#" @@ -212,8 +212,8 @@ struct ComponentId(); "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::ecs::component::Tick; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -264,12 +264,6 @@ struct Tick {} derive(clone), remote = "bevy::ecs::component::ComponentTicks", functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::ecs::component::ComponentTicks; - -"#, - r#" /// Returns `true` if the component or resource was added after the system last ran /// (or the system is running for the first time). @@ -298,17 +292,13 @@ struct Tick {} "#, r#" -/// Returns the tick recording the time this component or resource was most recently changed. +/// Creates a new instance with the same change tick for `added` and `changed`. - #[lua(kind = "Method", output(proxy))] - fn last_changed_tick(&self) -> bevy::ecs::component::Tick; - -"#, - r#" -/// Returns the tick recording the time this component or resource was added. - - #[lua(kind = "Method", output(proxy))] - fn added_tick(&self) -> bevy::ecs::component::Tick; + #[lua(kind = "Function", output(proxy))] + fn new( + #[proxy] + change_tick: bevy::ecs::component::Tick, + ) -> bevy::ecs::component::ComponentTicks; "#, r#" @@ -327,6 +317,12 @@ struct Tick {} #[lua(kind = "MutatingMethod")] fn set_changed(&mut self, #[proxy] change_tick: bevy::ecs::component::Tick) -> (); +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::ecs::component::ComponentTicks; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -335,19 +331,18 @@ fn index(&self) -> String { } "#] )] -struct ComponentTicks {} +struct ComponentTicks { + #[lua(output(proxy))] + added: bevy::ecs::component::Tick, + #[lua(output(proxy))] + changed: bevy::ecs::component::Tick, +} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::ecs::identifier::Identifier", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::ecs::identifier::Identifier; - -"#, - r#" - #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -387,6 +382,12 @@ struct ComponentTicks {} #[lua(kind = "Function", output(proxy))] fn from_bits(value: u64) -> bevy::ecs::identifier::Identifier; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::ecs::identifier::Identifier; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -451,6 +452,13 @@ impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { "Tick", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new, )?; + instances + .add_instance( + "ComponentTicks", + bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::< + LuaComponentTicks, + >::new, + )?; instances .add_instance( "Identifier", @@ -500,6 +508,11 @@ impl bevy_mod_scripting_core::hosts::APIProvider for BevyEcsAPIProvider { bevy_mod_scripting_lua::tealr::mlu::UserDataProxy, >() .process_type::() + .process_type::< + bevy_mod_scripting_lua::tealr::mlu::UserDataProxy< + LuaComponentTicks, + >, + >() .process_type::() .process_type::< bevy_mod_scripting_lua::tealr::mlu::UserDataProxy< diff --git a/crates/bevy_script_api/src/providers/bevy_hierarchy.rs b/crates/bevy_script_api/src/providers/bevy_hierarchy.rs index 2cb1efa9..23708e43 100644 --- a/crates/bevy_script_api/src/providers/bevy_hierarchy.rs +++ b/crates/bevy_script_api/src/providers/bevy_hierarchy.rs @@ -70,8 +70,8 @@ struct Parent(); remote = "bevy::hierarchy::HierarchyEvent", functions[r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::hierarchy::HierarchyEvent; "#, r#" @@ -87,8 +87,8 @@ struct Parent(); "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::hierarchy::HierarchyEvent; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" diff --git a/crates/bevy_script_api/src/providers/bevy_input.rs b/crates/bevy_script_api/src/providers/bevy_input.rs index f13ae2f8..852d5a90 100644 --- a/crates/bevy_script_api/src/providers/bevy_input.rs +++ b/crates/bevy_script_api/src/providers/bevy_input.rs @@ -15,6 +15,21 @@ use bevy_script_api::{ derive(), remote = "bevy::input::gamepad::Gamepad", functions[r#" +/// Returns the USB vendor ID as assigned by the USB-IF, if available. + + #[lua(kind = "Method")] + fn vendor_id(&self) -> std::option::Option; + +"#, + r#" +/// Returns the USB product ID as assigned by the [vendor], if available. +/// [vendor]: Self::vendor_id + + #[lua(kind = "Method")] + fn product_id(&self) -> std::option::Option; + +"#, + r#" /// Returns the left stick as a [`Vec2`] #[lua(kind = "Method", output(proxy))] @@ -34,6 +49,37 @@ use bevy_script_api::{ #[lua(kind = "Method", output(proxy))] fn dpad(&self) -> bevy::math::Vec2; +"#, + r#" +/// Returns `true` if the [`GamepadButton`] has been pressed. + + #[lua(kind = "Method")] + fn pressed(&self, #[proxy] button_type: bevy::input::gamepad::GamepadButton) -> bool; + +"#, + r#" +/// 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`]. + + #[lua(kind = "Method")] + fn just_pressed( + &self, + #[proxy] + button_type: bevy::input::gamepad::GamepadButton, + ) -> bool; + +"#, + r#" +/// 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`]. + + #[lua(kind = "Method")] + fn just_released( + &self, + #[proxy] + button_type: bevy::input::gamepad::GamepadButton, + ) -> bool; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -42,25 +88,15 @@ fn index(&self) -> String { } "#] )] -struct Gamepad { - vendor_id: std::option::Option, - product_id: std::option::Option, - digital: ReflectedValue, - analog: ReflectedValue, -} +struct Gamepad {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::input::gamepad::GamepadAxis", functions[r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &gamepad::GamepadAxis) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -71,8 +107,13 @@ struct Gamepad { "#, r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &gamepad::GamepadAxis) -> bool; "#, r#" @@ -89,8 +130,13 @@ struct GamepadAxis {} remote = "bevy::input::gamepad::GamepadButton", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::GamepadButton; + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &gamepad::GamepadButton) -> bool; "#, r#" @@ -101,13 +147,8 @@ struct GamepadAxis {} "#, r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &gamepad::GamepadButton) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gamepad::GamepadButton; "#, r#" @@ -152,13 +193,8 @@ struct GamepadSettings { remote = "bevy::input::keyboard::KeyCode", functions[r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &keyboard::KeyCode) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -169,8 +205,13 @@ struct GamepadSettings { "#, r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &keyboard::KeyCode) -> bool; "#, r#" @@ -187,12 +228,6 @@ struct KeyCode {} remote = "bevy::input::mouse::MouseButton", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::mouse::MouseButton; - -"#, - r#" - #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -201,6 +236,12 @@ struct KeyCode {} )] fn eq(&self, #[proxy] other: &mouse::MouseButton) -> bool; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::mouse::MouseButton; + "#, r#" @@ -260,6 +301,12 @@ struct TouchInput { remote = "bevy::input::keyboard::KeyboardFocusLost", functions[r#" + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + +"#, + r#" + #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -274,12 +321,6 @@ struct TouchInput { #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::input::keyboard::KeyboardFocusLost; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -372,12 +413,6 @@ struct AccumulatedMouseMotion { remote = "bevy::input::mouse::AccumulatedMouseScroll", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::mouse::AccumulatedMouseScroll; - -"#, - r#" - #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -386,6 +421,12 @@ struct AccumulatedMouseMotion { )] fn eq(&self, #[proxy] other: &mouse::AccumulatedMouseScroll) -> bool; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::mouse::AccumulatedMouseScroll; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -409,6 +450,12 @@ struct AccumulatedMouseScroll { #[lua(as_trait = "std::cmp::Eq", kind = "Method")] fn assert_receiver_is_total_eq(&self) -> (); +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::mouse::MouseButtonInput; + "#, r#" @@ -420,12 +467,6 @@ struct AccumulatedMouseScroll { )] fn eq(&self, #[proxy] other: &mouse::MouseButtonInput) -> bool; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::mouse::MouseButtonInput; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -516,6 +557,12 @@ struct MouseWheel { remote = "bevy::input::gamepad::GamepadAxisChangedEvent", functions[r#" + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gamepad::GamepadAxisChangedEvent; + +"#, + r#" + #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -524,12 +571,6 @@ struct MouseWheel { )] fn eq(&self, #[proxy] other: &gamepad::GamepadAxisChangedEvent) -> bool; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::GamepadAxisChangedEvent; - "#, r#" /// Creates a new [`GamepadAxisChangedEvent`] @@ -563,23 +604,6 @@ struct GamepadAxisChangedEvent { derive(clone), remote = "bevy::input::gamepad::GamepadButtonChangedEvent", functions[r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &gamepad::GamepadButtonChangedEvent) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::GamepadButtonChangedEvent; - -"#, - r#" /// Creates a new [`GamepadButtonChangedEvent`] #[lua(kind = "Function", output(proxy))] @@ -593,6 +617,23 @@ struct GamepadAxisChangedEvent { value: f32, ) -> bevy::input::gamepad::GamepadButtonChangedEvent; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gamepad::GamepadButtonChangedEvent; + +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &gamepad::GamepadButtonChangedEvent) -> bool; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -627,12 +668,6 @@ struct GamepadButtonChangedEvent { state: bevy::input::ButtonState, ) -> bevy::input::gamepad::GamepadButtonStateChangedEvent; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::GamepadButtonStateChangedEvent; - "#, r#" @@ -650,6 +685,12 @@ struct GamepadButtonChangedEvent { )] fn eq(&self, #[proxy] other: &gamepad::GamepadButtonStateChangedEvent) -> bool; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gamepad::GamepadButtonStateChangedEvent; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -701,12 +742,6 @@ struct GamepadConnection {} remote = "bevy::input::gamepad::GamepadConnectionEvent", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::GamepadConnectionEvent; - -"#, - r#" - #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -741,6 +776,12 @@ struct GamepadConnection {} #[lua(kind = "Method")] fn disconnected(&self) -> bool; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gamepad::GamepadConnectionEvent; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -790,6 +831,12 @@ struct GamepadEvent {} remote = "bevy::input::gamepad::GamepadInput", functions[r#" + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + +"#, + r#" + #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -804,12 +851,6 @@ struct GamepadEvent {} #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::input::gamepad::GamepadInput; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -824,16 +865,16 @@ struct GamepadInput {} derive(clone), remote = "bevy::input::gamepad::GamepadRumbleRequest", functions[r#" -/// Get the [`Entity`] associated with this request. - #[lua(kind = "Method", output(proxy))] - fn gamepad(&self) -> bevy::ecs::entity::Entity; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gamepad::GamepadRumbleRequest; "#, r#" +/// Get the [`Entity`] associated with this request. - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::GamepadRumbleRequest; + #[lua(kind = "Method", output(proxy))] + fn gamepad(&self) -> bevy::ecs::entity::Entity; "#] )] @@ -843,6 +884,19 @@ struct GamepadRumbleRequest {} derive(clone), remote = "bevy::input::gamepad::RawGamepadAxisChangedEvent", functions[r#" +/// Creates a [`RawGamepadAxisChangedEvent`]. + + #[lua(kind = "Function", output(proxy))] + fn new( + #[proxy] + gamepad: bevy::ecs::entity::Entity, + #[proxy] + axis_type: bevy::input::gamepad::GamepadAxis, + value: f32, + ) -> bevy::input::gamepad::RawGamepadAxisChangedEvent; + +"#, + r#" #[lua( as_trait = "std::cmp::PartialEq", @@ -858,19 +912,6 @@ struct GamepadRumbleRequest {} #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::input::gamepad::RawGamepadAxisChangedEvent; -"#, - r#" -/// Creates a [`RawGamepadAxisChangedEvent`]. - - #[lua(kind = "Function", output(proxy))] - fn new( - #[proxy] - gamepad: bevy::ecs::entity::Entity, - #[proxy] - axis_type: bevy::input::gamepad::GamepadAxis, - value: f32, - ) -> bevy::input::gamepad::RawGamepadAxisChangedEvent; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -892,12 +933,6 @@ struct RawGamepadAxisChangedEvent { remote = "bevy::input::gamepad::RawGamepadButtonChangedEvent", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::RawGamepadButtonChangedEvent; - -"#, - r#" - #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -919,6 +954,12 @@ struct RawGamepadAxisChangedEvent { value: f32, ) -> bevy::input::gamepad::RawGamepadButtonChangedEvent; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gamepad::RawGamepadButtonChangedEvent; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -998,6 +1039,12 @@ struct PinchGesture(f32); remote = "bevy::input::gestures::RotationGesture", functions[r#" + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gestures::RotationGesture; + +"#, + r#" + #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -1006,12 +1053,6 @@ struct PinchGesture(f32); )] fn eq(&self, #[proxy] other: &gestures::RotationGesture) -> bool; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gestures::RotationGesture; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -1056,12 +1097,6 @@ struct DoubleTapGesture {} remote = "bevy::input::gestures::PanGesture", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gestures::PanGesture; - -"#, - r#" - #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -1070,6 +1105,12 @@ struct DoubleTapGesture {} )] fn eq(&self, #[proxy] other: &gestures::PanGesture) -> bool; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gestures::PanGesture; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -1088,13 +1129,6 @@ struct PanGesture(#[lua(output(proxy))] bevy::math::Vec2); #[lua(as_trait = "std::cmp::Eq", kind = "Method")] fn assert_receiver_is_total_eq(&self) -> (); -"#, - r#" -/// Is this button pressed? - - #[lua(kind = "Method")] - fn is_pressed(&self) -> bool; - "#, r#" @@ -1112,6 +1146,13 @@ struct PanGesture(#[lua(output(proxy))] bevy::math::Vec2); #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::input::ButtonState; +"#, + r#" +/// Is this button pressed? + + #[lua(kind = "Method")] + fn is_pressed(&self) -> bool; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -1135,6 +1176,12 @@ struct ButtonState {} )] fn eq(&self, #[proxy] other: &gamepad::ButtonSettings) -> bool; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gamepad::ButtonSettings; + "#, r#" /// Returns `true` if the button is pressed. @@ -1183,12 +1230,6 @@ struct ButtonState {} #[lua(kind = "MutatingMethod")] fn set_release_threshold(&mut self, value: f32) -> f32; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::ButtonSettings; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -1204,8 +1245,13 @@ struct ButtonSettings {} remote = "bevy::input::gamepad::AxisSettings", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::AxisSettings; + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &gamepad::AxisSettings) -> bool; "#, r#" @@ -1314,13 +1360,8 @@ struct ButtonSettings {} "#, r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &gamepad::AxisSettings) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gamepad::AxisSettings; "#, r#" @@ -1336,6 +1377,12 @@ struct AxisSettings {} derive(clone), remote = "bevy::input::gamepad::ButtonAxisSettings", functions[r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gamepad::ButtonAxisSettings; + +"#, + r#" /// 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. @@ -1347,12 +1394,6 @@ struct AxisSettings {} old_value: std::option::Option, ) -> std::option::Option; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::ButtonAxisSettings; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -1372,12 +1413,6 @@ struct ButtonAxisSettings { remote = "bevy::input::gamepad::GamepadRumbleIntensity", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::GamepadRumbleIntensity; - -"#, - r#" - #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -1386,6 +1421,12 @@ struct ButtonAxisSettings { )] fn eq(&self, #[proxy] other: &gamepad::GamepadRumbleIntensity) -> bool; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gamepad::GamepadRumbleIntensity; + "#, r#" /// Creates a new rumble intensity with weak motor intensity set to the given value. @@ -1420,8 +1461,8 @@ struct GamepadRumbleIntensity { remote = "bevy::input::keyboard::Key", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::keyboard::Key; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -1437,8 +1478,8 @@ struct GamepadRumbleIntensity { "#, r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::keyboard::Key; "#, r#" @@ -1455,25 +1496,25 @@ struct Key {} remote = "bevy::input::keyboard::NativeKeyCode", functions[r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &keyboard::NativeKeyCode) -> bool; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::keyboard::NativeKeyCode; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &keyboard::NativeKeyCode) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::keyboard::NativeKeyCode; "#, r#" @@ -1490,13 +1531,8 @@ struct NativeKeyCode {} remote = "bevy::input::keyboard::NativeKey", functions[r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &keyboard::NativeKey) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -1507,8 +1543,13 @@ struct NativeKeyCode {} "#, r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &keyboard::NativeKey) -> bool; "#, r#" @@ -1525,14 +1566,14 @@ struct NativeKey {} remote = "bevy::input::mouse::MouseScrollUnit", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::mouse::MouseScrollUnit; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::mouse::MouseScrollUnit; "#, r#" @@ -1560,13 +1601,8 @@ struct MouseScrollUnit {} remote = "bevy::input::touch::TouchPhase", functions[r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &touch::TouchPhase) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -1577,8 +1613,13 @@ struct MouseScrollUnit {} "#, r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &touch::TouchPhase) -> bool; "#, r#" diff --git a/crates/bevy_script_api/src/providers/bevy_math.rs b/crates/bevy_script_api/src/providers/bevy_math.rs index 822cdb30..57cd3657 100644 --- a/crates/bevy_script_api/src/providers/bevy_math.rs +++ b/crates/bevy_script_api/src/providers/bevy_math.rs @@ -13,13 +13,8 @@ use bevy_script_api::{ remote = "bevy::math::AspectRatio", functions[r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &aspect_ratio::AspectRatio) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::AspectRatio; "#, r#" @@ -59,8 +54,13 @@ use bevy_script_api::{ "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::AspectRatio; + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &aspect_ratio::AspectRatio) -> bool; "#, r#" @@ -80,6 +80,12 @@ struct AspectRatio(); #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::math::CompassOctant; +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#, r#" @@ -91,12 +97,6 @@ struct AspectRatio(); )] fn eq(&self, #[proxy] other: &compass::CompassOctant) -> bool; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -112,6 +112,12 @@ struct CompassOctant {} remote = "bevy::math::CompassQuadrant", functions[r#" + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + +"#, + r#" + #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -126,12 +132,6 @@ struct CompassOctant {} #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::math::CompassQuadrant; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -147,6 +147,30 @@ struct CompassQuadrant {} remote = "bevy::math::Isometry2d", functions[r#" + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::prelude::Dir2) -> bevy::math::prelude::Dir2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::prelude::Vec2) -> bevy::math::prelude::Vec2; + +"#, + r#" + #[lua( as_trait = "std::ops::Mul", kind = "MetaFunction", @@ -156,6 +180,17 @@ struct CompassQuadrant {} )] fn mul(self, #[proxy] rhs: bevy::math::Isometry2d) -> bevy::math::Isometry2d; +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &isometry::Isometry2d) -> bool; + "#, r#" @@ -243,41 +278,6 @@ struct CompassQuadrant {} point: bevy::math::prelude::Vec2, ) -> bevy::math::prelude::Vec2; -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::prelude::Vec2) -> bevy::math::prelude::Vec2; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &isometry::Isometry2d) -> bool; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::prelude::Dir2) -> bevy::math::prelude::Dir2; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -297,6 +297,24 @@ struct Isometry2d { derive(clone), remote = "bevy::math::Isometry3d", functions[r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::Isometry3d; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::Vec3A) -> bevy::math::Vec3A; + +"#, + r#" /// Create a three-dimensional isometry from a rotation. #[lua(kind = "Function", output(proxy))] @@ -342,7 +360,7 @@ struct Isometry2d { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::prelude::Vec3) -> bevy::math::prelude::Vec3; + fn mul(self, #[proxy] rhs: bevy::math::Isometry3d) -> bevy::math::Isometry3d; "#, r#" @@ -355,12 +373,6 @@ struct Isometry2d { )] fn eq(&self, #[proxy] other: &isometry::Isometry3d) -> bool; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::Isometry3d; - "#, r#" @@ -371,19 +383,7 @@ struct Isometry2d { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::prelude::Dir3) -> bevy::math::prelude::Dir3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::Vec3A) -> bevy::math::Vec3A; + fn mul(self, #[proxy] rhs: bevy::math::prelude::Vec3) -> bevy::math::prelude::Vec3; "#, r#" @@ -395,7 +395,7 @@ struct Isometry2d { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::Isometry3d) -> bevy::math::Isometry3d; + fn mul(self, #[proxy] rhs: bevy::math::prelude::Dir3) -> bevy::math::prelude::Dir3; "#, r#" @@ -416,23 +416,6 @@ struct Isometry3d { derive(clone), remote = "bevy::math::Ray2d", functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::Ray2d; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &ray::Ray2d) -> bool; - -"#, - r#" /// Create a new `Ray2d` from a given origin and direction #[lua(kind = "Function", output(proxy))] @@ -463,6 +446,23 @@ struct Isometry3d { plane: bevy::math::primitives::Plane2d, ) -> std::option::Option; +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &ray::Ray2d) -> bool; + +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::Ray2d; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -483,8 +483,13 @@ struct Ray2d { remote = "bevy::math::Ray3d", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::Ray3d; + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &ray::Ray3d) -> bool; "#, r#" @@ -521,13 +526,8 @@ struct Ray2d { "#, r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &ray::Ray3d) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::Ray3d; "#, r#" @@ -548,13 +548,7 @@ struct Ray3d { derive(clone), remote = "bevy::math::Rot2", functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::Rot2; - -"#, - r#" -/// Rotates a [`Vec2`] by a [`Rot2`]. +/// Rotates the [`Dir2`] using a [`Rot2`]. #[lua( as_trait = "std::ops::Mul", @@ -563,7 +557,11 @@ struct Ray3d { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::prelude::Vec2) -> bevy::math::prelude::Vec2; + fn mul( + self, + #[proxy] + direction: bevy::math::prelude::Dir2, + ) -> bevy::math::prelude::Dir2; "#, r#" @@ -577,23 +575,6 @@ struct Ray3d { )] fn mul(self, #[proxy] rhs: bevy::math::Rot2) -> bevy::math::Rot2; -"#, - r#" -/// Rotates the [`Dir2`] using a [`Rot2`]. - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul( - self, - #[proxy] - direction: bevy::math::prelude::Dir2, - ) -> bevy::math::prelude::Dir2; - "#, r#" /// Creates a [`Rot2`] from a counterclockwise angle in radians. @@ -778,6 +759,13 @@ struct Ray3d { #[lua(kind = "Method")] fn angle_between(self, #[proxy] other: bevy::math::Rot2) -> f32; +"#, + r#" +/// Returns the angle in radians needed to make `self` and `other` coincide. + + #[lua(kind = "Method")] + fn angle_to(self, #[proxy] other: bevy::math::Rot2) -> f32; + "#, r#" /// Returns the inverse of the rotation. This is also the conjugate @@ -843,6 +831,19 @@ struct Ray3d { #[lua(kind = "Method", output(proxy))] fn slerp(self, #[proxy] end: bevy::math::Rot2, s: f32) -> bevy::math::Rot2; +"#, + r#" +/// Rotates a [`Vec2`] by a [`Rot2`]. + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::prelude::Vec2) -> bevy::math::prelude::Vec2; + "#, r#" @@ -854,6 +855,12 @@ struct Ray3d { )] fn eq(&self, #[proxy] other: &rotation2d::Rot2) -> bool; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::Rot2; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -871,6 +878,17 @@ struct Rot2 { derive(clone), remote = "bevy::math::prelude::Dir2", functions[r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &direction::Dir2) -> bool; + +"#, + r#" /// Create a [`Dir2`] from a [`Vec2`] that is already normalized. /// # Warning /// `value` must be normalized, i.e its length must be `1.0`. @@ -984,12 +1002,13 @@ struct Rot2 { r#" #[lua( - as_trait = "std::cmp::PartialEq", + as_trait = "std::ops::Neg", kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", + output(proxy), + composite = "neg", + metamethod = "Unm", )] - fn eq(&self, #[proxy] other: &direction::Dir2) -> bool; + fn neg(self) -> bevy::math::prelude::Dir2; "#, r#" @@ -997,18 +1016,6 @@ struct Rot2 { #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::math::prelude::Dir2; -"#, - r#" - - #[lua( - as_trait = "std::ops::Neg", - kind = "MetaFunction", - output(proxy), - composite = "neg", - metamethod = "Unm", - )] - fn neg(self) -> bevy::math::prelude::Dir2; - "#, r#" @@ -1036,13 +1043,8 @@ struct Dir2(); remote = "bevy::math::prelude::Dir3", functions[r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &direction::Dir3) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::prelude::Dir3; "#, r#" @@ -1068,6 +1070,17 @@ struct Dir2(); )] fn neg(self) -> bevy::math::prelude::Dir3; +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &direction::Dir3) -> bool; + "#, r#" /// Create a [`Dir3`] from a [`Vec3`] that is already normalized. @@ -1159,12 +1172,6 @@ struct Dir2(); #[lua(kind = "Method", output(proxy))] fn fast_renormalize(self) -> bevy::math::prelude::Dir3; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::prelude::Dir3; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -1243,12 +1250,6 @@ struct Dir3(); #[lua(kind = "Method", output(proxy))] fn fast_renormalize(self) -> bevy::math::prelude::Dir3A; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::prelude::Dir3A; - "#, r#" @@ -1264,25 +1265,31 @@ struct Dir3(); r#" #[lua( - as_trait = "std::ops::Neg", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "neg", - metamethod = "Unm", + composite = "mul", + metamethod = "Mul", )] - fn neg(self) -> bevy::math::prelude::Dir3A; + fn mul(self, rhs: f32) -> bevy::math::Vec3A; "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Neg", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "neg", + metamethod = "Unm", )] - fn mul(self, rhs: f32) -> bevy::math::Vec3A; + fn neg(self) -> bevy::math::prelude::Dir3A; + +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::prelude::Dir3A; "#, r#" @@ -1298,6 +1305,29 @@ struct Dir3A(); derive(clone), remote = "bevy::math::prelude::IRect", functions[r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &rects::irect::IRect) -> bool; + +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::prelude::IRect; + +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + +"#, + r#" /// 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. @@ -1575,29 +1605,6 @@ struct Dir3A(); #[lua(kind = "Method", output(proxy))] fn as_urect(&self) -> bevy::math::prelude::URect; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &rects::irect::IRect) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::prelude::IRect; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -1617,6 +1624,23 @@ struct IRect { derive(clone), remote = "bevy::math::prelude::Rect", functions[r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::prelude::Rect; + +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &rects::rect::Rect) -> bool; + +"#, + r#" /// 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. @@ -1911,23 +1935,6 @@ struct IRect { #[lua(kind = "Method", output(proxy))] fn as_urect(&self) -> bevy::math::prelude::URect; -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &rects::rect::Rect) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::prelude::Rect; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -2390,6 +2397,12 @@ struct BoundingCircle { derive(clone), remote = "bevy::math::primitives::Circle", functions[r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::primitives::Circle; + +"#, + r#" /// Create a new [`Circle`] from a `radius` #[lua(kind = "Function", output(proxy))] @@ -2415,12 +2428,6 @@ struct BoundingCircle { point: bevy::math::prelude::Vec2, ) -> bevy::math::prelude::Vec2; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::primitives::Circle; - "#, r#" @@ -2449,12 +2456,6 @@ struct Circle { remote = "bevy::math::primitives::Annulus", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::primitives::Annulus; - -"#, - r#" - #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -2463,6 +2464,12 @@ struct Circle { )] fn eq(&self, #[proxy] other: &primitives::dim2::Annulus) -> bool; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::primitives::Annulus; + "#, r#" /// Create a new [`Annulus`] from the radii of the inner and outer circle @@ -2517,6 +2524,23 @@ struct Annulus { derive(clone), remote = "bevy::math::primitives::Arc2d", functions[r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::primitives::Arc2d; + +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &primitives::dim2::Arc2d) -> bool; + +"#, + r#" /// Create a new [`Arc2d`] from a `radius` and a `half_angle` #[lua(kind = "Function", output(proxy))] @@ -2636,23 +2660,6 @@ struct Annulus { #[lua(kind = "Method")] fn is_major(&self) -> bool; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::primitives::Arc2d; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &primitives::dim2::Arc2d) -> bool; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -2679,6 +2686,12 @@ struct Arc2d { )] fn eq(&self, #[proxy] other: &primitives::dim2::Capsule2d) -> bool; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::primitives::Capsule2d; + "#, r#" /// Create a new `Capsule2d` from a radius and length @@ -2693,12 +2706,6 @@ struct Arc2d { #[lua(kind = "Method", output(proxy))] fn to_inner_rectangle(&self) -> bevy::math::primitives::Rectangle; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::primitives::Capsule2d; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -2845,23 +2852,6 @@ struct CircularSector { derive(clone), remote = "bevy::math::primitives::CircularSegment", functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::primitives::CircularSegment; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &primitives::dim2::CircularSegment) -> bool; - -"#, - r#" /// Create a new [`CircularSegment`] from a `radius`, and an `angle` #[lua(kind = "Function", output(proxy))] @@ -2944,16 +2934,33 @@ struct CircularSector { /// which is the signed distance between the segment and the center of its circle /// See [`Arc2d::apothem`] - #[lua(kind = "Method")] - fn apothem(&self) -> f32; + #[lua(kind = "Method")] + fn apothem(&self) -> f32; + +"#, + r#" +/// Get the length of the sagitta of this segment, also known as its height +/// See [`Arc2d::sagitta`] + + #[lua(kind = "Method")] + fn sagitta(&self) -> f32; + +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &primitives::dim2::CircularSegment) -> bool; "#, r#" -/// Get the length of the sagitta of this segment, also known as its height -/// See [`Arc2d::sagitta`] - #[lua(kind = "Method")] - fn sagitta(&self) -> f32; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::primitives::CircularSegment; "#, r#" @@ -2972,23 +2979,6 @@ struct CircularSegment { derive(clone), remote = "bevy::math::primitives::Ellipse", functions[r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &primitives::dim2::Ellipse) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::primitives::Ellipse; - -"#, - r#" /// Create a new `Ellipse` from half of its width and height. /// This corresponds to the two perpendicular radii defining the ellipse. @@ -3037,6 +3027,23 @@ struct CircularSegment { #[lua(kind = "Method")] fn semi_minor(&self) -> f32; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::primitives::Ellipse; + +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &primitives::dim2::Ellipse) -> bool; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -3055,12 +3062,6 @@ struct Ellipse { remote = "bevy::math::primitives::Line2d", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::primitives::Line2d; - -"#, - r#" - #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -3069,6 +3070,12 @@ struct Ellipse { )] fn eq(&self, #[proxy] other: &primitives::dim2::Line2d) -> bool; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::primitives::Line2d; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -3087,8 +3094,13 @@ struct Line2d { remote = "bevy::math::primitives::Plane2d", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::primitives::Plane2d; + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &primitives::dim2::Plane2d) -> bool; "#, r#" @@ -3105,13 +3117,8 @@ struct Line2d { "#, r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &primitives::dim2::Plane2d) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::primitives::Plane2d; "#, r#" @@ -3131,12 +3138,6 @@ struct Plane2d { remote = "bevy::math::primitives::Rectangle", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::primitives::Rectangle; - -"#, - r#" - #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -3202,6 +3203,12 @@ struct Plane2d { point: bevy::math::prelude::Vec2, ) -> bevy::math::prelude::Vec2; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::primitives::Rectangle; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -3223,6 +3230,17 @@ struct Rectangle { #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::math::primitives::RegularPolygon; +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &primitives::dim2::RegularPolygon) -> bool; + "#, r#" /// Create a new `RegularPolygon` @@ -3293,17 +3311,6 @@ struct Rectangle { #[lua(kind = "Method")] fn external_angle_radians(&self) -> f32; -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &primitives::dim2::RegularPolygon) -> bool; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -3322,23 +3329,6 @@ struct RegularPolygon { derive(clone), remote = "bevy::math::primitives::Rhombus", functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::primitives::Rhombus; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &primitives::dim2::Rhombus) -> bool; - -"#, - r#" /// Create a new `Rhombus` from a vertical and horizontal diagonal sizes. #[lua(kind = "Function", output(proxy))] @@ -3397,6 +3387,23 @@ struct RegularPolygon { point: bevy::math::prelude::Vec2, ) -> bevy::math::prelude::Vec2; +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &primitives::dim2::Rhombus) -> bool; + +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::primitives::Rhombus; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -3414,6 +3421,23 @@ struct Rhombus { derive(clone), remote = "bevy::math::primitives::Segment2d", functions[r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &primitives::dim2::Segment2d) -> bool; + +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::primitives::Segment2d; + +"#, + r#" /// Create a new `Segment2d` from a direction and full length of the segment #[lua(kind = "Function", output(proxy))] @@ -3437,23 +3461,6 @@ struct Rhombus { #[lua(kind = "Method", output(proxy))] fn point2(&self) -> bevy::math::prelude::Vec2; -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &primitives::dim2::Segment2d) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::primitives::Segment2d; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -3481,6 +3488,12 @@ struct Segment2d { )] fn eq(&self, #[proxy] other: &primitives::dim2::Triangle2d) -> bool; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::primitives::Triangle2d; + "#, r#" /// Create a new `Triangle2d` from points `a`, `b`, and `c` @@ -3533,12 +3546,6 @@ struct Segment2d { #[lua(kind = "Method", output(proxy))] fn reversed(self) -> bevy::math::primitives::Triangle2d; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::primitives::Triangle2d; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -3623,12 +3630,6 @@ struct BoundingSphere { remote = "bevy::math::primitives::Sphere", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::primitives::Sphere; - -"#, - r#" - #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -3664,6 +3665,12 @@ struct BoundingSphere { point: bevy::math::prelude::Vec3, ) -> bevy::math::prelude::Vec3; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::primitives::Sphere; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -3680,6 +3687,12 @@ struct Sphere { derive(clone), remote = "bevy::math::primitives::Cuboid", functions[r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::primitives::Cuboid; + +"#, + r#" /// Create a new `Cuboid` from a full x, y, and z length #[lua(kind = "Function", output(proxy))] @@ -3750,12 +3763,6 @@ struct Sphere { )] fn eq(&self, #[proxy] other: &primitives::dim3::Cuboid) -> bool; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::primitives::Cuboid; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -3774,8 +3781,13 @@ struct Cuboid { remote = "bevy::math::primitives::Cylinder", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::primitives::Cylinder; + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &primitives::dim3::Cylinder) -> bool; "#, r#" @@ -3809,13 +3821,8 @@ struct Cuboid { "#, r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &primitives::dim3::Cylinder) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::primitives::Cylinder; "#, r#" @@ -3834,17 +3841,6 @@ struct Cylinder { derive(clone), remote = "bevy::math::primitives::Capsule3d", functions[r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &primitives::dim3::Capsule3d) -> bool; - -"#, - r#" /// Create a new `Capsule3d` from a radius and length #[lua(kind = "Function", output(proxy))] @@ -3864,6 +3860,17 @@ struct Cylinder { #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::math::primitives::Capsule3d; +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &primitives::dim3::Capsule3d) -> bool; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -3890,12 +3897,6 @@ struct Capsule3d { )] fn eq(&self, #[proxy] other: &primitives::dim3::Cone) -> bool; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::primitives::Cone; - "#, r#" /// Create a new [`Cone`] from a radius and height. @@ -3933,6 +3934,12 @@ struct Capsule3d { #[lua(kind = "Method")] fn base_area(&self) -> f32; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::primitives::Cone; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -3983,12 +3990,6 @@ struct ConicalFrustum { derive(clone), remote = "bevy::math::primitives::InfinitePlane3d", functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::primitives::InfinitePlane3d; - -"#, - r#" /// Computes an [`Isometry3d`] which transforms points from the plane in 3D space with the given /// `origin` to the XY-plane. /// ## Guarantees @@ -4043,6 +4044,12 @@ struct ConicalFrustum { origin: bevy::math::prelude::Vec3, ) -> bevy::math::Isometry3d; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::primitives::InfinitePlane3d; + "#, r#" @@ -4072,6 +4079,12 @@ struct InfinitePlane3d { remote = "bevy::math::primitives::Line3d", functions[r#" + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::primitives::Line3d; + +"#, + r#" + #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -4080,12 +4093,6 @@ struct InfinitePlane3d { )] fn eq(&self, #[proxy] other: &primitives::dim3::Line3d) -> bool; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::primitives::Line3d; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -4104,17 +4111,6 @@ struct Line3d { remote = "bevy::math::primitives::Segment3d", functions[r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &primitives::dim3::Segment3d) -> bool; - -"#, - r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::math::primitives::Segment3d; @@ -4143,6 +4139,17 @@ struct Line3d { #[lua(kind = "Method", output(proxy))] fn point2(&self) -> bevy::math::prelude::Vec3; +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &primitives::dim3::Segment3d) -> bool; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -4161,23 +4168,6 @@ struct Segment3d { derive(clone), remote = "bevy::math::primitives::Torus", functions[r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &primitives::dim3::Torus) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::primitives::Torus; - -"#, - r#" /// 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 @@ -4203,6 +4193,23 @@ struct Segment3d { #[lua(kind = "Method")] fn outer_radius(&self) -> f32; +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &primitives::dim3::Torus) -> bool; + +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::primitives::Torus; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -4318,6 +4325,12 @@ struct Triangle3d { derive(clone), remote = "bevy::math::bounding::RayCast2d", functions[r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::bounding::RayCast2d; + +"#, + r#" /// Construct a [`RayCast2d`] from an origin, [`Dir2`], and max distance. #[lua(kind = "Function", output(proxy))] @@ -4369,12 +4382,6 @@ struct Triangle3d { circle: &bounding::bounded2d::BoundingCircle, ) -> std::option::Option; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::bounding::RayCast2d; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -4455,12 +4462,6 @@ struct AabbCast2d { derive(clone), remote = "bevy::math::bounding::BoundingCircleCast", functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::bounding::BoundingCircleCast; - -"#, - r#" /// Construct a [`BoundingCircleCast`] from a [`BoundingCircle`], origin, [`Dir2`], and max distance. #[lua(kind = "Function", output(proxy))] @@ -4498,6 +4499,12 @@ struct AabbCast2d { circle: bevy::math::bounding::BoundingCircle, ) -> std::option::Option; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::bounding::BoundingCircleCast; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -4581,12 +4588,6 @@ struct RayCast3d { derive(clone), remote = "bevy::math::bounding::AabbCast3d", functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::bounding::AabbCast3d; - -"#, - r#" /// Construct an [`AabbCast3d`] from an [`Aabb3d`], [`Ray3d`], and max distance. #[lua(kind = "Function", output(proxy))] @@ -4609,6 +4610,12 @@ struct RayCast3d { aabb: bevy::math::bounding::Aabb3d, ) -> std::option::Option; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::bounding::AabbCast3d; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -4675,17 +4682,6 @@ struct BoundingSphereCast { derive(clone), remote = "bevy::math::curve::interval::Interval", functions[r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &curve::interval::Interval) -> bool; - -"#, - r#" /// Get the start of this interval. #[lua(kind = "Method")] @@ -4759,6 +4755,17 @@ struct BoundingSphereCast { #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::math::curve::interval::Interval; +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &curve::interval::Interval) -> bool; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -4774,55 +4781,55 @@ struct Interval {} remote = "bevy::math::FloatOrd", functions[r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &float_ord::FloatOrd) -> bool; + #[lua(as_trait = "std::cmp::PartialOrd", kind = "Method")] + fn lt(&self, #[proxy] other: &float_ord::FloatOrd) -> bool; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::FloatOrd; + #[lua(as_trait = "std::cmp::PartialOrd", kind = "Method")] + fn le(&self, #[proxy] other: &float_ord::FloatOrd) -> bool; "#, r#" - #[lua( - as_trait = "std::ops::Neg", - kind = "MetaFunction", - output(proxy), - composite = "neg", - metamethod = "Unm", - )] - fn neg(self) -> bevy::math::FloatOrd; + #[lua(as_trait = "std::cmp::PartialOrd", kind = "Method")] + fn gt(&self, #[proxy] other: &float_ord::FloatOrd) -> bool; "#, r#" #[lua(as_trait = "std::cmp::PartialOrd", kind = "Method")] - fn lt(&self, #[proxy] other: &float_ord::FloatOrd) -> bool; + fn ge(&self, #[proxy] other: &float_ord::FloatOrd) -> bool; "#, r#" - #[lua(as_trait = "std::cmp::PartialOrd", kind = "Method")] - fn le(&self, #[proxy] other: &float_ord::FloatOrd) -> bool; + #[lua( + as_trait = "std::ops::Neg", + kind = "MetaFunction", + output(proxy), + composite = "neg", + metamethod = "Unm", + )] + fn neg(self) -> bevy::math::FloatOrd; "#, r#" - #[lua(as_trait = "std::cmp::PartialOrd", kind = "Method")] - fn gt(&self, #[proxy] other: &float_ord::FloatOrd) -> bool; + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &float_ord::FloatOrd) -> bool; "#, r#" - #[lua(as_trait = "std::cmp::PartialOrd", kind = "Method")] - fn ge(&self, #[proxy] other: &float_ord::FloatOrd) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::FloatOrd; "#, r#" @@ -4838,17 +4845,6 @@ struct FloatOrd(f32); derive(clone), remote = "bevy::math::primitives::Plane3d", functions[r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &primitives::dim3::Plane3d) -> bool; - -"#, - r#" /// 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. @@ -4867,6 +4863,17 @@ struct FloatOrd(f32); #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::math::primitives::Plane3d; +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &primitives::dim3::Plane3d) -> bool; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -4887,17 +4894,6 @@ struct Plane3d { remote = "bevy::math::primitives::Tetrahedron", functions[r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &primitives::dim3::Tetrahedron) -> bool; - -"#, - r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::math::primitives::Tetrahedron; @@ -4936,6 +4932,17 @@ struct Plane3d { #[lua(kind = "Method", output(proxy))] fn centroid(&self) -> bevy::math::prelude::Vec3; +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &primitives::dim3::Tetrahedron) -> bool; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -4953,6 +4960,12 @@ struct Tetrahedron { remote = "bevy::math::curve::easing::EaseFunction", functions[r#" + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::math::curve::easing::EaseFunction; + +"#, + r#" + #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -4961,12 +4974,6 @@ struct Tetrahedron { )] fn eq(&self, #[proxy] other: &curve::easing::EaseFunction) -> bool; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::math::curve::easing::EaseFunction; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] diff --git a/crates/bevy_script_api/src/providers/bevy_reflect.rs b/crates/bevy_script_api/src/providers/bevy_reflect.rs index e6a6d54b..45daa85d 100644 --- a/crates/bevy_script_api/src/providers/bevy_reflect.rs +++ b/crates/bevy_script_api/src/providers/bevy_reflect.rs @@ -1164,38 +1164,17 @@ struct RangeFull {} derive(clone), remote = "bevy::math::Quat", functions[r#" +/// Subtracts the `rhs` quaternion from `self`. +/// The difference is not guaranteed to be normalized. #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::Quat; - -"#, - r#" -/// Divides a quaternion by a scalar value. -/// The quotient is not guaranteed to be normalized. - - #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Sub", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, rhs: f32) -> bevy::math::Quat; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", + composite = "sub", + metamethod = "Sub", )] - fn eq(&self, #[proxy] rhs: &glam::Quat) -> bool; + fn sub(self, #[proxy] rhs: bevy::math::Quat) -> bevy::math::Quat; "#, r#" @@ -1211,6 +1190,16 @@ struct RangeFull {} )] fn mul(self, rhs: f32) -> bevy::math::Quat; +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::Quat; + "#, r#" @@ -1225,12 +1214,6 @@ struct RangeFull {} "#, r#" -/// 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. #[lua( as_trait = "std::ops::Mul", @@ -1239,21 +1222,22 @@ struct RangeFull {} composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::Quat) -> bevy::math::Quat; + fn mul(self, #[proxy] rhs: bevy::math::Vec3A) -> bevy::math::Vec3A; "#, r#" -/// Subtracts the `rhs` quaternion from `self`. -/// The difference is not guaranteed to be normalized. +/// Multiplies a quaternion and a 3D vector, returning the rotated vector. +/// # Panics +/// Will panic if `self` is not normalized when `glam_assert` is enabled. #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "mul", + metamethod = "Mul", )] - fn sub(self, #[proxy] rhs: bevy::math::Quat) -> bevy::math::Quat; + fn mul(self, #[proxy] rhs: bevy::math::Vec3) -> bevy::math::Vec3; "#, r#" @@ -1271,6 +1255,31 @@ struct RangeFull {} )] fn add(self, #[proxy] rhs: bevy::math::Quat) -> bevy::math::Quat; +"#, + r#" +/// Divides a quaternion by a scalar value. +/// The quotient is not guaranteed to be normalized. + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, rhs: f32) -> bevy::math::Quat; + +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] rhs: &glam::Quat) -> bool; + "#, r#" /// Creates a new rotation quaternion. @@ -1679,21 +1688,12 @@ struct RangeFull {} "#, r#" -/// Multiplies a quaternion and a 3D vector, returning the rotated vector. +/// 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` is not normalized when `glam_assert` is enabled. - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::Vec3) -> bevy::math::Vec3; - -"#, - r#" +/// Will panic if `self` or `rhs` are not normalized when `glam_assert` is enabled. #[lua( as_trait = "std::ops::Mul", @@ -1702,7 +1702,7 @@ struct RangeFull {} composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::Vec3A) -> bevy::math::Vec3A; + fn mul(self, #[proxy] rhs: bevy::math::Quat) -> bevy::math::Quat; "#, r#" @@ -1728,66 +1728,6 @@ struct Quat(); )] fn mul(self, rhs: f32) -> bevy::math::Vec3; -"#, - r#" - - #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, #[proxy] rhs: &glam::Vec3) -> bevy::math::Vec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: &glam::Vec3) -> bevy::math::Vec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, #[proxy] rhs: bevy::math::Vec3) -> bevy::math::Vec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: &glam::Vec3) -> bevy::math::Vec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::Vec3) -> bevy::math::Vec3; - "#, r#" /// Creates a new vector. @@ -2465,49 +2405,49 @@ struct Quat(); r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Div", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "div", + metamethod = "Div", )] - fn rem(self, #[proxy] rhs: bevy::math::Vec3) -> bevy::math::Vec3; + fn div(self, rhs: f32) -> bevy::math::Vec3; "#, r#" #[lua( - as_trait = "std::ops::Neg", + as_trait = "std::ops::Sub", kind = "MetaFunction", output(proxy), - composite = "neg", - metamethod = "Unm", + composite = "sub", + metamethod = "Sub", )] - fn neg(self) -> bevy::math::Vec3; + fn sub(self, rhs: f32) -> bevy::math::Vec3; "#, r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "add", + metamethod = "Add", )] - fn rem(self, rhs: f32) -> bevy::math::Vec3; + fn add(self, #[proxy] rhs: bevy::math::Vec3) -> bevy::math::Vec3; "#, r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "rem", + metamethod = "Mod", )] - fn sub(self, #[proxy] rhs: &glam::Vec3) -> bevy::math::Vec3; + fn rem(self, rhs: f32) -> bevy::math::Vec3; "#, r#" @@ -2519,64 +2459,67 @@ struct Quat(); composite = "div", metamethod = "Div", )] - fn div(self, rhs: f32) -> bevy::math::Vec3; + fn div(self, #[proxy] rhs: bevy::math::Vec3) -> bevy::math::Vec3; "#, r#" #[lua( - as_trait = "std::cmp::PartialEq", + as_trait = "std::ops::Sub", kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", + output(proxy), + composite = "sub", + metamethod = "Sub", )] - fn eq(&self, #[proxy] other: &glam::Vec3) -> bool; + fn sub(self, #[proxy] rhs: bevy::math::Vec3) -> bevy::math::Vec3; "#, r#" #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", + as_trait = "std::ops::Add", + kind = "MetaFunction", output(proxy), + composite = "add", + metamethod = "Add", )] - fn clone(&self) -> bevy::math::Vec3; + fn add(self, rhs: f32) -> bevy::math::Vec3; "#, r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Div", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", + composite = "div", + metamethod = "Div", )] - fn add(self, rhs: f32) -> bevy::math::Vec3; + fn div(self, #[proxy] rhs: &glam::Vec3) -> bevy::math::Vec3; "#, r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Neg", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", + composite = "neg", + metamethod = "Unm", )] - fn add(self, #[proxy] rhs: bevy::math::Vec3) -> bevy::math::Vec3; + fn neg(self) -> bevy::math::Vec3; "#, r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "rem", + metamethod = "Mod", )] - fn sub(self, #[proxy] rhs: bevy::math::Vec3) -> bevy::math::Vec3; + fn rem(self, #[proxy] rhs: &glam::Vec3) -> bevy::math::Vec3; "#, r#" @@ -2588,23 +2531,80 @@ struct Quat(); composite = "sub", metamethod = "Sub", )] - fn sub(self, rhs: f32) -> bevy::math::Vec3; + fn sub(self, #[proxy] rhs: &glam::Vec3) -> bevy::math::Vec3; "#, r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "rem", + metamethod = "Mod", )] - fn div(self, #[proxy] rhs: &glam::Vec3) -> bevy::math::Vec3; + fn rem(self, #[proxy] rhs: bevy::math::Vec3) -> bevy::math::Vec3; "#, r#" -#[lua(kind="MetaMethod", metamethod="ToString")] + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: &glam::Vec3) -> bevy::math::Vec3; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::Vec3) -> bevy::math::Vec3; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, #[proxy] rhs: &glam::Vec3) -> bevy::math::Vec3; + +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::Vec3; + +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &glam::Vec3) -> bool; + +"#, + r#" +#[lua(kind="MetaMethod", metamethod="ToString")] fn index(&self) -> String { format!("{:?}", _self) } @@ -2633,6 +2633,189 @@ struct Vec3 { remote = "bevy::math::IVec2", functions[r#" + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, #[proxy] rhs: bevy::math::IVec2) -> bevy::math::IVec2; + +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &glam::IVec2) -> bool; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, #[proxy] rhs: &glam::IVec2) -> bevy::math::IVec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, rhs: i32) -> bevy::math::IVec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: &glam::IVec2) -> bevy::math::IVec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, #[proxy] rhs: bevy::math::IVec2) -> bevy::math::IVec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, #[proxy] rhs: bevy::math::IVec2) -> bevy::math::IVec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::IVec2) -> bevy::math::IVec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, rhs: i32) -> bevy::math::IVec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, #[proxy] rhs: &glam::IVec2) -> bevy::math::IVec2; + +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::IVec2; + +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, rhs: i32) -> bevy::math::IVec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, rhs: i32) -> bevy::math::IVec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, #[proxy] rhs: &glam::IVec2) -> bevy::math::IVec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, #[proxy] rhs: bevy::math::IVec2) -> bevy::math::IVec2; + +"#, + r#" + #[lua( as_trait = "std::ops::Add", kind = "MetaFunction", @@ -2642,6 +2825,18 @@ struct Vec3 { )] fn add(self, rhs: i32) -> bevy::math::IVec2; +"#, + r#" + + #[lua( + as_trait = "std::ops::Neg", + kind = "MetaFunction", + output(proxy), + composite = "neg", + metamethod = "Unm", + )] + fn neg(self) -> bevy::math::IVec2; + "#, r#" /// Creates a new vector. @@ -3071,19 +3266,7 @@ struct Vec3 { r#" #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::IVec2) -> bevy::math::IVec2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Sub", kind = "MetaFunction", output(proxy), composite = "sub", @@ -3093,42 +3276,33 @@ struct Vec3 { "#, r#" - - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, #[proxy] rhs: bevy::math::IVec2) -> bevy::math::IVec2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Neg", - kind = "MetaFunction", - output(proxy), - composite = "neg", - metamethod = "Unm", - )] - fn neg(self) -> bevy::math::IVec2; - +#[lua(kind="MetaMethod", metamethod="ToString")] +fn index(&self) -> String { + format!("{:?}", _self) +} "#, r#" - - #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, rhs: i32) -> bevy::math::IVec2; - +#[lua(kind="MetaMethod", raw , metamethod="Index")] +fn index(&self, lua: &Lua, idx: crate::lua::util::LuaIndex) -> Result { + Ok(self.inner()?[*idx]) +} "#, r#" +#[lua(kind="MutatingMetaMethod", raw, metamethod="NewIndex")] +fn index(&mut self, lua: &Lua, idx: crate::lua::util::LuaIndex, val: i32) -> Result<(),_> { + self.val_mut(|s| Ok(s[*idx] = val))? +} +"#] +)] +struct IVec2 { + x: i32, + y: i32, +} +#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] +#[proxy( + derive(clone), + remote = "bevy::math::IVec3", + functions[r#" #[lua( as_trait = "std::ops::Add", @@ -3137,17 +3311,7 @@ struct Vec3 { composite = "add", metamethod = "Add", )] - fn add(self, #[proxy] rhs: &glam::IVec2) -> bevy::math::IVec2; - -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::IVec2; + fn add(self, #[proxy] rhs: bevy::math::IVec3) -> bevy::math::IVec3; "#, r#" @@ -3159,24 +3323,13 @@ struct Vec3 { r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Div", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: bevy::math::IVec2) -> bevy::math::IVec2; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", + composite = "div", + metamethod = "Div", )] - fn eq(&self, #[proxy] other: &glam::IVec2) -> bool; + fn div(self, rhs: i32) -> bevy::math::IVec3; "#, r#" @@ -3188,19 +3341,19 @@ struct Vec3 { composite = "sub", metamethod = "Sub", )] - fn sub(self, rhs: i32) -> bevy::math::IVec2; + fn sub(self, #[proxy] rhs: &glam::IVec3) -> bevy::math::IVec3; "#, r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "mul", + metamethod = "Mul", )] - fn rem(self, #[proxy] rhs: &glam::IVec2) -> bevy::math::IVec2; + fn mul(self, rhs: i32) -> bevy::math::IVec3; "#, r#" @@ -3212,97 +3365,67 @@ struct Vec3 { composite = "div", metamethod = "Div", )] - fn div(self, #[proxy] rhs: &glam::IVec2) -> bevy::math::IVec2; + fn div(self, #[proxy] rhs: &glam::IVec3) -> bevy::math::IVec3; "#, r#" #[lua( - as_trait = "std::ops::Sub", - kind = "MetaFunction", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", output(proxy), - composite = "sub", - metamethod = "Sub", )] - fn sub(self, #[proxy] rhs: bevy::math::IVec2) -> bevy::math::IVec2; + fn clone(&self) -> bevy::math::IVec3; "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "add", + metamethod = "Add", )] - fn mul(self, rhs: i32) -> bevy::math::IVec2; + fn add(self, #[proxy] rhs: &glam::IVec3) -> bevy::math::IVec3; "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Div", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "div", + metamethod = "Div", )] - fn mul(self, #[proxy] rhs: &glam::IVec2) -> bevy::math::IVec2; + fn div(self, #[proxy] rhs: bevy::math::IVec3) -> bevy::math::IVec3; "#, r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::cmp::PartialEq", kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "eq", + metamethod = "Eq", )] - fn rem(self, #[proxy] rhs: bevy::math::IVec2) -> bevy::math::IVec2; + fn eq(&self, #[proxy] other: &glam::IVec3) -> bool; "#, r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Neg", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "neg", + metamethod = "Unm", )] - fn div(self, rhs: i32) -> bevy::math::IVec2; + fn neg(self) -> bevy::math::IVec3; "#, r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#, - r#" -#[lua(kind="MetaMethod", raw , metamethod="Index")] -fn index(&self, lua: &Lua, idx: crate::lua::util::LuaIndex) -> Result { - Ok(self.inner()?[*idx]) -} -"#, - r#" -#[lua(kind="MutatingMetaMethod", raw, metamethod="NewIndex")] -fn index(&mut self, lua: &Lua, idx: crate::lua::util::LuaIndex, val: i32) -> Result<(),_> { - self.val_mut(|s| Ok(s[*idx] = val))? -} -"#] -)] -struct IVec2 { - x: i32, - y: i32, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::math::IVec3", - functions[r#" #[lua( as_trait = "std::ops::Rem", @@ -3311,17 +3434,7 @@ struct IVec2 { composite = "rem", metamethod = "Mod", )] - fn rem(self, rhs: i32) -> bevy::math::IVec3; - -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::IVec3; + fn rem(self, #[proxy] rhs: bevy::math::IVec3) -> bevy::math::IVec3; "#, r#" @@ -3333,30 +3446,31 @@ struct IVec2 { composite = "sub", metamethod = "Sub", )] - fn sub(self, rhs: i32) -> bevy::math::IVec3; + fn sub(self, #[proxy] rhs: bevy::math::IVec3) -> bevy::math::IVec3; "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "rem", + metamethod = "Mod", )] - fn mul(self, #[proxy] rhs: &glam::IVec3) -> bevy::math::IVec3; + fn rem(self, rhs: i32) -> bevy::math::IVec3; "#, r#" #[lua( - as_trait = "std::cmp::PartialEq", + as_trait = "std::ops::Mul", kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", + output(proxy), + composite = "mul", + metamethod = "Mul", )] - fn eq(&self, #[proxy] other: &glam::IVec3) -> bool; + fn mul(self, #[proxy] rhs: bevy::math::IVec3) -> bevy::math::IVec3; "#, r#" @@ -3370,30 +3484,6 @@ struct IVec2 { )] fn add(self, rhs: i32) -> bevy::math::IVec3; -"#, - r#" - - #[lua( - as_trait = "std::ops::Sub", - kind = "MetaFunction", - output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, #[proxy] rhs: bevy::math::IVec3) -> bevy::math::IVec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Neg", - kind = "MetaFunction", - output(proxy), - composite = "neg", - metamethod = "Unm", - )] - fn neg(self) -> bevy::math::IVec3; - "#, r#" @@ -3404,135 +3494,21 @@ struct IVec2 { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::IVec3) -> bevy::math::IVec3; + fn mul(self, #[proxy] rhs: &glam::IVec3) -> bevy::math::IVec3; "#, r#" +/// Creates a new vector. - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, rhs: i32) -> bevy::math::IVec3; + #[lua(kind = "Function", output(proxy))] + fn new(x: i32, y: i32, z: i32) -> bevy::math::IVec3; "#, r#" +/// Creates a vector with all elements set to `v`. - #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, #[proxy] rhs: &glam::IVec3) -> bevy::math::IVec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, #[proxy] rhs: bevy::math::IVec3) -> bevy::math::IVec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: &glam::IVec3) -> bevy::math::IVec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, #[proxy] rhs: &glam::IVec3) -> bevy::math::IVec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Sub", - kind = "MetaFunction", - output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, #[proxy] rhs: &glam::IVec3) -> bevy::math::IVec3; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: bevy::math::IVec3) -> bevy::math::IVec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, #[proxy] rhs: bevy::math::IVec3) -> bevy::math::IVec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, rhs: i32) -> bevy::math::IVec3; - -"#, - r#" -/// Creates a new vector. - - #[lua(kind = "Function", output(proxy))] - fn new(x: i32, y: i32, z: i32) -> bevy::math::IVec3; - -"#, - r#" -/// Creates a vector with all elements set to `v`. - - #[lua(kind = "Function", output(proxy))] - fn splat(v: i32) -> bevy::math::IVec3; + #[lua(kind = "Function", output(proxy))] + fn splat(v: i32) -> bevy::math::IVec3; "#, r#" @@ -3950,6 +3926,30 @@ struct IVec2 { rhs: bevy::math::UVec3, ) -> bevy::math::IVec3; +"#, + r#" + + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, #[proxy] rhs: &glam::IVec3) -> bevy::math::IVec3; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, rhs: i32) -> bevy::math::IVec3; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -3982,49 +3982,47 @@ struct IVec3 { functions[r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Sub", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "sub", + metamethod = "Sub", )] - fn rem(self, rhs: i32) -> bevy::math::IVec4; + fn sub(self, #[proxy] rhs: bevy::math::IVec4) -> bevy::math::IVec4; "#, r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "rem", + metamethod = "Mod", )] - fn div(self, #[proxy] rhs: bevy::math::IVec4) -> bevy::math::IVec4; + fn rem(self, #[proxy] rhs: &glam::IVec4) -> bevy::math::IVec4; "#, r#" #[lua( - as_trait = "std::ops::Sub", - kind = "MetaFunction", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", output(proxy), - composite = "sub", - metamethod = "Sub", )] - fn sub(self, rhs: i32) -> bevy::math::IVec4; + fn clone(&self) -> bevy::math::IVec4; "#, r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", + composite = "mul", + metamethod = "Mul", )] - fn add(self, #[proxy] rhs: bevy::math::IVec4) -> bevy::math::IVec4; + fn mul(self, rhs: i32) -> bevy::math::IVec4; "#, r#" @@ -4047,49 +4045,49 @@ struct IVec3 { r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Sub", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "sub", + metamethod = "Sub", )] - fn div(self, rhs: i32) -> bevy::math::IVec4; + fn sub(self, rhs: i32) -> bevy::math::IVec4; "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "rem", + metamethod = "Mod", )] - fn mul(self, rhs: i32) -> bevy::math::IVec4; + fn rem(self, #[proxy] rhs: bevy::math::IVec4) -> bevy::math::IVec4; "#, r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "mul", + metamethod = "Mul", )] - fn sub(self, #[proxy] rhs: bevy::math::IVec4) -> bevy::math::IVec4; + fn mul(self, #[proxy] rhs: &glam::IVec4) -> bevy::math::IVec4; "#, r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Sub", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", + composite = "sub", + metamethod = "Sub", )] - fn add(self, rhs: i32) -> bevy::math::IVec4; + fn sub(self, #[proxy] rhs: &glam::IVec4) -> bevy::math::IVec4; "#, r#" @@ -4113,55 +4111,129 @@ struct IVec3 { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: &glam::IVec4) -> bevy::math::IVec4; + fn mul(self, #[proxy] rhs: bevy::math::IVec4) -> bevy::math::IVec4; "#, r#" #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", + as_trait = "std::ops::Div", + kind = "MetaFunction", output(proxy), + composite = "div", + metamethod = "Div", )] - fn clone(&self) -> bevy::math::IVec4; + fn div(self, #[proxy] rhs: bevy::math::IVec4) -> bevy::math::IVec4; "#, r#" -/// Creates a new vector. - #[lua(kind = "Function", output(proxy))] - fn new(x: i32, y: i32, z: i32, w: i32) -> bevy::math::IVec4; + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, rhs: i32) -> bevy::math::IVec4; "#, r#" -/// Creates a vector with all elements set to `v`. - #[lua(kind = "Function", output(proxy))] - fn splat(v: i32) -> bevy::math::IVec4; + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, rhs: i32) -> bevy::math::IVec4; "#, r#" -/// 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`. - #[lua(kind = "Function", output(proxy))] - fn select( - #[proxy] - mask: bevy::math::BVec4, - #[proxy] - if_true: bevy::math::IVec4, - #[proxy] - if_false: bevy::math::IVec4, - ) -> bevy::math::IVec4; + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, rhs: i32) -> bevy::math::IVec4; "#, r#" -/// Creates a new vector from an array. - #[lua(kind = "Function", output(proxy))] - fn from_array(a: [i32; 4]) -> bevy::math::IVec4; + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, #[proxy] rhs: &glam::IVec4) -> bevy::math::IVec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, #[proxy] rhs: bevy::math::IVec4) -> bevy::math::IVec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, #[proxy] rhs: &glam::IVec4) -> bevy::math::IVec4; + +"#, + r#" +/// Creates a new vector. + + #[lua(kind = "Function", output(proxy))] + fn new(x: i32, y: i32, z: i32, w: i32) -> bevy::math::IVec4; + +"#, + r#" +/// Creates a vector with all elements set to `v`. + + #[lua(kind = "Function", output(proxy))] + fn splat(v: i32) -> bevy::math::IVec4; + +"#, + r#" +/// 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`. + + #[lua(kind = "Function", output(proxy))] + fn select( + #[proxy] + mask: bevy::math::BVec4, + #[proxy] + if_true: bevy::math::IVec4, + #[proxy] + if_false: bevy::math::IVec4, + ) -> bevy::math::IVec4; + +"#, + r#" +/// Creates a new vector from an array. + + #[lua(kind = "Function", output(proxy))] + fn from_array(a: [i32; 4]) -> bevy::math::IVec4; "#, r#" @@ -4543,27 +4615,56 @@ struct IVec3 { "#, r#" +#[lua(kind="MetaMethod", metamethod="ToString")] +fn index(&self) -> String { + format!("{:?}", _self) +} +"#, + r#" +#[lua(kind="MetaMethod", raw , metamethod="Index")] +fn index(&self, lua: &Lua, idx: crate::lua::util::LuaIndex) -> Result { + Ok(self.inner()?[*idx]) +} +"#, + r#" +#[lua(kind="MutatingMetaMethod", raw, metamethod="NewIndex")] +fn index(&mut self, lua: &Lua, idx: crate::lua::util::LuaIndex, val: i32) -> Result<(),_> { + self.val_mut(|s| Ok(s[*idx] = val))? +} +"#] +)] +struct IVec4 { + x: i32, + y: i32, + z: i32, + w: i32, +} +#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] +#[proxy( + derive(clone), + remote = "bevy::math::I64Vec2", + functions[r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", + composite = "mul", + metamethod = "Mul", )] - fn add(self, #[proxy] rhs: &glam::IVec4) -> bevy::math::IVec4; + fn mul(self, #[proxy] rhs: &glam::I64Vec2) -> bevy::math::I64Vec2; "#, r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "rem", + metamethod = "Mod", )] - fn div(self, #[proxy] rhs: &glam::IVec4) -> bevy::math::IVec4; + fn rem(self, #[proxy] rhs: bevy::math::I64Vec2) -> bevy::math::I64Vec2; "#, r#" @@ -4575,19 +4676,19 @@ struct IVec3 { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::IVec4) -> bevy::math::IVec4; + fn mul(self, rhs: i64) -> bevy::math::I64Vec2; "#, r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "add", + metamethod = "Add", )] - fn rem(self, #[proxy] rhs: bevy::math::IVec4) -> bevy::math::IVec4; + fn add(self, #[proxy] rhs: bevy::math::I64Vec2) -> bevy::math::I64Vec2; "#, r#" @@ -4599,7 +4700,25 @@ struct IVec3 { composite = "sub", metamethod = "Sub", )] - fn sub(self, #[proxy] rhs: &glam::IVec4) -> bevy::math::IVec4; + fn sub(self, #[proxy] rhs: &glam::I64Vec2) -> bevy::math::I64Vec2; + +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + +"#, + r#" + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, rhs: i64) -> bevy::math::I64Vec2; "#, r#" @@ -4611,39 +4730,34 @@ struct IVec3 { composite = "rem", metamethod = "Mod", )] - fn rem(self, #[proxy] rhs: &glam::IVec4) -> bevy::math::IVec4; + fn rem(self, rhs: i64) -> bevy::math::I64Vec2; "#, r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} + + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, rhs: i64) -> bevy::math::I64Vec2; + "#, r#" -#[lua(kind="MetaMethod", raw , metamethod="Index")] -fn index(&self, lua: &Lua, idx: crate::lua::util::LuaIndex) -> Result { - Ok(self.inner()?[*idx]) -} + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, #[proxy] rhs: &glam::I64Vec2) -> bevy::math::I64Vec2; + "#, r#" -#[lua(kind="MutatingMetaMethod", raw, metamethod="NewIndex")] -fn index(&mut self, lua: &Lua, idx: crate::lua::util::LuaIndex, val: i32) -> Result<(),_> { - self.val_mut(|s| Ok(s[*idx] = val))? -} -"#] -)] -struct IVec4 { - x: i32, - y: i32, - z: i32, - w: i32, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::math::I64Vec2", - functions[r#" /// Creates a new vector. #[lua(kind = "Function", output(proxy))] @@ -5079,71 +5193,70 @@ struct IVec4 { r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "mul", + metamethod = "Mul", )] - fn div(self, rhs: i64) -> bevy::math::I64Vec2; + fn mul(self, #[proxy] rhs: bevy::math::I64Vec2) -> bevy::math::I64Vec2; "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Sub", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "sub", + metamethod = "Sub", )] - fn mul(self, #[proxy] rhs: bevy::math::I64Vec2) -> bevy::math::I64Vec2; + fn sub(self, #[proxy] rhs: bevy::math::I64Vec2) -> bevy::math::I64Vec2; "#, r#" #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", + as_trait = "std::ops::Div", + kind = "MetaFunction", output(proxy), + composite = "div", + metamethod = "Div", )] - fn clone(&self) -> bevy::math::I64Vec2; + fn div(self, #[proxy] rhs: bevy::math::I64Vec2) -> bevy::math::I64Vec2; "#, r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::cmp::PartialEq", kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", + composite = "eq", + metamethod = "Eq", )] - fn add(self, rhs: i64) -> bevy::math::I64Vec2; + fn eq(&self, #[proxy] other: &glam::I64Vec2) -> bool; "#, r#" #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", output(proxy), - composite = "rem", - metamethod = "Mod", )] - fn rem(self, rhs: i64) -> bevy::math::I64Vec2; + fn clone(&self) -> bevy::math::I64Vec2; "#, r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Sub", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "sub", + metamethod = "Sub", )] - fn rem(self, #[proxy] rhs: &glam::I64Vec2) -> bevy::math::I64Vec2; + fn sub(self, rhs: i64) -> bevy::math::I64Vec2; "#, r#" @@ -5155,66 +5268,92 @@ struct IVec4 { composite = "add", metamethod = "Add", )] - fn add(self, #[proxy] rhs: bevy::math::I64Vec2) -> bevy::math::I64Vec2; + fn add(self, #[proxy] rhs: &glam::I64Vec2) -> bevy::math::I64Vec2; "#, r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Neg", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "neg", + metamethod = "Unm", )] - fn div(self, #[proxy] rhs: &glam::I64Vec2) -> bevy::math::I64Vec2; + fn neg(self) -> bevy::math::I64Vec2; "#, r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "rem", + metamethod = "Mod", )] - fn sub(self, #[proxy] rhs: bevy::math::I64Vec2) -> bevy::math::I64Vec2; + fn rem(self, #[proxy] rhs: &glam::I64Vec2) -> bevy::math::I64Vec2; "#, r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", +#[lua(kind="MetaMethod", metamethod="ToString")] +fn index(&self) -> String { + format!("{:?}", _self) +} +"#] +)] +struct I64Vec2 { + x: i64, + y: i64, +} +#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] +#[proxy( + derive(clone), + remote = "bevy::math::I64Vec3", + functions[r#" + + #[lua( + as_trait = "std::ops::Neg", + kind = "MetaFunction", + output(proxy), + composite = "neg", + metamethod = "Unm", )] - fn mul(self, rhs: i64) -> bevy::math::I64Vec2; + fn neg(self) -> bevy::math::I64Vec3; "#, r#" #[lua( - as_trait = "std::ops::Neg", + as_trait = "std::ops::Div", kind = "MetaFunction", output(proxy), - composite = "neg", - metamethod = "Unm", + composite = "div", + metamethod = "Div", )] - fn neg(self) -> bevy::math::I64Vec2; + fn div(self, rhs: i64) -> bevy::math::I64Vec3; "#, r#" #[lua( - as_trait = "std::cmp::PartialEq", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::I64Vec3; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", + output(proxy), + composite = "mul", + metamethod = "Mul", )] - fn eq(&self, #[proxy] other: &glam::I64Vec2) -> bool; + fn mul(self, #[proxy] rhs: &glam::I64Vec3) -> bevy::math::I64Vec3; "#, r#" @@ -5226,7 +5365,7 @@ struct IVec4 { composite = "add", metamethod = "Add", )] - fn add(self, #[proxy] rhs: &glam::I64Vec2) -> bevy::math::I64Vec2; + fn add(self, rhs: i64) -> bevy::math::I64Vec3; "#, r#" @@ -5238,7 +5377,49 @@ struct IVec4 { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: &glam::I64Vec2) -> bevy::math::I64Vec2; + fn mul(self, rhs: i64) -> bevy::math::I64Vec3; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, #[proxy] rhs: bevy::math::I64Vec3) -> bevy::math::I64Vec3; + +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, #[proxy] rhs: bevy::math::I64Vec3) -> bevy::math::I64Vec3; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, #[proxy] rhs: &glam::I64Vec3) -> bevy::math::I64Vec3; "#, r#" @@ -5250,7 +5431,54 @@ struct IVec4 { composite = "rem", metamethod = "Mod", )] - fn rem(self, #[proxy] rhs: bevy::math::I64Vec2) -> bevy::math::I64Vec2; + fn rem(self, #[proxy] rhs: &glam::I64Vec3) -> bevy::math::I64Vec3; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::I64Vec3) -> bevy::math::I64Vec3; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, rhs: i64) -> bevy::math::I64Vec3; + +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &glam::I64Vec3) -> bool; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, #[proxy] rhs: bevy::math::I64Vec3) -> bevy::math::I64Vec3; "#, r#" @@ -5262,13 +5490,19 @@ struct IVec4 { composite = "sub", metamethod = "Sub", )] - fn sub(self, rhs: i64) -> bevy::math::I64Vec2; + fn sub(self, rhs: i64) -> bevy::math::I64Vec3; "#, r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, #[proxy] rhs: &glam::I64Vec3) -> bevy::math::I64Vec3; "#, r#" @@ -5280,37 +5514,22 @@ struct IVec4 { composite = "sub", metamethod = "Sub", )] - fn sub(self, #[proxy] rhs: &glam::I64Vec2) -> bevy::math::I64Vec2; + fn sub(self, #[proxy] rhs: &glam::I64Vec3) -> bevy::math::I64Vec3; "#, r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "add", + metamethod = "Add", )] - fn div(self, #[proxy] rhs: bevy::math::I64Vec2) -> bevy::math::I64Vec2; + fn add(self, #[proxy] rhs: bevy::math::I64Vec3) -> bevy::math::I64Vec3; "#, r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct I64Vec2 { - x: i64, - y: i64, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::math::I64Vec3", - functions[r#" /// Creates a new vector. #[lua(kind = "Function", output(proxy))] @@ -5749,61 +5968,79 @@ struct I64Vec2 { "#, r#" +#[lua(kind="MetaMethod", metamethod="ToString")] +fn index(&self) -> String { + format!("{:?}", _self) +} +"#] +)] +struct I64Vec3 { + x: i64, + y: i64, + z: i64, +} +#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] +#[proxy( + derive(clone), + remote = "bevy::math::I64Vec4", + functions[r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Div", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "div", + metamethod = "Div", )] - fn sub(self, rhs: i64) -> bevy::math::I64Vec3; + fn div(self, #[proxy] rhs: bevy::math::I64Vec4) -> bevy::math::I64Vec4; "#, r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Div", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", + composite = "div", + metamethod = "Div", )] - fn add(self, rhs: i64) -> bevy::math::I64Vec3; + fn div(self, rhs: i64) -> bevy::math::I64Vec4; "#, r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "add", + metamethod = "Add", )] - fn rem(self, #[proxy] rhs: &glam::I64Vec3) -> bevy::math::I64Vec3; + fn add(self, rhs: i64) -> bevy::math::I64Vec4; "#, r#" #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", + as_trait = "std::ops::Rem", + kind = "MetaFunction", output(proxy), + composite = "rem", + metamethod = "Mod", )] - fn clone(&self) -> bevy::math::I64Vec3; + fn rem(self, #[proxy] rhs: bevy::math::I64Vec4) -> bevy::math::I64Vec4; "#, r#" #[lua( - as_trait = "std::ops::Neg", + as_trait = "std::ops::Div", kind = "MetaFunction", output(proxy), - composite = "neg", - metamethod = "Unm", + composite = "div", + metamethod = "Div", )] - fn neg(self) -> bevy::math::I64Vec3; + fn div(self, #[proxy] rhs: &glam::I64Vec4) -> bevy::math::I64Vec4; "#, r#" @@ -5815,24 +6052,25 @@ struct I64Vec2 { r#" #[lua( - as_trait = "std::cmp::PartialEq", + as_trait = "std::ops::Add", kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", + output(proxy), + composite = "add", + metamethod = "Add", )] - fn eq(&self, #[proxy] other: &glam::I64Vec3) -> bool; + fn add(self, #[proxy] rhs: bevy::math::I64Vec4) -> bevy::math::I64Vec4; "#, r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "rem", + metamethod = "Mod", )] - fn div(self, rhs: i64) -> bevy::math::I64Vec3; + fn rem(self, rhs: i64) -> bevy::math::I64Vec4; "#, r#" @@ -5844,43 +6082,7 @@ struct I64Vec2 { composite = "sub", metamethod = "Sub", )] - fn sub(self, #[proxy] rhs: &glam::I64Vec3) -> bevy::math::I64Vec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, rhs: i64) -> bevy::math::I64Vec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, #[proxy] rhs: bevy::math::I64Vec3) -> bevy::math::I64Vec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: bevy::math::I64Vec3) -> bevy::math::I64Vec3; + fn sub(self, rhs: i64) -> bevy::math::I64Vec4; "#, r#" @@ -5892,7 +6094,7 @@ struct I64Vec2 { composite = "sub", metamethod = "Sub", )] - fn sub(self, #[proxy] rhs: bevy::math::I64Vec3) -> bevy::math::I64Vec3; + fn sub(self, #[proxy] rhs: bevy::math::I64Vec4) -> bevy::math::I64Vec4; "#, r#" @@ -5904,31 +6106,7 @@ struct I64Vec2 { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::I64Vec3) -> bevy::math::I64Vec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: &glam::I64Vec3) -> bevy::math::I64Vec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, rhs: i64) -> bevy::math::I64Vec3; + fn mul(self, #[proxy] rhs: bevy::math::I64Vec4) -> bevy::math::I64Vec4; "#, r#" @@ -5940,69 +6118,7 @@ struct I64Vec2 { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: &glam::I64Vec3) -> bevy::math::I64Vec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, #[proxy] rhs: bevy::math::I64Vec3) -> bevy::math::I64Vec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, #[proxy] rhs: &glam::I64Vec3) -> bevy::math::I64Vec3; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct I64Vec3 { - x: i64, - y: i64, - z: i64, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::math::I64Vec4", - functions[r#" - - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, rhs: i64) -> bevy::math::I64Vec4; - -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::I64Vec4; + fn mul(self, rhs: i64) -> bevy::math::I64Vec4; "#, r#" @@ -6020,25 +6136,13 @@ struct I64Vec3 { r#" #[lua( - as_trait = "std::ops::Sub", - kind = "MetaFunction", - output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, #[proxy] rhs: bevy::math::I64Vec4) -> bevy::math::I64Vec4; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "add", + metamethod = "Add", )] - fn div(self, #[proxy] rhs: &glam::I64Vec4) -> bevy::math::I64Vec4; + fn add(self, #[proxy] rhs: &glam::I64Vec4) -> bevy::math::I64Vec4; "#, r#" @@ -6475,95 +6579,110 @@ struct I64Vec3 { rhs: bevy::math::U64Vec4, ) -> bevy::math::I64Vec4; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "rem", + metamethod = "Mod", )] - fn mul(self, #[proxy] rhs: &glam::I64Vec4) -> bevy::math::I64Vec4; + fn rem(self, #[proxy] rhs: &glam::I64Vec4) -> bevy::math::I64Vec4; "#, r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Neg", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "neg", + metamethod = "Unm", )] - fn rem(self, #[proxy] rhs: bevy::math::I64Vec4) -> bevy::math::I64Vec4; + fn neg(self) -> bevy::math::I64Vec4; "#, r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", + composite = "mul", + metamethod = "Mul", )] - fn add(self, rhs: i64) -> bevy::math::I64Vec4; + fn mul(self, #[proxy] rhs: &glam::I64Vec4) -> bevy::math::I64Vec4; "#, r#" #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", output(proxy), - composite = "rem", - metamethod = "Mod", )] - fn rem(self, #[proxy] rhs: &glam::I64Vec4) -> bevy::math::I64Vec4; + fn clone(&self) -> bevy::math::I64Vec4; + +"#, + r#" +#[lua(kind="MetaMethod", metamethod="ToString")] +fn index(&self) -> String { + format!("{:?}", _self) +} +"#] +)] +struct I64Vec4 { + x: i64, + y: i64, + z: i64, + w: i64, +} +#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] +#[proxy( + derive(clone), + remote = "bevy::math::UVec2", + functions[r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "add", + metamethod = "Add", )] - fn mul(self, rhs: i64) -> bevy::math::I64Vec4; + fn add(self, rhs: u32) -> bevy::math::UVec2; "#, r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Div", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", + composite = "div", + metamethod = "Div", )] - fn add(self, #[proxy] rhs: bevy::math::I64Vec4) -> bevy::math::I64Vec4; + fn div(self, #[proxy] rhs: bevy::math::UVec2) -> bevy::math::UVec2; "#, r#" #[lua( - as_trait = "std::ops::Neg", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "neg", - metamethod = "Unm", + composite = "add", + metamethod = "Add", )] - fn neg(self) -> bevy::math::I64Vec4; + fn add(self, #[proxy] rhs: bevy::math::UVec2) -> bevy::math::UVec2; "#, r#" @@ -6575,75 +6694,55 @@ struct I64Vec3 { composite = "rem", metamethod = "Mod", )] - fn rem(self, rhs: i64) -> bevy::math::I64Vec4; + fn rem(self, #[proxy] rhs: bevy::math::UVec2) -> bevy::math::UVec2; "#, r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::cmp::PartialEq", kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", + composite = "eq", + metamethod = "Eq", )] - fn add(self, #[proxy] rhs: &glam::I64Vec4) -> bevy::math::I64Vec4; + fn eq(&self, #[proxy] other: &glam::UVec2) -> bool; "#, r#" #[lua( - as_trait = "std::ops::Sub", - kind = "MetaFunction", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", output(proxy), - composite = "sub", - metamethod = "Sub", )] - fn sub(self, rhs: i64) -> bevy::math::I64Vec4; + fn clone(&self) -> bevy::math::UVec2; "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "rem", + metamethod = "Mod", )] - fn mul(self, #[proxy] rhs: bevy::math::I64Vec4) -> bevy::math::I64Vec4; + fn rem(self, #[proxy] rhs: &glam::UVec2) -> bevy::math::UVec2; "#, r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "mul", + metamethod = "Mul", )] - fn div(self, #[proxy] rhs: bevy::math::I64Vec4) -> bevy::math::I64Vec4; + fn mul(self, #[proxy] rhs: bevy::math::UVec2) -> bevy::math::UVec2; "#, r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct I64Vec4 { - x: i64, - y: i64, - z: i64, - w: i64, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::math::UVec2", - functions[r#" #[lua( as_trait = "std::ops::Sub", @@ -6654,34 +6753,6 @@ struct I64Vec4 { )] fn sub(self, #[proxy] rhs: &glam::UVec2) -> bevy::math::UVec2; -"#, - r#" - - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, #[proxy] rhs: &glam::UVec2) -> bevy::math::UVec2; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::UVec2; - "#, r#" @@ -6694,42 +6765,6 @@ struct I64Vec4 { )] fn rem(self, rhs: u32) -> bevy::math::UVec2; -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: bevy::math::UVec2) -> bevy::math::UVec2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Sub", - kind = "MetaFunction", - output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, #[proxy] rhs: bevy::math::UVec2) -> bevy::math::UVec2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Sub", - kind = "MetaFunction", - output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, rhs: u32) -> bevy::math::UVec2; - "#, r#" @@ -6740,31 +6775,7 @@ struct I64Vec4 { composite = "div", metamethod = "Div", )] - fn div(self, #[proxy] rhs: bevy::math::UVec2) -> bevy::math::UVec2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::UVec2) -> bevy::math::UVec2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, #[proxy] rhs: &glam::UVec2) -> bevy::math::UVec2; + fn div(self, #[proxy] rhs: &glam::UVec2) -> bevy::math::UVec2; "#, r#" @@ -7096,25 +7107,13 @@ struct I64Vec4 { r#" #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, #[proxy] rhs: bevy::math::UVec2) -> bevy::math::UVec2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Sub", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "sub", + metamethod = "Sub", )] - fn div(self, rhs: u32) -> bevy::math::UVec2; + fn sub(self, #[proxy] rhs: bevy::math::UVec2) -> bevy::math::UVec2; "#, r#" @@ -7126,30 +7125,19 @@ struct I64Vec4 { composite = "mul", metamethod = "Mul", )] - fn mul(self, rhs: u32) -> bevy::math::UVec2; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &glam::UVec2) -> bool; + fn mul(self, #[proxy] rhs: &glam::UVec2) -> bevy::math::UVec2; "#, r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Sub", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", + composite = "sub", + metamethod = "Sub", )] - fn add(self, rhs: u32) -> bevy::math::UVec2; + fn sub(self, rhs: u32) -> bevy::math::UVec2; "#, r#" @@ -7161,7 +7149,7 @@ struct I64Vec4 { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: &glam::UVec2) -> bevy::math::UVec2; + fn mul(self, rhs: u32) -> bevy::math::UVec2; "#, r#" @@ -7175,6 +7163,18 @@ struct I64Vec4 { )] fn add(self, #[proxy] rhs: &glam::UVec2) -> bevy::math::UVec2; +"#, + r#" + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, rhs: u32) -> bevy::math::UVec2; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -7206,37 +7206,37 @@ struct UVec2 { functions[r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Div", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "div", + metamethod = "Div", )] - fn rem(self, #[proxy] rhs: bevy::math::UVec3) -> bevy::math::UVec3; + fn div(self, #[proxy] rhs: &glam::UVec3) -> bevy::math::UVec3; "#, r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "add", + metamethod = "Add", )] - fn rem(self, #[proxy] rhs: &glam::UVec3) -> bevy::math::UVec3; + fn add(self, #[proxy] rhs: bevy::math::UVec3) -> bevy::math::UVec3; "#, r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "mul", + metamethod = "Mul", )] - fn div(self, #[proxy] rhs: &glam::UVec3) -> bevy::math::UVec3; + fn mul(self, #[proxy] rhs: &glam::UVec3) -> bevy::math::UVec3; "#, r#" @@ -7250,6 +7250,30 @@ struct UVec2 { )] fn mul(self, #[proxy] rhs: bevy::math::UVec3) -> bevy::math::UVec3; +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, rhs: u32) -> bevy::math::UVec3; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, #[proxy] rhs: &glam::UVec3) -> bevy::math::UVec3; + "#, r#" @@ -7271,29 +7295,31 @@ struct UVec2 { composite = "add", metamethod = "Add", )] - fn add(self, #[proxy] rhs: bevy::math::UVec3) -> bevy::math::UVec3; + fn add(self, #[proxy] rhs: &glam::UVec3) -> bevy::math::UVec3; "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Div", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "div", + metamethod = "Div", )] - fn mul(self, #[proxy] rhs: &glam::UVec3) -> bevy::math::UVec3; + fn div(self, rhs: u32) -> bevy::math::UVec3; "#, r#" #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", + as_trait = "std::ops::Rem", + kind = "MetaFunction", output(proxy), + composite = "rem", + metamethod = "Mod", )] - fn clone(&self) -> bevy::math::UVec3; + fn rem(self, rhs: u32) -> bevy::math::UVec3; "#, r#" @@ -7305,19 +7331,17 @@ struct UVec2 { composite = "rem", metamethod = "Mod", )] - fn rem(self, rhs: u32) -> bevy::math::UVec3; + fn rem(self, #[proxy] rhs: bevy::math::UVec3) -> bevy::math::UVec3; "#, r#" #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", output(proxy), - composite = "div", - metamethod = "Div", )] - fn div(self, rhs: u32) -> bevy::math::UVec3; + fn clone(&self) -> bevy::math::UVec3; "#, r#" @@ -7329,7 +7353,19 @@ struct UVec2 { composite = "sub", metamethod = "Sub", )] - fn sub(self, rhs: u32) -> bevy::math::UVec3; + fn sub(self, #[proxy] rhs: &glam::UVec3) -> bevy::math::UVec3; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, #[proxy] rhs: bevy::math::UVec3) -> bevy::math::UVec3; "#, r#" @@ -7690,25 +7726,19 @@ struct UVec2 { r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "add", + metamethod = "Add", )] - fn sub(self, #[proxy] rhs: &glam::UVec3) -> bevy::math::UVec3; + fn add(self, rhs: u32) -> bevy::math::UVec3; "#, r#" - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, #[proxy] rhs: bevy::math::UVec3) -> bevy::math::UVec3; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -7722,30 +7752,6 @@ struct UVec2 { )] fn mul(self, rhs: u32) -> bevy::math::UVec3; -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: &glam::UVec3) -> bevy::math::UVec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, rhs: u32) -> bevy::math::UVec3; - "#, r#" @@ -7758,12 +7764,6 @@ struct UVec2 { )] fn sub(self, #[proxy] rhs: bevy::math::UVec3) -> bevy::math::UVec3; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -7796,13 +7796,13 @@ struct UVec3 { functions[r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", + composite = "mul", + metamethod = "Mul", )] - fn add(self, #[proxy] rhs: bevy::math::UVec4) -> bevy::math::UVec4; + fn mul(self, #[proxy] rhs: &glam::UVec4) -> bevy::math::UVec4; "#, r#" @@ -7814,61 +7814,19 @@ struct UVec3 { composite = "div", metamethod = "Div", )] - fn div(self, #[proxy] rhs: bevy::math::UVec4) -> bevy::math::UVec4; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Sub", - kind = "MetaFunction", - output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, #[proxy] rhs: &glam::UVec4) -> bevy::math::UVec4; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, #[proxy] rhs: &glam::UVec4) -> bevy::math::UVec4; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, rhs: u32) -> bevy::math::UVec4; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + fn div(self, rhs: u32) -> bevy::math::UVec4; "#, r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Div", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "div", + metamethod = "Div", )] - fn rem(self, #[proxy] rhs: bevy::math::UVec4) -> bevy::math::UVec4; + fn div(self, #[proxy] rhs: bevy::math::UVec4) -> bevy::math::UVec4; "#, r#" @@ -8211,6 +8169,18 @@ struct UVec3 { #[lua(kind = "Method", output(proxy))] fn saturating_add_signed(self, #[proxy] rhs: bevy::math::IVec4) -> bevy::math::UVec4; +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, #[proxy] rhs: &glam::UVec4) -> bevy::math::UVec4; + "#, r#" @@ -8221,6 +8191,18 @@ struct UVec3 { )] fn clone(&self) -> bevy::math::UVec4; +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, #[proxy] rhs: bevy::math::UVec4) -> bevy::math::UVec4; + "#, r#" @@ -8237,37 +8219,55 @@ struct UVec3 { r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "add", + metamethod = "Add", )] - fn mul(self, #[proxy] rhs: &glam::UVec4) -> bevy::math::UVec4; + fn add(self, #[proxy] rhs: bevy::math::UVec4) -> bevy::math::UVec4; + +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "add", + metamethod = "Add", )] - fn sub(self, rhs: u32) -> bevy::math::UVec4; + fn add(self, #[proxy] rhs: &glam::UVec4) -> bevy::math::UVec4; "#, r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "rem", + metamethod = "Mod", )] - fn div(self, #[proxy] rhs: &glam::UVec4) -> bevy::math::UVec4; + fn rem(self, #[proxy] rhs: bevy::math::UVec4) -> bevy::math::UVec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, rhs: u32) -> bevy::math::UVec4; "#, r#" @@ -8285,25 +8285,25 @@ struct UVec3 { r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Div", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "div", + metamethod = "Div", )] - fn sub(self, #[proxy] rhs: bevy::math::UVec4) -> bevy::math::UVec4; + fn div(self, #[proxy] rhs: &glam::UVec4) -> bevy::math::UVec4; "#, r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "rem", + metamethod = "Mod", )] - fn div(self, rhs: u32) -> bevy::math::UVec4; + fn rem(self, #[proxy] rhs: &glam::UVec4) -> bevy::math::UVec4; "#, r#" @@ -8320,25 +8320,25 @@ struct UVec3 { r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Sub", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "sub", + metamethod = "Sub", )] - fn rem(self, rhs: u32) -> bevy::math::UVec4; + fn sub(self, rhs: u32) -> bevy::math::UVec4; "#, r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", + composite = "mul", + metamethod = "Mul", )] - fn add(self, #[proxy] rhs: &glam::UVec4) -> bevy::math::UVec4; + fn mul(self, rhs: u32) -> bevy::math::UVec4; "#, r#" @@ -8372,20 +8372,209 @@ struct UVec4 { remote = "bevy::math::U64Vec2", functions[r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, rhs: u64) -> bevy::math::U64Vec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, #[proxy] rhs: &glam::U64Vec2) -> bevy::math::U64Vec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; + +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + +"#, + r#" + + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, rhs: u64) -> bevy::math::U64Vec2; + +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::U64Vec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, rhs: u64) -> bevy::math::U64Vec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, rhs: u64) -> bevy::math::U64Vec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, rhs: u64) -> bevy::math::U64Vec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, #[proxy] rhs: &glam::U64Vec2) -> bevy::math::U64Vec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, #[proxy] rhs: &glam::U64Vec2) -> bevy::math::U64Vec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, #[proxy] rhs: &glam::U64Vec2) -> bevy::math::U64Vec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; + +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &glam::U64Vec2) -> bool; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: &glam::U64Vec2) -> bevy::math::U64Vec2; "#, r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "add", + metamethod = "Add", )] - fn sub(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; + fn add(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; "#, r#" @@ -8609,408 +8798,135 @@ struct UVec4 { r#" /// Casts all elements of `self` to `f64`. - #[lua(kind = "Method", output(proxy))] - fn as_dvec2(&self) -> bevy::math::DVec2; - -"#, - r#" -/// Casts all elements of `self` to `i32`. - - #[lua(kind = "Method", output(proxy))] - fn as_ivec2(&self) -> bevy::math::IVec2; - -"#, - r#" -/// Casts all elements of `self` to `u32`. - - #[lua(kind = "Method", output(proxy))] - fn as_uvec2(&self) -> bevy::math::UVec2; - -"#, - r#" -/// Casts all elements of `self` to `i64`. - - #[lua(kind = "Method", output(proxy))] - fn as_i64vec2(&self) -> bevy::math::I64Vec2; - -"#, - r#" -/// 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), ..]`. - - #[lua(kind = "Method", output(proxy))] - fn wrapping_add(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; - -"#, - r#" -/// 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), ..]`. - - #[lua(kind = "Method", output(proxy))] - fn wrapping_sub(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; - -"#, - r#" -/// 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), ..]`. - - #[lua(kind = "Method", output(proxy))] - fn wrapping_mul(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; - -"#, - r#" -/// 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), ..]`. - - #[lua(kind = "Method", output(proxy))] - fn wrapping_div(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; - -"#, - r#" -/// 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), ..]`. - - #[lua(kind = "Method", output(proxy))] - fn saturating_add(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; - -"#, - r#" -/// 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), ..]`. - - #[lua(kind = "Method", output(proxy))] - fn saturating_sub(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; - -"#, - r#" -/// 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), ..]`. - - #[lua(kind = "Method", output(proxy))] - fn saturating_mul(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; - -"#, - r#" -/// 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), ..]`. - - #[lua(kind = "Method", output(proxy))] - fn saturating_div(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; - -"#, - r#" -/// 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), ..]`. - - #[lua(kind = "Method", output(proxy))] - fn wrapping_add_signed( - self, - #[proxy] - rhs: bevy::math::I64Vec2, - ) -> bevy::math::U64Vec2; - -"#, - r#" -/// 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), ..]`. - - #[lua(kind = "Method", output(proxy))] - fn saturating_add_signed( - self, - #[proxy] - rhs: bevy::math::I64Vec2, - ) -> bevy::math::U64Vec2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, rhs: u64) -> bevy::math::U64Vec2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: &glam::U64Vec2) -> bevy::math::U64Vec2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Sub", - kind = "MetaFunction", - output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, rhs: u64) -> bevy::math::U64Vec2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, rhs: u64) -> bevy::math::U64Vec2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, #[proxy] rhs: &glam::U64Vec2) -> bevy::math::U64Vec2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: &glam::U64Vec2) -> bevy::math::U64Vec2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, rhs: u64) -> bevy::math::U64Vec2; + #[lua(kind = "Method", output(proxy))] + fn as_dvec2(&self) -> bevy::math::DVec2; "#, r#" +/// Casts all elements of `self` to `i32`. - #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; + #[lua(kind = "Method", output(proxy))] + fn as_ivec2(&self) -> bevy::math::IVec2; "#, r#" +/// Casts all elements of `self` to `u32`. - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, #[proxy] rhs: &glam::U64Vec2) -> bevy::math::U64Vec2; + #[lua(kind = "Method", output(proxy))] + fn as_uvec2(&self) -> bevy::math::UVec2; "#, r#" +/// Casts all elements of `self` to `i64`. - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &glam::U64Vec2) -> bool; + #[lua(kind = "Method", output(proxy))] + fn as_i64vec2(&self) -> bevy::math::I64Vec2; "#, r#" +/// 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), ..]`. - #[lua( - as_trait = "std::ops::Sub", - kind = "MetaFunction", - output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, #[proxy] rhs: &glam::U64Vec2) -> bevy::math::U64Vec2; + #[lua(kind = "Method", output(proxy))] + fn wrapping_add(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; "#, r#" +/// 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), ..]`. - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::U64Vec2; + #[lua(kind = "Method", output(proxy))] + fn wrapping_sub(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; "#, r#" +/// 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), ..]`. - #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, rhs: u64) -> bevy::math::U64Vec2; + #[lua(kind = "Method", output(proxy))] + fn wrapping_mul(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; "#, r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct U64Vec2 { - x: u64, - y: u64, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::math::U64Vec3", - functions[r#" +/// 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), ..]`. - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, rhs: u64) -> bevy::math::U64Vec3; + #[lua(kind = "Method", output(proxy))] + fn wrapping_div(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; "#, r#" +/// 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), ..]`. - #[lua( - as_trait = "std::ops::Sub", - kind = "MetaFunction", - output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, #[proxy] rhs: bevy::math::U64Vec3) -> bevy::math::U64Vec3; + #[lua(kind = "Method", output(proxy))] + fn saturating_add(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; "#, r#" +/// 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), ..]`. - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: &glam::U64Vec3) -> bevy::math::U64Vec3; + #[lua(kind = "Method", output(proxy))] + fn saturating_sub(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; "#, r#" +/// 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), ..]`. - #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, rhs: u64) -> bevy::math::U64Vec3; + #[lua(kind = "Method", output(proxy))] + fn saturating_mul(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; "#, r#" +/// 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), ..]`. - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::U64Vec3) -> bevy::math::U64Vec3; + #[lua(kind = "Method", output(proxy))] + fn saturating_div(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; "#, r#" +/// 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), ..]`. - #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, #[proxy] rhs: bevy::math::U64Vec3) -> bevy::math::U64Vec3; + #[lua(kind = "Method", output(proxy))] + fn wrapping_add_signed( + self, + #[proxy] + rhs: bevy::math::I64Vec2, + ) -> bevy::math::U64Vec2; "#, r#" +/// 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), ..]`. - #[lua( - as_trait = "std::ops::Sub", - kind = "MetaFunction", - output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, rhs: u64) -> bevy::math::U64Vec3; + #[lua(kind = "Method", output(proxy))] + fn saturating_add_signed( + self, + #[proxy] + rhs: bevy::math::I64Vec2, + ) -> bevy::math::U64Vec2; "#, r#" +#[lua(kind="MetaMethod", metamethod="ToString")] +fn index(&self) -> String { + format!("{:?}", _self) +} +"#] +)] +struct U64Vec2 { + x: u64, + y: u64, +} +#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] +#[proxy( + derive(clone), + remote = "bevy::math::U64Vec3", + functions[r#" /// Creates a new vector. #[lua(kind = "Function", output(proxy))] @@ -9372,59 +9288,6 @@ struct U64Vec2 { rhs: bevy::math::I64Vec3, ) -> bevy::math::U64Vec3; -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: bevy::math::U64Vec3) -> bevy::math::U64Vec3; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &glam::U64Vec3) -> bool; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, rhs: u64) -> bevy::math::U64Vec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, #[proxy] rhs: &glam::U64Vec3) -> bevy::math::U64Vec3; - "#, r#" @@ -9435,19 +9298,7 @@ struct U64Vec2 { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: &glam::U64Vec3) -> bevy::math::U64Vec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, rhs: u64) -> bevy::math::U64Vec3; + fn mul(self, rhs: u64) -> bevy::math::U64Vec3; "#, r#" @@ -9459,7 +9310,7 @@ struct U64Vec2 { composite = "rem", metamethod = "Mod", )] - fn rem(self, #[proxy] rhs: &glam::U64Vec3) -> bevy::math::U64Vec3; + fn rem(self, #[proxy] rhs: bevy::math::U64Vec3) -> bevy::math::U64Vec3; "#, r#" @@ -9477,11 +9328,13 @@ struct U64Vec2 { r#" #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", + as_trait = "std::ops::Div", + kind = "MetaFunction", output(proxy), + composite = "div", + metamethod = "Div", )] - fn clone(&self) -> bevy::math::U64Vec3; + fn div(self, rhs: u64) -> bevy::math::U64Vec3; "#, r#" @@ -9493,53 +9346,49 @@ struct U64Vec2 { composite = "div", metamethod = "Div", )] - fn div(self, #[proxy] rhs: bevy::math::U64Vec3) -> bevy::math::U64Vec3; + fn div(self, #[proxy] rhs: &glam::U64Vec3) -> bevy::math::U64Vec3; "#, r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct U64Vec3 { - x: u64, - y: u64, - z: u64, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::math::U64Vec4", - functions[r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "mul", + metamethod = "Mul", )] - fn div(self, rhs: u64) -> bevy::math::U64Vec4; + fn mul(self, #[proxy] rhs: bevy::math::U64Vec3) -> bevy::math::U64Vec3; "#, r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, rhs: u64) -> bevy::math::U64Vec3; "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "add", + metamethod = "Add", )] - fn mul(self, rhs: u64) -> bevy::math::U64Vec4; + fn add(self, #[proxy] rhs: &glam::U64Vec3) -> bevy::math::U64Vec3; + +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -9551,43 +9400,43 @@ struct U64Vec3 { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: &glam::U64Vec4) -> bevy::math::U64Vec4; + fn mul(self, #[proxy] rhs: &glam::U64Vec3) -> bevy::math::U64Vec3; "#, r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Div", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "div", + metamethod = "Div", )] - fn rem(self, #[proxy] rhs: bevy::math::U64Vec4) -> bevy::math::U64Vec4; + fn div(self, #[proxy] rhs: bevy::math::U64Vec3) -> bevy::math::U64Vec3; "#, r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "add", + metamethod = "Add", )] - fn rem(self, #[proxy] rhs: &glam::U64Vec4) -> bevy::math::U64Vec4; + fn add(self, rhs: u64) -> bevy::math::U64Vec3; "#, r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "rem", + metamethod = "Mod", )] - fn div(self, #[proxy] rhs: bevy::math::U64Vec4) -> bevy::math::U64Vec4; + fn rem(self, rhs: u64) -> bevy::math::U64Vec3; "#, r#" @@ -9598,7 +9447,7 @@ struct U64Vec3 { composite = "eq", metamethod = "Eq", )] - fn eq(&self, #[proxy] other: &glam::U64Vec4) -> bool; + fn eq(&self, #[proxy] other: &glam::U64Vec3) -> bool; "#, r#" @@ -9610,19 +9459,17 @@ struct U64Vec3 { composite = "add", metamethod = "Add", )] - fn add(self, #[proxy] rhs: bevy::math::U64Vec4) -> bevy::math::U64Vec4; + fn add(self, #[proxy] rhs: bevy::math::U64Vec3) -> bevy::math::U64Vec3; "#, r#" #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", output(proxy), - composite = "rem", - metamethod = "Mod", )] - fn rem(self, rhs: u64) -> bevy::math::U64Vec4; + fn clone(&self) -> bevy::math::U64Vec3; "#, r#" @@ -9634,29 +9481,58 @@ struct U64Vec3 { composite = "sub", metamethod = "Sub", )] - fn sub(self, #[proxy] rhs: bevy::math::U64Vec4) -> bevy::math::U64Vec4; + fn sub(self, #[proxy] rhs: bevy::math::U64Vec3) -> bevy::math::U64Vec3; "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "rem", + metamethod = "Mod", )] - fn mul(self, #[proxy] rhs: bevy::math::U64Vec4) -> bevy::math::U64Vec4; + fn rem(self, #[proxy] rhs: &glam::U64Vec3) -> bevy::math::U64Vec3; "#, r#" +#[lua(kind="MetaMethod", metamethod="ToString")] +fn index(&self) -> String { + format!("{:?}", _self) +} +"#] +)] +struct U64Vec3 { + x: u64, + y: u64, + z: u64, +} +#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] +#[proxy( + derive(clone), + remote = "bevy::math::U64Vec4", + functions[r#" #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", + as_trait = "std::ops::Rem", + kind = "MetaFunction", output(proxy), + composite = "rem", + metamethod = "Mod", )] - fn clone(&self) -> bevy::math::U64Vec4; + fn rem(self, #[proxy] rhs: &glam::U64Vec4) -> bevy::math::U64Vec4; + +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &glam::U64Vec4) -> bool; "#, r#" @@ -9668,19 +9544,43 @@ struct U64Vec3 { composite = "div", metamethod = "Div", )] - fn div(self, #[proxy] rhs: &glam::U64Vec4) -> bevy::math::U64Vec4; + fn div(self, rhs: u64) -> bevy::math::U64Vec4; "#, r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Div", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "div", + metamethod = "Div", )] - fn sub(self, #[proxy] rhs: &glam::U64Vec4) -> bevy::math::U64Vec4; + fn div(self, #[proxy] rhs: bevy::math::U64Vec4) -> bevy::math::U64Vec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, #[proxy] rhs: bevy::math::U64Vec4) -> bevy::math::U64Vec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, rhs: u64) -> bevy::math::U64Vec4; "#, r#" @@ -10031,6 +9931,84 @@ struct U64Vec3 { rhs: bevy::math::I64Vec4, ) -> bevy::math::U64Vec4; +"#, + r#" + + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, rhs: u64) -> bevy::math::U64Vec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::U64Vec4) -> bevy::math::U64Vec4; + +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: &glam::U64Vec4) -> bevy::math::U64Vec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, #[proxy] rhs: bevy::math::U64Vec4) -> bevy::math::U64Vec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, #[proxy] rhs: &glam::U64Vec4) -> bevy::math::U64Vec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, rhs: u64) -> bevy::math::U64Vec4; + "#, r#" @@ -10041,7 +10019,7 @@ struct U64Vec3 { composite = "sub", metamethod = "Sub", )] - fn sub(self, rhs: u64) -> bevy::math::U64Vec4; + fn sub(self, #[proxy] rhs: &glam::U64Vec4) -> bevy::math::U64Vec4; "#, r#" @@ -10053,19 +10031,41 @@ struct U64Vec3 { composite = "add", metamethod = "Add", )] - fn add(self, #[proxy] rhs: &glam::U64Vec4) -> bevy::math::U64Vec4; + fn add(self, #[proxy] rhs: bevy::math::U64Vec4) -> bevy::math::U64Vec4; "#, r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Div", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", + composite = "div", + metamethod = "Div", )] - fn add(self, rhs: u64) -> bevy::math::U64Vec4; + fn div(self, #[proxy] rhs: &glam::U64Vec4) -> bevy::math::U64Vec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, rhs: u64) -> bevy::math::U64Vec4; + +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::U64Vec4; "#, r#" @@ -10094,31 +10094,19 @@ struct U64Vec4 { composite = "rem", metamethod = "Mod", )] - fn rem(self, rhs: f32) -> bevy::math::Vec2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, rhs: f32) -> bevy::math::Vec2; + fn rem(self, #[proxy] rhs: &glam::Vec2) -> bevy::math::Vec2; "#, r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "rem", + metamethod = "Mod", )] - fn sub(self, #[proxy] rhs: bevy::math::Vec2) -> bevy::math::Vec2; + fn rem(self, rhs: f32) -> bevy::math::Vec2; "#, r#" @@ -10130,7 +10118,7 @@ struct U64Vec4 { composite = "add", metamethod = "Add", )] - fn add(self, #[proxy] rhs: bevy::math::Vec2) -> bevy::math::Vec2; + fn add(self, #[proxy] rhs: &glam::Vec2) -> bevy::math::Vec2; "#, r#" @@ -10142,78 +10130,78 @@ struct U64Vec4 { composite = "div", metamethod = "Div", )] - fn div(self, #[proxy] rhs: bevy::math::Vec2) -> bevy::math::Vec2; + fn div(self, #[proxy] rhs: &glam::Vec2) -> bevy::math::Vec2; "#, r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "mul", + metamethod = "Mul", )] - fn rem(self, #[proxy] rhs: bevy::math::Vec2) -> bevy::math::Vec2; + fn mul(self, rhs: f32) -> bevy::math::Vec2; "#, r#" #[lua( - as_trait = "std::cmp::PartialEq", + as_trait = "std::ops::Add", kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", + output(proxy), + composite = "add", + metamethod = "Add", )] - fn eq(&self, #[proxy] other: &glam::Vec2) -> bool; + fn add(self, #[proxy] rhs: bevy::math::Vec2) -> bevy::math::Vec2; "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Div", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "div", + metamethod = "Div", )] - fn mul(self, #[proxy] rhs: &glam::Vec2) -> bevy::math::Vec2; + fn div(self, rhs: f32) -> bevy::math::Vec2; "#, r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", + composite = "mul", + metamethod = "Mul", )] - fn add(self, #[proxy] rhs: &glam::Vec2) -> bevy::math::Vec2; + fn mul(self, #[proxy] rhs: bevy::math::Vec2) -> bevy::math::Vec2; "#, r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "add", + metamethod = "Add", )] - fn sub(self, rhs: f32) -> bevy::math::Vec2; + fn add(self, rhs: f32) -> bevy::math::Vec2; "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::cmp::PartialEq", kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "eq", + metamethod = "Eq", )] - fn mul(self, #[proxy] rhs: bevy::math::Vec2) -> bevy::math::Vec2; + fn eq(&self, #[proxy] other: &glam::Vec2) -> bool; "#, r#" @@ -10913,49 +10901,47 @@ struct U64Vec4 { r#" #[lua( - as_trait = "std::ops::Neg", - kind = "MetaFunction", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", output(proxy), - composite = "neg", - metamethod = "Unm", )] - fn neg(self) -> bevy::math::Vec2; + fn clone(&self) -> bevy::math::Vec2; "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Sub", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "sub", + metamethod = "Sub", )] - fn mul(self, rhs: f32) -> bevy::math::Vec2; + fn sub(self, rhs: f32) -> bevy::math::Vec2; "#, r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Sub", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "sub", + metamethod = "Sub", )] - fn rem(self, #[proxy] rhs: &glam::Vec2) -> bevy::math::Vec2; + fn sub(self, #[proxy] rhs: bevy::math::Vec2) -> bevy::math::Vec2; "#, r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "mul", + metamethod = "Mul", )] - fn sub(self, #[proxy] rhs: &glam::Vec2) -> bevy::math::Vec2; + fn mul(self, #[proxy] rhs: &glam::Vec2) -> bevy::math::Vec2; "#, r#" @@ -10967,29 +10953,43 @@ struct U64Vec4 { composite = "div", metamethod = "Div", )] - fn div(self, #[proxy] rhs: &glam::Vec2) -> bevy::math::Vec2; + fn div(self, #[proxy] rhs: bevy::math::Vec2) -> bevy::math::Vec2; "#, r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Sub", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "sub", + metamethod = "Sub", )] - fn div(self, rhs: f32) -> bevy::math::Vec2; + fn sub(self, #[proxy] rhs: &glam::Vec2) -> bevy::math::Vec2; "#, r#" #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", + as_trait = "std::ops::Rem", + kind = "MetaFunction", output(proxy), + composite = "rem", + metamethod = "Mod", )] - fn clone(&self) -> bevy::math::Vec2; + fn rem(self, #[proxy] rhs: bevy::math::Vec2) -> bevy::math::Vec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Neg", + kind = "MetaFunction", + output(proxy), + composite = "neg", + metamethod = "Unm", + )] + fn neg(self) -> bevy::math::Vec2; "#, r#" @@ -11025,92 +11025,10 @@ struct Vec2 { as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, rhs: f32) -> bevy::math::Vec3A; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Sub", - kind = "MetaFunction", - output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, #[proxy] rhs: bevy::math::Vec3A) -> bevy::math::Vec3A; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, #[proxy] rhs: bevy::math::Vec3A) -> bevy::math::Vec3A; - -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::Vec3A; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: bevy::math::Vec3A) -> bevy::math::Vec3A; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, rhs: f32) -> bevy::math::Vec3A; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, rhs: f32) -> bevy::math::Vec3A; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", + composite = "rem", + metamethod = "Mod", )] - fn add(self, #[proxy] rhs: &glam::Vec3A) -> bevy::math::Vec3A; + fn rem(self, #[proxy] rhs: bevy::math::Vec3A) -> bevy::math::Vec3A; "#, r#" @@ -11122,7 +11040,7 @@ struct Vec2 { composite = "sub", metamethod = "Sub", )] - fn sub(self, rhs: f32) -> bevy::math::Vec3A; + fn sub(self, #[proxy] rhs: bevy::math::Vec3A) -> bevy::math::Vec3A; "#, r#" @@ -11140,49 +11058,49 @@ struct Vec2 { r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", + composite = "rem", + metamethod = "Mod", )] - fn add(self, rhs: f32) -> bevy::math::Vec3A; + fn rem(self, #[proxy] rhs: &glam::Vec3A) -> bevy::math::Vec3A; "#, r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "mul", + metamethod = "Mul", )] - fn sub(self, #[proxy] rhs: &glam::Vec3A) -> bevy::math::Vec3A; + fn mul(self, rhs: f32) -> bevy::math::Vec3A; "#, r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "mul", + metamethod = "Mul", )] - fn rem(self, #[proxy] rhs: &glam::Vec3A) -> bevy::math::Vec3A; + fn mul(self, #[proxy] rhs: &glam::Vec3A) -> bevy::math::Vec3A; "#, r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "rem", + metamethod = "Mod", )] - fn div(self, #[proxy] rhs: &glam::Vec3A) -> bevy::math::Vec3A; + fn rem(self, rhs: f32) -> bevy::math::Vec3A; "#, r#" @@ -11199,13 +11117,13 @@ struct Vec2 { r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Sub", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "sub", + metamethod = "Sub", )] - fn rem(self, #[proxy] rhs: bevy::math::Vec3A) -> bevy::math::Vec3A; + fn sub(self, #[proxy] rhs: &glam::Vec3A) -> bevy::math::Vec3A; "#, r#" @@ -11219,18 +11137,6 @@ struct Vec2 { )] fn neg(self) -> bevy::math::Vec3A; -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: &glam::Vec3A) -> bevy::math::Vec3A; - "#, r#" /// Creates a new vector. @@ -11920,6 +11826,100 @@ struct Vec2 { #[lua(kind = "Method", output(proxy))] fn as_u64vec3(&self) -> bevy::math::U64Vec3; +"#, + r#" + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, #[proxy] rhs: &glam::Vec3A) -> bevy::math::Vec3A; + +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::Vec3A; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, rhs: f32) -> bevy::math::Vec3A; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, rhs: f32) -> bevy::math::Vec3A; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, #[proxy] rhs: &glam::Vec3A) -> bevy::math::Vec3A; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, #[proxy] rhs: bevy::math::Vec3A) -> bevy::math::Vec3A; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, #[proxy] rhs: bevy::math::Vec3A) -> bevy::math::Vec3A; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, rhs: f32) -> bevy::math::Vec3A; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -11947,6 +11947,18 @@ struct Vec3A(); remote = "bevy::math::Vec4", functions[r#" + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, #[proxy] rhs: bevy::math::Vec4) -> bevy::math::Vec4; + +"#, + r#" + #[lua( as_trait = "std::ops::Div", kind = "MetaFunction", @@ -11954,19 +11966,19 @@ struct Vec3A(); composite = "div", metamethod = "Div", )] - fn div(self, rhs: f32) -> bevy::math::Vec4; + fn div(self, #[proxy] rhs: &glam::Vec4) -> bevy::math::Vec4; "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "rem", + metamethod = "Mod", )] - fn mul(self, rhs: f32) -> bevy::math::Vec4; + fn rem(self, rhs: f32) -> bevy::math::Vec4; "#, r#" @@ -11982,132 +11994,132 @@ struct Vec3A(); r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "rem", + metamethod = "Mod", )] - fn div(self, #[proxy] rhs: bevy::math::Vec4) -> bevy::math::Vec4; + fn rem(self, #[proxy] rhs: bevy::math::Vec4) -> bevy::math::Vec4; "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Sub", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "sub", + metamethod = "Sub", )] - fn mul(self, #[proxy] rhs: &glam::Vec4) -> bevy::math::Vec4; + fn sub(self, rhs: f32) -> bevy::math::Vec4; "#, r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "add", + metamethod = "Add", )] - fn rem(self, #[proxy] rhs: bevy::math::Vec4) -> bevy::math::Vec4; + fn add(self, #[proxy] rhs: bevy::math::Vec4) -> bevy::math::Vec4; "#, r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::cmp::PartialEq", kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", + composite = "eq", + metamethod = "Eq", )] - fn add(self, rhs: f32) -> bevy::math::Vec4; + fn eq(&self, #[proxy] rhs: &glam::Vec4) -> bool; "#, r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "mul", + metamethod = "Mul", )] - fn rem(self, #[proxy] rhs: &glam::Vec4) -> bevy::math::Vec4; + fn mul(self, rhs: f32) -> bevy::math::Vec4; "#, r#" #[lua( - as_trait = "std::cmp::PartialEq", + as_trait = "std::ops::Mul", kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", + output(proxy), + composite = "mul", + metamethod = "Mul", )] - fn eq(&self, #[proxy] rhs: &glam::Vec4) -> bool; + fn mul(self, #[proxy] rhs: &glam::Vec4) -> bevy::math::Vec4; "#, r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Div", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", + composite = "div", + metamethod = "Div", )] - fn add(self, #[proxy] rhs: &glam::Vec4) -> bevy::math::Vec4; + fn div(self, rhs: f32) -> bevy::math::Vec4; "#, r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Div", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "div", + metamethod = "Div", )] - fn rem(self, rhs: f32) -> bevy::math::Vec4; + fn div(self, #[proxy] rhs: bevy::math::Vec4) -> bevy::math::Vec4; "#, r#" #[lua( - as_trait = "std::ops::Neg", + as_trait = "std::ops::Sub", kind = "MetaFunction", output(proxy), - composite = "neg", - metamethod = "Unm", + composite = "sub", + metamethod = "Sub", )] - fn neg(self) -> bevy::math::Vec4; + fn sub(self, #[proxy] rhs: &glam::Vec4) -> bevy::math::Vec4; "#, r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "add", + metamethod = "Add", )] - fn div(self, #[proxy] rhs: &glam::Vec4) -> bevy::math::Vec4; + fn add(self, #[proxy] rhs: &glam::Vec4) -> bevy::math::Vec4; "#, r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Neg", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "neg", + metamethod = "Unm", )] - fn sub(self, #[proxy] rhs: &glam::Vec4) -> bevy::math::Vec4; + fn neg(self) -> bevy::math::Vec4; "#, r#" @@ -12748,18 +12760,6 @@ struct Vec3A(); #[lua(kind = "Method", output(proxy))] fn as_u64vec4(&self) -> bevy::math::U64Vec4; -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: bevy::math::Vec4) -> bevy::math::Vec4; - "#, r#" @@ -12776,25 +12776,25 @@ struct Vec3A(); r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "add", + metamethod = "Add", )] - fn sub(self, #[proxy] rhs: bevy::math::Vec4) -> bevy::math::Vec4; + fn add(self, rhs: f32) -> bevy::math::Vec4; "#, r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "rem", + metamethod = "Mod", )] - fn sub(self, rhs: f32) -> bevy::math::Vec4; + fn rem(self, #[proxy] rhs: &glam::Vec4) -> bevy::math::Vec4; "#, r#" @@ -12824,17 +12824,12 @@ struct Vec4(); functions[r#" #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", )] - fn clone(&self) -> bevy::math::BVec2; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + fn eq(&self, #[proxy] other: &glam::BVec2) -> bool; "#, r#" @@ -12896,16 +12891,21 @@ struct Vec4(); #[lua(kind = "MutatingMethod")] fn set(&mut self, index: usize, value: bool) -> (); +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#, r#" #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), )] - fn eq(&self, #[proxy] other: &glam::BVec2) -> bool; + fn clone(&self) -> bevy::math::BVec2; "#, r#" @@ -12993,12 +12993,6 @@ struct BVec2 { )] fn eq(&self, #[proxy] other: &glam::BVec3) -> bool; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" @@ -13009,6 +13003,12 @@ struct BVec2 { )] fn clone(&self) -> bevy::math::BVec3; +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -13028,12 +13028,6 @@ struct BVec3 { remote = "bevy::math::BVec4", functions[r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" - #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -13042,6 +13036,16 @@ struct BVec3 { )] fn eq(&self, #[proxy] other: &glam::BVec4) -> bool; +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::BVec4; + "#, r#" /// Creates a new vector mask. @@ -13105,12 +13109,8 @@ struct BVec3 { "#, r#" - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::BVec4; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -13133,37 +13133,37 @@ struct BVec4 { functions[r#" #[lua( - as_trait = "std::ops::Neg", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "neg", - metamethod = "Unm", + composite = "add", + metamethod = "Add", )] - fn neg(self) -> bevy::math::DVec2; + fn add(self, rhs: f64) -> bevy::math::DVec2; "#, r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "add", + metamethod = "Add", )] - fn sub(self, #[proxy] rhs: bevy::math::DVec2) -> bevy::math::DVec2; + fn add(self, #[proxy] rhs: bevy::math::DVec2) -> bevy::math::DVec2; "#, r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Neg", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "neg", + metamethod = "Unm", )] - fn sub(self, #[proxy] rhs: &glam::DVec2) -> bevy::math::DVec2; + fn neg(self) -> bevy::math::DVec2; "#, r#" @@ -13181,25 +13181,24 @@ struct BVec4 { r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::cmp::PartialEq", kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", + composite = "eq", + metamethod = "Eq", )] - fn div(self, rhs: f64) -> bevy::math::DVec2; + fn eq(&self, #[proxy] other: &glam::DVec2) -> bool; "#, r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "mul", + metamethod = "Mul", )] - fn rem(self, #[proxy] rhs: &glam::DVec2) -> bevy::math::DVec2; + fn mul(self, #[proxy] rhs: bevy::math::DVec2) -> bevy::math::DVec2; "#, r#" @@ -13211,7 +13210,19 @@ struct BVec4 { composite = "div", metamethod = "Div", )] - fn div(self, #[proxy] rhs: &glam::DVec2) -> bevy::math::DVec2; + fn div(self, #[proxy] rhs: bevy::math::DVec2) -> bevy::math::DVec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, rhs: f64) -> bevy::math::DVec2; "#, r#" @@ -13229,13 +13240,13 @@ struct BVec4 { r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "mul", + metamethod = "Mul", )] - fn sub(self, rhs: f64) -> bevy::math::DVec2; + fn mul(self, rhs: f64) -> bevy::math::DVec2; "#, r#" @@ -13943,13 +13954,13 @@ struct BVec4 { r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Sub", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "sub", + metamethod = "Sub", )] - fn mul(self, rhs: f64) -> bevy::math::DVec2; + fn sub(self, #[proxy] rhs: bevy::math::DVec2) -> bevy::math::DVec2; "#, r#" @@ -13961,19 +13972,19 @@ struct BVec4 { composite = "div", metamethod = "Div", )] - fn div(self, #[proxy] rhs: bevy::math::DVec2) -> bevy::math::DVec2; + fn div(self, #[proxy] rhs: &glam::DVec2) -> bevy::math::DVec2; "#, r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "add", + metamethod = "Add", )] - fn rem(self, rhs: f64) -> bevy::math::DVec2; + fn add(self, #[proxy] rhs: &glam::DVec2) -> bevy::math::DVec2; "#, r#" @@ -13989,60 +14000,49 @@ struct BVec4 { r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Div", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", + composite = "div", + metamethod = "Div", )] - fn add(self, #[proxy] rhs: &glam::DVec2) -> bevy::math::DVec2; + fn div(self, rhs: f64) -> bevy::math::DVec2; "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Sub", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "sub", + metamethod = "Sub", )] - fn mul(self, #[proxy] rhs: bevy::math::DVec2) -> bevy::math::DVec2; + fn sub(self, rhs: f64) -> bevy::math::DVec2; "#, r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", + composite = "rem", + metamethod = "Mod", )] - fn add(self, #[proxy] rhs: bevy::math::DVec2) -> bevy::math::DVec2; + fn rem(self, #[proxy] rhs: &glam::DVec2) -> bevy::math::DVec2; "#, r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Sub", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, rhs: f64) -> bevy::math::DVec2; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", + composite = "sub", + metamethod = "Sub", )] - fn eq(&self, #[proxy] other: &glam::DVec2) -> bool; + fn sub(self, #[proxy] rhs: &glam::DVec2) -> bevy::math::DVec2; "#, r#" @@ -14075,49 +14075,47 @@ struct DVec2 { functions[r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", + composite = "rem", + metamethod = "Mod", )] - fn add(self, #[proxy] rhs: bevy::math::DVec3) -> bevy::math::DVec3; + fn rem(self, #[proxy] rhs: bevy::math::DVec3) -> bevy::math::DVec3; "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "add", + metamethod = "Add", )] - fn mul(self, #[proxy] rhs: &glam::DVec3) -> bevy::math::DVec3; + fn add(self, rhs: f64) -> bevy::math::DVec3; "#, r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Div", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "div", + metamethod = "Div", )] - fn sub(self, #[proxy] rhs: &glam::DVec3) -> bevy::math::DVec3; + fn div(self, rhs: f64) -> bevy::math::DVec3; "#, r#" #[lua( - as_trait = "std::ops::Sub", - kind = "MetaFunction", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", output(proxy), - composite = "sub", - metamethod = "Sub", )] - fn sub(self, #[proxy] rhs: bevy::math::DVec3) -> bevy::math::DVec3; + fn clone(&self) -> bevy::math::DVec3; "#, r#" @@ -14129,19 +14127,19 @@ struct DVec2 { composite = "div", metamethod = "Div", )] - fn div(self, #[proxy] rhs: bevy::math::DVec3) -> bevy::math::DVec3; + fn div(self, #[proxy] rhs: &glam::DVec3) -> bevy::math::DVec3; "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "add", + metamethod = "Add", )] - fn mul(self, #[proxy] rhs: bevy::math::DVec3) -> bevy::math::DVec3; + fn add(self, #[proxy] rhs: &glam::DVec3) -> bevy::math::DVec3; "#, r#" @@ -14153,40 +14151,43 @@ struct DVec2 { composite = "div", metamethod = "Div", )] - fn div(self, rhs: f64) -> bevy::math::DVec3; + fn div(self, #[proxy] rhs: bevy::math::DVec3) -> bevy::math::DVec3; "#, r#" #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", + as_trait = "std::ops::Sub", + kind = "MetaFunction", output(proxy), + composite = "sub", + metamethod = "Sub", )] - fn clone(&self) -> bevy::math::DVec3; + fn sub(self, rhs: f64) -> bevy::math::DVec3; "#, r#" #[lua( - as_trait = "std::ops::Neg", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "neg", - metamethod = "Unm", + composite = "mul", + metamethod = "Mul", )] - fn neg(self) -> bevy::math::DVec3; + fn mul(self, rhs: f64) -> bevy::math::DVec3; "#, r#" #[lua( - as_trait = "std::cmp::PartialEq", + as_trait = "std::ops::Rem", kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", + output(proxy), + composite = "rem", + metamethod = "Mod", )] - fn eq(&self, #[proxy] other: &glam::DVec3) -> bool; + fn rem(self, rhs: f64) -> bevy::math::DVec3; "#, r#" @@ -14198,19 +14199,19 @@ struct DVec2 { composite = "sub", metamethod = "Sub", )] - fn sub(self, rhs: f64) -> bevy::math::DVec3; + fn sub(self, #[proxy] rhs: &glam::DVec3) -> bevy::math::DVec3; "#, r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", + composite = "mul", + metamethod = "Mul", )] - fn add(self, rhs: f64) -> bevy::math::DVec3; + fn mul(self, #[proxy] rhs: &glam::DVec3) -> bevy::math::DVec3; "#, r#" @@ -14222,7 +14223,19 @@ struct DVec2 { composite = "rem", metamethod = "Mod", )] - fn rem(self, rhs: f64) -> bevy::math::DVec3; + fn rem(self, #[proxy] rhs: &glam::DVec3) -> bevy::math::DVec3; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, #[proxy] rhs: bevy::math::DVec3) -> bevy::math::DVec3; "#, r#" @@ -14879,280 +14892,62 @@ struct DVec2 { "#, r#" -/// Casts all elements of `self` to `f32`. - - #[lua(kind = "Method", output(proxy))] - fn as_vec3a(&self) -> bevy::math::Vec3A; - -"#, - r#" -/// Casts all elements of `self` to `i32`. - - #[lua(kind = "Method", output(proxy))] - fn as_ivec3(&self) -> bevy::math::IVec3; - -"#, - r#" -/// Casts all elements of `self` to `u32`. - - #[lua(kind = "Method", output(proxy))] - fn as_uvec3(&self) -> bevy::math::UVec3; - -"#, - r#" -/// Casts all elements of `self` to `i64`. - - #[lua(kind = "Method", output(proxy))] - fn as_i64vec3(&self) -> bevy::math::I64Vec3; - -"#, - r#" -/// Casts all elements of `self` to `u64`. - - #[lua(kind = "Method", output(proxy))] - fn as_u64vec3(&self) -> bevy::math::U64Vec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, #[proxy] rhs: &glam::DVec3) -> bevy::math::DVec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, #[proxy] rhs: &glam::DVec3) -> bevy::math::DVec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, #[proxy] rhs: bevy::math::DVec3) -> bevy::math::DVec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: &glam::DVec3) -> bevy::math::DVec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, rhs: f64) -> bevy::math::DVec3; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#, - r#" -#[lua(kind="MetaMethod", raw , metamethod="Index")] -fn index(&self, lua: &Lua, idx: crate::lua::util::LuaIndex) -> Result { - Ok(self.inner()?[*idx]) -} -"#, - r#" -#[lua(kind="MutatingMetaMethod", raw, metamethod="NewIndex")] -fn index(&mut self, lua: &Lua, idx: crate::lua::util::LuaIndex, val: f64) -> Result<(),_> { - self.val_mut(|s| Ok(s[*idx] = val))? -} -"#] -)] -struct DVec3 { - x: f64, - y: f64, - z: f64, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::math::DVec4", - functions[r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::DVec4; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, #[proxy] rhs: &glam::DVec4) -> bevy::math::DVec4; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, rhs: f64) -> bevy::math::DVec4; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: &glam::DVec4) -> bevy::math::DVec4; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Sub", - kind = "MetaFunction", - output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, #[proxy] rhs: bevy::math::DVec4) -> bevy::math::DVec4; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::DVec4) -> bevy::math::DVec4; - -"#, - r#" +/// Casts all elements of `self` to `f32`. - #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, rhs: f64) -> bevy::math::DVec4; + #[lua(kind = "Method", output(proxy))] + fn as_vec3a(&self) -> bevy::math::Vec3A; "#, r#" +/// Casts all elements of `self` to `i32`. - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, rhs: f64) -> bevy::math::DVec4; + #[lua(kind = "Method", output(proxy))] + fn as_ivec3(&self) -> bevy::math::IVec3; "#, r#" +/// Casts all elements of `self` to `u32`. - #[lua( - as_trait = "std::ops::Sub", - kind = "MetaFunction", - output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, #[proxy] rhs: &glam::DVec4) -> bevy::math::DVec4; + #[lua(kind = "Method", output(proxy))] + fn as_uvec3(&self) -> bevy::math::UVec3; "#, r#" +/// Casts all elements of `self` to `i64`. - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, #[proxy] rhs: &glam::DVec4) -> bevy::math::DVec4; + #[lua(kind = "Method", output(proxy))] + fn as_i64vec3(&self) -> bevy::math::I64Vec3; "#, r#" +/// Casts all elements of `self` to `u64`. - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: &glam::DVec4) -> bevy::math::DVec4; + #[lua(kind = "Method", output(proxy))] + fn as_u64vec3(&self) -> bevy::math::U64Vec3; "#, r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "add", + metamethod = "Add", )] - fn div(self, rhs: f64) -> bevy::math::DVec4; + fn add(self, #[proxy] rhs: bevy::math::DVec3) -> bevy::math::DVec3; "#, r#" #[lua( - as_trait = "std::ops::Neg", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "neg", - metamethod = "Unm", + composite = "mul", + metamethod = "Mul", )] - fn neg(self) -> bevy::math::DVec4; + fn mul(self, #[proxy] rhs: bevy::math::DVec3) -> bevy::math::DVec3; "#, r#" @@ -15163,22 +14958,50 @@ struct DVec3 { composite = "eq", metamethod = "Eq", )] - fn eq(&self, #[proxy] other: &glam::DVec4) -> bool; + fn eq(&self, #[proxy] other: &glam::DVec3) -> bool; "#, r#" #[lua( - as_trait = "std::ops::Rem", + as_trait = "std::ops::Neg", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "neg", + metamethod = "Unm", )] - fn rem(self, #[proxy] rhs: bevy::math::DVec4) -> bevy::math::DVec4; + fn neg(self) -> bevy::math::DVec3; "#, r#" +#[lua(kind="MetaMethod", metamethod="ToString")] +fn index(&self) -> String { + format!("{:?}", _self) +} +"#, + r#" +#[lua(kind="MetaMethod", raw , metamethod="Index")] +fn index(&self, lua: &Lua, idx: crate::lua::util::LuaIndex) -> Result { + Ok(self.inner()?[*idx]) +} +"#, + r#" +#[lua(kind="MutatingMetaMethod", raw, metamethod="NewIndex")] +fn index(&mut self, lua: &Lua, idx: crate::lua::util::LuaIndex, val: f64) -> Result<(),_> { + self.val_mut(|s| Ok(s[*idx] = val))? +} +"#] +)] +struct DVec3 { + x: f64, + y: f64, + z: f64, +} +#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] +#[proxy( + derive(clone), + remote = "bevy::math::DVec4", + functions[r#" /// Creates a new vector. #[lua(kind = "Function", output(proxy))] @@ -15823,6 +15646,161 @@ struct DVec3 { #[lua(kind = "Method", output(proxy))] fn as_u64vec4(&self) -> bevy::math::U64Vec4; +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, #[proxy] rhs: &glam::DVec4) -> bevy::math::DVec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, rhs: f64) -> bevy::math::DVec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Neg", + kind = "MetaFunction", + output(proxy), + composite = "neg", + metamethod = "Unm", + )] + fn neg(self) -> bevy::math::DVec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, #[proxy] rhs: &glam::DVec4) -> bevy::math::DVec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, #[proxy] rhs: bevy::math::DVec4) -> bevy::math::DVec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: &glam::DVec4) -> bevy::math::DVec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, rhs: f64) -> bevy::math::DVec4; + +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &glam::DVec4) -> bool; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, #[proxy] rhs: bevy::math::DVec4) -> bevy::math::DVec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::DVec4) -> bevy::math::DVec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, rhs: f64) -> bevy::math::DVec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, #[proxy] rhs: &glam::DVec4) -> bevy::math::DVec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, rhs: f64) -> bevy::math::DVec4; + "#, r#" @@ -15833,7 +15811,7 @@ struct DVec3 { composite = "div", metamethod = "Div", )] - fn div(self, #[proxy] rhs: bevy::math::DVec4) -> bevy::math::DVec4; + fn div(self, #[proxy] rhs: &glam::DVec4) -> bevy::math::DVec4; "#, r#" @@ -15845,19 +15823,41 @@ struct DVec3 { composite = "sub", metamethod = "Sub", )] - fn sub(self, rhs: f64) -> bevy::math::DVec4; + fn sub(self, #[proxy] rhs: bevy::math::DVec4) -> bevy::math::DVec4; "#, r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::DVec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Rem", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", + composite = "rem", + metamethod = "Mod", )] - fn add(self, #[proxy] rhs: bevy::math::DVec4) -> bevy::math::DVec4; + fn rem(self, #[proxy] rhs: bevy::math::DVec4) -> bevy::math::DVec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, rhs: f64) -> bevy::math::DVec4; "#, r#" @@ -15892,13 +15892,25 @@ struct DVec4 { functions[r#" #[lua( - as_trait = "std::ops::Neg", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "neg", - metamethod = "Unm", + composite = "add", + metamethod = "Add", )] - fn neg(self) -> bevy::math::Mat2; + fn add(self, #[proxy] rhs: bevy::math::Mat2) -> bevy::math::Mat2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::Mat2) -> bevy::math::Mat2; "#, r#" @@ -16127,47 +16139,37 @@ struct DVec4 { r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Neg", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "neg", + metamethod = "Unm", )] - fn mul(self, #[proxy] rhs: bevy::math::Vec2) -> bevy::math::Vec2; + fn neg(self) -> bevy::math::Mat2; "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Div", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::Mat2) -> bevy::math::Mat2; - -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), + composite = "div", + metamethod = "Div", )] - fn clone(&self) -> bevy::math::Mat2; + fn div(self, rhs: f32) -> bevy::math::Mat2; "#, r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "mul", + metamethod = "Mul", )] - fn div(self, rhs: f32) -> bevy::math::Mat2; + fn mul(self, rhs: f32) -> bevy::math::Mat2; "#, r#" @@ -16184,37 +16186,35 @@ struct DVec4 { r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "mul", + metamethod = "Mul", )] - fn sub(self, #[proxy] rhs: bevy::math::Mat2) -> bevy::math::Mat2; + fn mul(self, #[proxy] rhs: bevy::math::Vec2) -> bevy::math::Vec2; "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Sub", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "sub", + metamethod = "Sub", )] - fn mul(self, rhs: f32) -> bevy::math::Mat2; + fn sub(self, #[proxy] rhs: bevy::math::Mat2) -> bevy::math::Mat2; "#, r#" #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", output(proxy), - composite = "add", - metamethod = "Add", )] - fn add(self, #[proxy] rhs: bevy::math::Mat2) -> bevy::math::Mat2; + fn clone(&self) -> bevy::math::Mat2; "#, r#" @@ -16256,13 +16256,25 @@ struct Mat2(); functions[r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Sub", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", + composite = "sub", + metamethod = "Sub", )] - fn add(self, #[proxy] rhs: bevy::math::Mat3) -> bevy::math::Mat3; + fn sub(self, #[proxy] rhs: bevy::math::Mat3) -> bevy::math::Mat3; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::Mat3) -> bevy::math::Mat3; "#, r#" @@ -16280,13 +16292,24 @@ struct Mat2(); r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] rhs: &glam::Mat3) -> bool; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "add", + metamethod = "Add", )] - fn mul(self, #[proxy] rhs: bevy::math::Mat3) -> bevy::math::Mat3; + fn add(self, #[proxy] rhs: bevy::math::Mat3) -> bevy::math::Mat3; "#, r#" @@ -16643,17 +16666,7 @@ struct Mat2(); composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::Vec3A) -> bevy::math::Vec3A; - -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::Mat3; + fn mul(self, #[proxy] rhs: bevy::math::Affine2) -> bevy::math::Mat3; "#, r#" @@ -16665,30 +16678,17 @@ struct Mat2(); composite = "mul", metamethod = "Mul", )] - fn mul(self, rhs: f32) -> bevy::math::Mat3; + fn mul(self, #[proxy] rhs: bevy::math::Vec3) -> bevy::math::Vec3; "#, r#" #[lua( - as_trait = "std::ops::Sub", - kind = "MetaFunction", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, #[proxy] rhs: bevy::math::Mat3) -> bevy::math::Mat3; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", )] - fn eq(&self, #[proxy] rhs: &glam::Mat3) -> bool; + fn clone(&self) -> bevy::math::Mat3; "#, r#" @@ -16700,7 +16700,7 @@ struct Mat2(); composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::Affine2) -> bevy::math::Mat3; + fn mul(self, #[proxy] rhs: bevy::math::Vec3A) -> bevy::math::Vec3A; "#, r#" @@ -16712,7 +16712,7 @@ struct Mat2(); composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::Vec3) -> bevy::math::Vec3; + fn mul(self, rhs: f32) -> bevy::math::Mat3; "#, r#" @@ -16759,6 +16759,77 @@ struct Mat3 { derive(clone), remote = "bevy::math::Mat3A", functions[r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, #[proxy] rhs: bevy::math::Mat3A) -> bevy::math::Mat3A; + +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] rhs: &glam::Mat3A) -> bool; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::Mat3A) -> bevy::math::Mat3A; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, #[proxy] rhs: bevy::math::Mat3A) -> bevy::math::Mat3A; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Neg", + kind = "MetaFunction", + output(proxy), + composite = "neg", + metamethod = "Unm", + )] + fn neg(self) -> bevy::math::Mat3A; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::Vec3A) -> bevy::math::Vec3A; + +"#, + r#" /// Creates a 3x3 matrix from three column vectors. #[lua(kind = "Function", output(proxy))] @@ -17094,48 +17165,25 @@ struct Mat3 { r#" #[lua( - as_trait = "std::ops::Neg", - kind = "MetaFunction", - output(proxy), - composite = "neg", - metamethod = "Unm", - )] - fn neg(self) -> bevy::math::Mat3A; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Div", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", + composite = "div", + metamethod = "Div", )] - fn add(self, #[proxy] rhs: bevy::math::Mat3A) -> bevy::math::Mat3A; + fn div(self, rhs: f32) -> bevy::math::Mat3A; "#, r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, #[proxy] rhs: bevy::math::Mat3A) -> bevy::math::Mat3A; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", + composite = "mul", + metamethod = "Mul", )] - fn eq(&self, #[proxy] rhs: &glam::Mat3A) -> bool; + fn mul(self, #[proxy] rhs: bevy::math::Affine2) -> bevy::math::Mat3A; "#, r#" @@ -17147,18 +17195,6 @@ struct Mat3 { )] fn clone(&self) -> bevy::math::Mat3A; -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::Mat3A) -> bevy::math::Mat3A; - "#, r#" @@ -17171,30 +17207,6 @@ struct Mat3 { )] fn mul(self, rhs: f32) -> bevy::math::Mat3A; -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::Affine2) -> bevy::math::Mat3A; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, rhs: f32) -> bevy::math::Mat3A; - "#, r#" @@ -17207,18 +17219,6 @@ struct Mat3 { )] fn mul(self, #[proxy] rhs: bevy::math::Vec3) -> bevy::math::Vec3; -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::Vec3A) -> bevy::math::Vec3A; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -17265,6 +17265,17 @@ struct Mat3A { remote = "bevy::math::Mat4", functions[r#" + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] rhs: &glam::Mat4) -> bool; + +"#, + r#" + #[lua( as_trait = "std::ops::Div", kind = "MetaFunction", @@ -17913,19 +17924,17 @@ struct Mat3A { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::Vec4) -> bevy::math::Vec4; + fn mul(self, rhs: f32) -> bevy::math::Mat4; "#, r#" #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", output(proxy), - composite = "mul", - metamethod = "Mul", )] - fn mul(self, rhs: f32) -> bevy::math::Mat4; + fn clone(&self) -> bevy::math::Mat4; "#, r#" @@ -17949,40 +17958,31 @@ struct Mat3A { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::Affine3A) -> bevy::math::Mat4; + fn mul(self, #[proxy] rhs: bevy::math::Vec4) -> bevy::math::Vec4; "#, r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "mul", + metamethod = "Mul", )] - fn sub(self, #[proxy] rhs: bevy::math::Mat4) -> bevy::math::Mat4; + fn mul(self, #[proxy] rhs: bevy::math::Affine3A) -> bevy::math::Mat4; "#, r#" #[lua( - as_trait = "std::cmp::PartialEq", + as_trait = "std::ops::Sub", kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] rhs: &glam::Mat4) -> bool; - -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", output(proxy), + composite = "sub", + metamethod = "Sub", )] - fn clone(&self) -> bevy::math::Mat4; + fn sub(self, #[proxy] rhs: bevy::math::Mat4) -> bevy::math::Mat4; "#, r#" @@ -18031,75 +18031,6 @@ struct Mat4 { derive(clone), remote = "bevy::math::DMat2", functions[r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, rhs: f64) -> bevy::math::DMat2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::DVec2) -> bevy::math::DVec2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Neg", - kind = "MetaFunction", - output(proxy), - composite = "neg", - metamethod = "Unm", - )] - fn neg(self) -> bevy::math::DMat2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: bevy::math::DMat2) -> bevy::math::DMat2; - -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::DMat2; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] rhs: &glam::DMat2) -> bool; - -"#, - r#" /// Creates a 2x2 matrix from two column vectors. #[lua(kind = "Function", output(proxy))] @@ -18275,29 +18206,86 @@ struct Mat4 { "#, r#" -/// 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/). +/// 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/). + + #[lua(kind = "Method")] + fn abs_diff_eq(&self, #[proxy] rhs: bevy::math::DMat2, max_abs_diff: f64) -> bool; + +"#, + r#" +/// Takes the absolute value of each element in `self` + + #[lua(kind = "Method", output(proxy))] + fn abs(&self) -> bevy::math::DMat2; + +"#, + r#" + + #[lua(kind = "Method", output(proxy))] + fn as_mat2(&self) -> bevy::math::Mat2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, rhs: f64) -> bevy::math::DMat2; + +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::DMat2; + +"#, + r#" - #[lua(kind = "Method")] - fn abs_diff_eq(&self, #[proxy] rhs: bevy::math::DMat2, max_abs_diff: f64) -> bool; + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::DMat2) -> bevy::math::DMat2; "#, r#" -/// Takes the absolute value of each element in `self` - #[lua(kind = "Method", output(proxy))] - fn abs(&self) -> bevy::math::DMat2; + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, rhs: f64) -> bevy::math::DMat2; "#, r#" - #[lua(kind = "Method", output(proxy))] - fn as_mat2(&self) -> bevy::math::Mat2; + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] rhs: &glam::DMat2) -> bool; "#, r#" @@ -18311,6 +18299,18 @@ struct Mat4 { )] fn sub(self, #[proxy] rhs: bevy::math::DMat2) -> bevy::math::DMat2; +"#, + r#" + + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, #[proxy] rhs: bevy::math::DMat2) -> bevy::math::DMat2; + "#, r#" @@ -18321,19 +18321,19 @@ struct Mat4 { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::DMat2) -> bevy::math::DMat2; + fn mul(self, #[proxy] rhs: bevy::math::DVec2) -> bevy::math::DVec2; "#, r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Neg", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "neg", + metamethod = "Unm", )] - fn div(self, rhs: f64) -> bevy::math::DMat2; + fn neg(self) -> bevy::math::DMat2; "#, r#" @@ -18380,37 +18380,37 @@ struct DMat2 { functions[r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "add", + metamethod = "Add", )] - fn mul(self, #[proxy] rhs: bevy::math::DAffine2) -> bevy::math::DMat3; + fn add(self, #[proxy] rhs: bevy::math::DMat3) -> bevy::math::DMat3; "#, r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "mul", + metamethod = "Mul", )] - fn sub(self, #[proxy] rhs: bevy::math::DMat3) -> bevy::math::DMat3; + fn mul(self, rhs: f64) -> bevy::math::DMat3; "#, r#" #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Sub", kind = "MetaFunction", output(proxy), - composite = "add", - metamethod = "Add", + composite = "sub", + metamethod = "Sub", )] - fn add(self, #[proxy] rhs: bevy::math::DMat3) -> bevy::math::DMat3; + fn sub(self, #[proxy] rhs: bevy::math::DMat3) -> bevy::math::DMat3; "#, r#" @@ -18426,12 +18426,13 @@ struct DMat2 { r#" #[lua( - as_trait = "std::cmp::PartialEq", + as_trait = "std::ops::Mul", kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", + output(proxy), + composite = "mul", + metamethod = "Mul", )] - fn eq(&self, #[proxy] rhs: &glam::DMat3) -> bool; + fn mul(self, #[proxy] rhs: bevy::math::DMat3) -> bevy::math::DMat3; "#, r#" @@ -18443,7 +18444,19 @@ struct DMat2 { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::DVec3) -> bevy::math::DVec3; + fn mul(self, #[proxy] rhs: bevy::math::DAffine2) -> bevy::math::DMat3; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, rhs: f64) -> bevy::math::DMat3; "#, r#" @@ -18461,13 +18474,24 @@ struct DMat2 { r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "mul", + metamethod = "Mul", )] - fn div(self, rhs: f64) -> bevy::math::DMat3; + fn mul(self, #[proxy] rhs: bevy::math::DVec3) -> bevy::math::DVec3; + +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] rhs: &glam::DMat3) -> bool; "#, r#" @@ -18799,30 +18823,6 @@ struct DMat2 { #[lua(kind = "Method", output(proxy))] fn as_mat3(&self) -> bevy::math::Mat3; -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::DMat3) -> bevy::math::DMat3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, rhs: f64) -> bevy::math::DMat3; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -18869,6 +18869,42 @@ struct DMat3 { remote = "bevy::math::DMat4", functions[r#" + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::DMat4) -> bevy::math::DMat4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, rhs: f64) -> bevy::math::DMat4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::DAffine3) -> bevy::math::DMat4; + +"#, + r#" + #[lua( as_trait = "std::ops::Sub", kind = "MetaFunction", @@ -18878,6 +18914,29 @@ struct DMat3 { )] fn sub(self, #[proxy] rhs: bevy::math::DMat4) -> bevy::math::DMat4; +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] rhs: &glam::DMat4) -> bool; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, rhs: f64) -> bevy::math::DMat4; + "#, r#" /// Creates a 4x4 matrix from four column vectors. @@ -19435,114 +19494,55 @@ struct DMat3 { /// For more see /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). - #[lua(kind = "Method")] - fn abs_diff_eq(&self, #[proxy] rhs: bevy::math::DMat4, max_abs_diff: f64) -> bool; - -"#, - r#" -/// Takes the absolute value of each element in `self` - - #[lua(kind = "Method", output(proxy))] - fn abs(&self) -> bevy::math::DMat4; - -"#, - r#" - - #[lua(kind = "Method", output(proxy))] - fn as_mat4(&self) -> bevy::math::Mat4; - -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::DMat4; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Neg", - kind = "MetaFunction", - output(proxy), - composite = "neg", - metamethod = "Unm", - )] - fn neg(self) -> bevy::math::DMat4; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: bevy::math::DMat4) -> bevy::math::DMat4; + #[lua(kind = "Method")] + fn abs_diff_eq(&self, #[proxy] rhs: bevy::math::DMat4, max_abs_diff: f64) -> bool; "#, r#" +/// Takes the absolute value of each element in `self` - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::DAffine3) -> bevy::math::DMat4; + #[lua(kind = "Method", output(proxy))] + fn abs(&self) -> bevy::math::DMat4; "#, r#" - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::DMat4) -> bevy::math::DMat4; + #[lua(kind = "Method", output(proxy))] + fn as_mat4(&self) -> bevy::math::Mat4; "#, r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Neg", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "neg", + metamethod = "Unm", )] - fn div(self, rhs: f64) -> bevy::math::DMat4; + fn neg(self) -> bevy::math::DMat4; "#, r#" #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), )] - fn eq(&self, #[proxy] rhs: &glam::DMat4) -> bool; + fn clone(&self) -> bevy::math::DMat4; "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "add", + metamethod = "Add", )] - fn mul(self, rhs: f64) -> bevy::math::DMat4; + fn add(self, #[proxy] rhs: bevy::math::DMat4) -> bevy::math::DMat4; "#, r#" @@ -19603,6 +19603,63 @@ struct DMat4 { derive(clone), remote = "bevy::math::Affine2", functions[r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::Affine2) -> bevy::math::Affine2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::Mat3) -> bevy::math::Mat3; + +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::Affine2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::Mat3A) -> bevy::math::Mat3A; + +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] rhs: &glam::Affine2) -> bool; + +"#, + r#" /// Creates an affine transform from three column vectors. #[lua(kind = "Function", output(proxy))] @@ -19771,63 +19828,6 @@ struct DMat4 { #[lua(kind = "Method", output(proxy))] fn inverse(&self) -> bevy::math::Affine2; -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::Affine2) -> bevy::math::Affine2; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] rhs: &glam::Affine2) -> bool; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::Mat3) -> bevy::math::Mat3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::Mat3A) -> bevy::math::Mat3A; - -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::Affine2; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -19848,6 +19848,17 @@ struct Affine2 { remote = "bevy::math::Affine3A", functions[r#" + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] rhs: &glam::Affine3A) -> bool; + +"#, + r#" + #[lua( as_trait = "std::ops::Mul", kind = "MetaFunction", @@ -19867,18 +19878,6 @@ struct Affine2 { )] fn clone(&self) -> bevy::math::Affine3A; -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::Mat4) -> bevy::math::Mat4; - "#, r#" /// Creates an affine transform from three column vectors. @@ -20170,12 +20169,13 @@ struct Affine2 { r#" #[lua( - as_trait = "std::cmp::PartialEq", + as_trait = "std::ops::Mul", kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", + output(proxy), + composite = "mul", + metamethod = "Mul", )] - fn eq(&self, #[proxy] rhs: &glam::Affine3A) -> bool; + fn mul(self, #[proxy] rhs: bevy::math::Mat4) -> bevy::math::Mat4; "#, r#" @@ -20206,39 +20206,6 @@ struct Affine3A { )] fn mul(self, #[proxy] rhs: bevy::math::DMat3) -> bevy::math::DMat3; -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::DAffine2) -> bevy::math::DAffine2; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] rhs: &glam::DAffine2) -> bool; - -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::DAffine2; - "#, r#" /// Creates an affine transform from three column vectors. @@ -20391,16 +20358,49 @@ struct Affine3A { /// For more see /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). - #[lua(kind = "Method")] - fn abs_diff_eq(&self, #[proxy] rhs: bevy::math::DAffine2, max_abs_diff: f64) -> bool; + #[lua(kind = "Method")] + fn abs_diff_eq(&self, #[proxy] rhs: bevy::math::DAffine2, max_abs_diff: f64) -> bool; + +"#, + r#" +/// Return the inverse of this transform. +/// Note that if the transform is not invertible the result will be invalid. + + #[lua(kind = "Method", output(proxy))] + fn inverse(&self) -> bevy::math::DAffine2; + +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::DAffine2; + +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] rhs: &glam::DAffine2) -> bool; "#, r#" -/// Return the inverse of this transform. -/// Note that if the transform is not invertible the result will be invalid. - #[lua(kind = "Method", output(proxy))] - fn inverse(&self) -> bevy::math::DAffine2; + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::DAffine2) -> bevy::math::DAffine2; "#, r#" @@ -20421,6 +20421,51 @@ struct DAffine2 { derive(clone), remote = "bevy::math::DAffine3", functions[r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] rhs: &glam::DAffine3) -> bool; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::DAffine3) -> bevy::math::DAffine3; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::DMat4) -> bevy::math::DMat4; + +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::DAffine3; + +"#, + r#" /// Creates an affine transform from three column vectors. #[lua(kind = "Function", output(proxy))] @@ -20690,51 +20735,6 @@ struct DAffine2 { #[lua(kind = "Method", output(proxy))] fn inverse(&self) -> bevy::math::DAffine3; -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] rhs: &glam::DAffine3) -> bool; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::DAffine3) -> bevy::math::DAffine3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::DMat4) -> bevy::math::DMat4; - -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::DAffine3; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -20754,46 +20754,6 @@ struct DAffine3 { derive(clone), remote = "bevy::math::DQuat", functions[r#" -/// Subtracts the `rhs` quaternion from `self`. -/// The difference is not guaranteed to be normalized. - - #[lua( - as_trait = "std::ops::Sub", - kind = "MetaFunction", - output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, #[proxy] rhs: bevy::math::DQuat) -> bevy::math::DQuat; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Neg", - kind = "MetaFunction", - output(proxy), - composite = "neg", - metamethod = "Unm", - )] - fn neg(self) -> bevy::math::DQuat; - -"#, - r#" -/// Multiplies a quaternion by a scalar value. -/// The product is not guaranteed to be normalized. - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, rhs: f64) -> bevy::math::DQuat; - -"#, - r#" /// 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 @@ -20810,9 +20770,8 @@ struct DAffine3 { "#, r#" -/// Multiplies a quaternion and a 3D vector, returning the rotated vector. -/// # Panics -/// Will panic if `self` is not normalized when `glam_assert` is enabled. +/// Multiplies a quaternion by a scalar value. +/// The product is not guaranteed to be normalized. #[lua( as_trait = "std::ops::Mul", @@ -20821,31 +20780,7 @@ struct DAffine3 { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::DVec3) -> bevy::math::DVec3; - -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::DQuat; - -"#, - r#" -/// Divides a quaternion by a scalar value. -/// The quotient is not guaranteed to be normalized. - - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, rhs: f64) -> bevy::math::DQuat; + fn mul(self, rhs: f64) -> bevy::math::DQuat; "#, r#" @@ -20865,17 +20800,6 @@ struct DAffine3 { )] fn mul(self, #[proxy] rhs: bevy::math::DQuat) -> bevy::math::DQuat; -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] rhs: &glam::DQuat) -> bool; - "#, r#" /// Creates a new rotation quaternion. @@ -21232,41 +21156,117 @@ struct DAffine3 { "#, r#" -/// Multiplies a quaternion and a 3D vector, returning the rotated vector. -/// # Panics -/// Will panic if `self` is not normalized when `glam_assert` is enabled. +/// Multiplies a quaternion and a 3D vector, returning the rotated vector. +/// # Panics +/// Will panic if `self` is not normalized when `glam_assert` is enabled. + + #[lua(kind = "Method", output(proxy))] + fn mul_vec3(self, #[proxy] rhs: bevy::math::DVec3) -> bevy::math::DVec3; + +"#, + r#" +/// 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. + + #[lua(kind = "Method", output(proxy))] + fn mul_quat(self, #[proxy] rhs: bevy::math::DQuat) -> bevy::math::DQuat; + +"#, + r#" +/// 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. + + #[lua(kind = "Function", output(proxy))] + fn from_affine3(#[proxy] a: &glam::DAffine3) -> bevy::math::DQuat; + +"#, + r#" + + #[lua(kind = "Method", output(proxy))] + fn as_quat(self) -> bevy::math::Quat; + +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::DQuat; + +"#, + r#" +/// Multiplies a quaternion and a 3D vector, returning the rotated vector. +/// # Panics +/// Will panic if `self` is not normalized when `glam_assert` is enabled. + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::DVec3) -> bevy::math::DVec3; + +"#, + r#" - #[lua(kind = "Method", output(proxy))] - fn mul_vec3(self, #[proxy] rhs: bevy::math::DVec3) -> bevy::math::DVec3; + #[lua( + as_trait = "std::ops::Neg", + kind = "MetaFunction", + output(proxy), + composite = "neg", + metamethod = "Unm", + )] + fn neg(self) -> bevy::math::DQuat; "#, r#" -/// 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. - #[lua(kind = "Method", output(proxy))] - fn mul_quat(self, #[proxy] rhs: bevy::math::DQuat) -> bevy::math::DQuat; + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] rhs: &glam::DQuat) -> bool; "#, r#" -/// 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. +/// Subtracts the `rhs` quaternion from `self`. +/// The difference is not guaranteed to be normalized. - #[lua(kind = "Function", output(proxy))] - fn from_affine3(#[proxy] a: &glam::DAffine3) -> bevy::math::DQuat; + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, #[proxy] rhs: bevy::math::DQuat) -> bevy::math::DQuat; "#, r#" +/// Divides a quaternion by a scalar value. +/// The quotient is not guaranteed to be normalized. - #[lua(kind = "Method", output(proxy))] - fn as_quat(self) -> bevy::math::Quat; + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, rhs: f64) -> bevy::math::DQuat; "#, r#" @@ -21295,12 +21295,6 @@ struct DQuat { )] fn clone(&self) -> bevy::math::EulerRot; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" @@ -21312,6 +21306,12 @@ struct DQuat { )] fn eq(&self, #[proxy] other: &glam::EulerRot) -> bool; +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -21388,22 +21388,22 @@ struct EulerRot {} r#" #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), )] - fn eq(&self, #[proxy] rhs: &glam::BVec3A) -> bool; + fn clone(&self) -> bevy::math::BVec3A; "#, r#" #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", )] - fn clone(&self) -> bevy::math::BVec3A; + fn eq(&self, #[proxy] rhs: &glam::BVec3A) -> bool; "#, r#" @@ -21421,11 +21421,12 @@ struct BVec3A(); functions[r#" #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", )] - fn clone(&self) -> bevy::math::BVec4A; + fn eq(&self, #[proxy] rhs: &glam::BVec4A) -> bool; "#, r#" @@ -21491,12 +21492,11 @@ struct BVec3A(); r#" #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), )] - fn eq(&self, #[proxy] rhs: &glam::BVec4A) -> bool; + fn clone(&self) -> bevy::math::BVec4A; "#, r#" @@ -21513,17 +21513,6 @@ struct BVec4A(); remote = "smol_str::SmolStr", functions[r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &smol_str::SmolStr) -> bool; - -"#, - r#" - #[lua( as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", kind = "Method", @@ -21552,26 +21541,191 @@ struct BVec4A(); "#, r#" - #[lua(kind = "Method")] - fn is_heap_allocated(&self) -> bool; + #[lua(kind = "Method")] + fn is_heap_allocated(&self) -> bool; + +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &smol_str::SmolStr) -> bool; + +"#, + r#" +#[lua(kind="MetaMethod", metamethod="ToString")] +fn index(&self) -> String { + format!("{:?}", _self) +} +"#] +)] +struct SmolStr(); +#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] +#[proxy( + derive(clone), + remote = "uuid::Uuid", + functions[r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + +"#, + r#" +/// 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(), +/// ); +/// ``` + + #[lua(kind = "Function", output(proxy))] + fn nil() -> uuid::Uuid; + +"#, + r#" +/// 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(), +/// ); +/// ``` + + #[lua(kind = "Function", output(proxy))] + fn max() -> uuid::Uuid; + +"#, + r#" +/// 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(), +/// ); +/// ``` + + #[lua(kind = "Function", output(proxy))] + fn from_u128(v: u128) -> uuid::Uuid; + +"#, + r#" +/// 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(), +/// ); +/// ``` + + #[lua(kind = "Function", output(proxy))] + fn from_u128_le(v: u128) -> uuid::Uuid; + +"#, + r#" +/// 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(), +/// ); +/// ``` + + #[lua(kind = "Function", output(proxy))] + fn from_u64_pair(high_bits: u64, low_bits: u64) -> uuid::Uuid; + +"#, + r#" +/// 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(()) +/// # } +/// ``` + + #[lua(kind = "Function", output(proxy))] + fn from_bytes(bytes: [u8; 16]) -> uuid::Uuid; "#, r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct SmolStr(); -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "uuid::Uuid", - functions[r#" +/// 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(()) +/// # } +/// ``` - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua(kind = "Function", output(proxy))] + fn from_bytes_le(b: [u8; 16]) -> uuid::Uuid; "#, r#" @@ -21599,6 +21753,27 @@ struct SmolStr(); #[lua(kind = "Function", output(proxy))] fn new_v4() -> uuid::Uuid; +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &uuid::Uuid) -> bool; + +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> uuid::Uuid; + "#, r#" /// Returns the version number of the UUID. @@ -21782,181 +21957,6 @@ struct SmolStr(); &self, ) -> bevy::reflect::erased_serde::__private::serde::__private::Option<[u8; 6]>; -"#, - r#" -/// 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(), -/// ); -/// ``` - - #[lua(kind = "Function", output(proxy))] - fn nil() -> uuid::Uuid; - -"#, - r#" -/// 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(), -/// ); -/// ``` - - #[lua(kind = "Function", output(proxy))] - fn max() -> uuid::Uuid; - -"#, - r#" -/// 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(), -/// ); -/// ``` - - #[lua(kind = "Function", output(proxy))] - fn from_u128(v: u128) -> uuid::Uuid; - -"#, - r#" -/// 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(), -/// ); -/// ``` - - #[lua(kind = "Function", output(proxy))] - fn from_u128_le(v: u128) -> uuid::Uuid; - -"#, - r#" -/// 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(), -/// ); -/// ``` - - #[lua(kind = "Function", output(proxy))] - fn from_u64_pair(high_bits: u64, low_bits: u64) -> uuid::Uuid; - -"#, - r#" -/// 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(()) -/// # } -/// ``` - - #[lua(kind = "Function", output(proxy))] - fn from_bytes(bytes: [u8; 16]) -> uuid::Uuid; - -"#, - r#" -/// 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(()) -/// # } -/// ``` - - #[lua(kind = "Function", output(proxy))] - fn from_bytes_le(b: [u8; 16]) -> uuid::Uuid; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &uuid::Uuid) -> bool; - -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> uuid::Uuid; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] diff --git a/crates/bevy_script_api/src/providers/bevy_time.rs b/crates/bevy_script_api/src/providers/bevy_time.rs index 8910927a..715be7fd 100644 --- a/crates/bevy_script_api/src/providers/bevy_time.rs +++ b/crates/bevy_script_api/src/providers/bevy_time.rs @@ -50,8 +50,19 @@ struct Real {} remote = "bevy::time::prelude::Timer", functions[r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::time::prelude::Timer; + +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &timer::Timer) -> bool; "#, r#" @@ -391,19 +402,8 @@ struct Real {} "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::time::prelude::Timer; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &timer::Timer) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -420,12 +420,6 @@ struct Timer {} remote = "bevy::time::prelude::TimerMode", functions[r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" - #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -434,6 +428,12 @@ struct Timer {} )] fn eq(&self, #[proxy] other: &timer::TimerMode) -> bool; +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#, r#" @@ -482,17 +482,6 @@ struct Virtual {} #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::time::Stopwatch; -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &stopwatch::Stopwatch) -> bool; - "#, r#" /// Create a new unpaused `Stopwatch` with no elapsed time. @@ -641,6 +630,17 @@ struct Virtual {} #[lua(kind = "MutatingMethod")] fn reset(&mut self) -> (); +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &stopwatch::Stopwatch) -> bool; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] diff --git a/crates/bevy_script_api/src/providers/bevy_transform.rs b/crates/bevy_script_api/src/providers/bevy_transform.rs index d6e093de..57bcb23f 100644 --- a/crates/bevy_script_api/src/providers/bevy_transform.rs +++ b/crates/bevy_script_api/src/providers/bevy_transform.rs @@ -18,12 +18,13 @@ use bevy_script_api::{ functions[r#" #[lua( - as_trait = "std::cmp::PartialEq", + as_trait = "std::ops::Mul", kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", + output(proxy), + composite = "mul", + metamethod = "Mul", )] - fn eq(&self, #[proxy] other: &components::global_transform::GlobalTransform) -> bool; + fn mul(self, #[proxy] value: bevy::math::Vec3) -> bevy::math::Vec3; "#, r#" @@ -38,9 +39,15 @@ use bevy_script_api::{ fn mul( self, #[proxy] - transform: bevy::transform::components::Transform, + global_transform: bevy::transform::components::GlobalTransform, ) -> bevy::transform::components::GlobalTransform; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::transform::components::GlobalTransform; + "#, r#" @@ -51,13 +58,22 @@ use bevy_script_api::{ composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] value: bevy::math::Vec3) -> bevy::math::Vec3; + fn mul( + self, + #[proxy] + transform: bevy::transform::components::Transform, + ) -> bevy::transform::components::GlobalTransform; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::transform::components::GlobalTransform; + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &components::global_transform::GlobalTransform) -> bool; "#, r#" @@ -306,22 +322,6 @@ use bevy_script_api::{ transform: bevy::transform::components::Transform, ) -> bevy::transform::components::GlobalTransform; -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul( - self, - #[proxy] - global_transform: bevy::transform::components::GlobalTransform, - ) -> bevy::transform::components::GlobalTransform; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -336,17 +336,6 @@ struct GlobalTransform(); derive(clone), remote = "bevy::transform::components::Transform", functions[r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &components::transform::Transform) -> bool; - -"#, - r#" /// 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. @@ -690,8 +679,13 @@ struct GlobalTransform(); "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::transform::components::Transform; + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &components::transform::Transform) -> bool; "#, r#" @@ -703,7 +697,17 @@ struct GlobalTransform(); composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] value: bevy::math::Vec3) -> bevy::math::Vec3; + fn mul( + self, + #[proxy] + transform: bevy::transform::components::Transform, + ) -> bevy::transform::components::Transform; + +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::transform::components::Transform; "#, r#" @@ -715,11 +719,7 @@ struct GlobalTransform(); composite = "mul", metamethod = "Mul", )] - fn mul( - self, - #[proxy] - transform: bevy::transform::components::Transform, - ) -> bevy::transform::components::Transform; + fn mul(self, #[proxy] value: bevy::math::Vec3) -> bevy::math::Vec3; "#, r#" diff --git a/crates/bevy_script_api/src/providers/bevy_window.rs b/crates/bevy_script_api/src/providers/bevy_window.rs deleted file mode 100644 index 75ee99ea..00000000 --- a/crates/bevy_script_api/src/providers/bevy_window.rs +++ /dev/null @@ -1,1879 +0,0 @@ -// @generated by cargo bevy-api-gen generate, modify the templates not this file -#![allow(clippy::all)] -#![allow(unused, deprecated, dead_code)] -#![cfg_attr(rustfmt, rustfmt_skip)] -use super::bevy_a11y::*; -use super::bevy_ecs::*; -use super::bevy_reflect::*; -use super::bevy_core::*; -use super::bevy_input::*; -use super::bevy_math::*; -extern crate self as bevy_script_api; -use bevy_script_api::{ - lua::RegisterForeignLuaType, ReflectedValue, common::bevy::GetWorld, -}; -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::prelude::CursorEntered", - functions[r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::CursorEntered) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::prelude::CursorEntered; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct CursorEntered { - #[lua(output(proxy))] - window: bevy::ecs::entity::Entity, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::prelude::CursorLeft", - functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::prelude::CursorLeft; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::CursorLeft) -> bool; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct CursorLeft { - #[lua(output(proxy))] - window: bevy::ecs::entity::Entity, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::prelude::CursorMoved", - functions[r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::CursorMoved) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::prelude::CursorMoved; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct CursorMoved { - #[lua(output(proxy))] - window: bevy::ecs::entity::Entity, - #[lua(output(proxy))] - position: bevy::math::Vec2, - delta: ReflectedValue, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::prelude::FileDragAndDrop", - functions[r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::FileDragAndDrop) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::prelude::FileDragAndDrop; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct FileDragAndDrop {} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::prelude::Ime", - functions[r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::prelude::Ime; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::Ime) -> bool; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct Ime {} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::prelude::MonitorSelection", - functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::prelude::MonitorSelection; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &window::MonitorSelection) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct MonitorSelection {} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::prelude::Window", - functions[r#" -/// Setting to true will attempt to maximize the window. -/// Setting to false will attempt to un-maximize the window. - - #[lua(kind = "MutatingMethod")] - fn set_maximized(&mut self, maximized: bool) -> (); - -"#, - r#" -/// Setting to true will attempt to minimize the window. -/// Setting to false will attempt to un-minimize the window. - - #[lua(kind = "MutatingMethod")] - fn set_minimized(&mut self, minimized: bool) -> (); - -"#, - r#" -/// Calling this will attempt to start a drag-move of the window. -/// There is no guarantee that this will work unless the left mouse button was -/// pressed immediately before this function was called. - - #[lua(kind = "MutatingMethod")] - fn start_drag_move(&mut self) -> (); - -"#, - r#" -/// Calling this will attempt to start a drag-resize of the window. -/// There is no guarantee that this will work unless the left mouse button was -/// pressed immediately before this function was called. - - #[lua(kind = "MutatingMethod")] - fn start_drag_resize(&mut self, #[proxy] direction: bevy::math::CompassOctant) -> (); - -"#, - r#" -/// The window's client area width in logical pixels. -/// See [`WindowResolution`] for an explanation about logical/physical sizes. - - #[lua(kind = "Method")] - fn width(&self) -> f32; - -"#, - r#" -/// The window's client area height in logical pixels. -/// See [`WindowResolution`] for an explanation about logical/physical sizes. - - #[lua(kind = "Method")] - fn height(&self) -> f32; - -"#, - r#" -/// The window's client size in logical pixels -/// See [`WindowResolution`] for an explanation about logical/physical sizes. - - #[lua(kind = "Method", output(proxy))] - fn size(&self) -> bevy::math::Vec2; - -"#, - r#" -/// The window's client area width in physical pixels. -/// See [`WindowResolution`] for an explanation about logical/physical sizes. - - #[lua(kind = "Method")] - fn physical_width(&self) -> u32; - -"#, - r#" -/// The window's client area height in physical pixels. -/// See [`WindowResolution`] for an explanation about logical/physical sizes. - - #[lua(kind = "Method")] - fn physical_height(&self) -> u32; - -"#, - r#" -/// The window's client size in physical pixels -/// See [`WindowResolution`] for an explanation about logical/physical sizes. - - #[lua(kind = "Method", output(proxy))] - fn physical_size(&self) -> bevy::math::UVec2; - -"#, - r#" -/// The window's scale factor. -/// Ratio of physical size to logical size, see [`WindowResolution`]. - - #[lua(kind = "Method")] - fn scale_factor(&self) -> f32; - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::prelude::Window; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct Window { - #[lua(output(proxy))] - cursor_options: bevy::window::CursorOptions, - #[lua(output(proxy))] - present_mode: bevy::window::PresentMode, - #[lua(output(proxy))] - mode: bevy::window::WindowMode, - #[lua(output(proxy))] - position: bevy::window::prelude::WindowPosition, - #[lua(output(proxy))] - resolution: bevy::window::WindowResolution, - title: std::string::String, - name: std::option::Option, - #[lua(output(proxy))] - composite_alpha_mode: bevy::window::CompositeAlphaMode, - #[lua(output(proxy))] - resize_constraints: bevy::window::prelude::WindowResizeConstraints, - resizable: bool, - #[lua(output(proxy))] - enabled_buttons: bevy::window::EnabledButtons, - decorations: bool, - transparent: bool, - focused: bool, - #[lua(output(proxy))] - window_level: bevy::window::WindowLevel, - canvas: std::option::Option, - fit_canvas_to_parent: bool, - prevent_default_event_handling: bool, - #[lua(output(proxy))] - internal: bevy::window::InternalWindowState, - ime_enabled: bool, - #[lua(output(proxy))] - ime_position: bevy::math::Vec2, - window_theme: ReflectedValue, - visible: bool, - skip_taskbar: bool, - desired_maximum_frame_latency: ReflectedValue, - recognize_pinch_gesture: bool, - recognize_rotation_gesture: bool, - recognize_doubletap_gesture: bool, - recognize_pan_gesture: ReflectedValue, - movable_by_window_background: bool, - fullsize_content_view: bool, - has_shadow: bool, - titlebar_shown: bool, - titlebar_transparent: bool, - titlebar_show_title: bool, - titlebar_show_buttons: bool, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::prelude::WindowMoved", - functions[r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::WindowMoved) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::prelude::WindowMoved; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct WindowMoved { - #[lua(output(proxy))] - window: bevy::ecs::entity::Entity, - #[lua(output(proxy))] - position: bevy::math::IVec2, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::prelude::WindowPosition", - functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::prelude::WindowPosition; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &window::WindowPosition) -> bool; - -"#, - r#" -/// Creates a new [`WindowPosition`] at a position. - - #[lua(kind = "Function", output(proxy))] - fn new( - #[proxy] - position: bevy::math::IVec2, - ) -> bevy::window::prelude::WindowPosition; - -"#, - r#" -/// Set the position to a specific point. - - #[lua(kind = "MutatingMethod")] - fn set(&mut self, #[proxy] position: bevy::math::IVec2) -> (); - -"#, - r#" -/// Set the window to a specific monitor. - - #[lua(kind = "MutatingMethod")] - fn center( - &mut self, - #[proxy] - monitor: bevy::window::prelude::MonitorSelection, - ) -> (); - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct WindowPosition {} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::prelude::WindowResizeConstraints", - functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::prelude::WindowResizeConstraints; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &window::WindowResizeConstraints) -> bool; - -"#, - r#" -/// Checks if the constraints are valid. -/// Will output warnings if it isn't. - - #[lua(kind = "Method", output(proxy))] - fn check_constraints(&self) -> bevy::window::prelude::WindowResizeConstraints; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct WindowResizeConstraints { - min_width: f32, - min_height: f32, - max_width: f32, - max_height: f32, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::WindowEvent", - functions[r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::WindowEvent) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowEvent; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct WindowEvent {} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::WindowResized", - functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowResized; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::WindowResized) -> bool; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct WindowResized { - #[lua(output(proxy))] - window: bevy::ecs::entity::Entity, - width: f32, - height: f32, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::WindowCreated", - functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowCreated; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::WindowCreated) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct WindowCreated { - #[lua(output(proxy))] - window: bevy::ecs::entity::Entity, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::WindowClosing", - functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowClosing; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::WindowClosing) -> bool; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct WindowClosing { - #[lua(output(proxy))] - window: bevy::ecs::entity::Entity, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::WindowClosed", - functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowClosed; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::WindowClosed) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct WindowClosed { - #[lua(output(proxy))] - window: bevy::ecs::entity::Entity, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::WindowCloseRequested", - functions[r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowCloseRequested; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::WindowCloseRequested) -> bool; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct WindowCloseRequested { - #[lua(output(proxy))] - window: bevy::ecs::entity::Entity, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::WindowDestroyed", - functions[r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::WindowDestroyed) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowDestroyed; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct WindowDestroyed { - #[lua(output(proxy))] - window: bevy::ecs::entity::Entity, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::RequestRedraw", - functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::RequestRedraw; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::RequestRedraw) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct RequestRedraw {} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::WindowFocused", - functions[r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::WindowFocused) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowFocused; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct WindowFocused { - #[lua(output(proxy))] - window: bevy::ecs::entity::Entity, - focused: bool, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::WindowOccluded", - functions[r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::WindowOccluded) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowOccluded; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct WindowOccluded { - #[lua(output(proxy))] - window: bevy::ecs::entity::Entity, - occluded: bool, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::WindowScaleFactorChanged", - functions[r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::WindowScaleFactorChanged) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowScaleFactorChanged; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct WindowScaleFactorChanged { - #[lua(output(proxy))] - window: bevy::ecs::entity::Entity, - scale_factor: f64, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::WindowBackendScaleFactorChanged", - functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowBackendScaleFactorChanged; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::WindowBackendScaleFactorChanged) -> bool; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct WindowBackendScaleFactorChanged { - #[lua(output(proxy))] - window: bevy::ecs::entity::Entity, - scale_factor: f64, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::WindowThemeChanged", - functions[r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::WindowThemeChanged) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowThemeChanged; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct WindowThemeChanged { - #[lua(output(proxy))] - window: bevy::ecs::entity::Entity, - #[lua(output(proxy))] - theme: bevy::window::WindowTheme, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::AppLifecycle", - functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::AppLifecycle; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::AppLifecycle) -> bool; - -"#, - r#" -/// Return `true` if the app can be updated. - - #[lua(kind = "Method")] - fn is_active(&self) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct AppLifecycle {} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::PrimaryWindow", - functions[r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &window::PrimaryWindow) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::PrimaryWindow; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct PrimaryWindow {} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::WindowTheme", - functions[r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &window::WindowTheme) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowTheme; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct WindowTheme {} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::Monitor", - functions[r#" -/// Returns the physical size of the monitor in pixels - - #[lua(kind = "Method", output(proxy))] - fn physical_size(&self) -> bevy::math::UVec2; - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::Monitor; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct Monitor { - name: std::option::Option, - physical_height: u32, - physical_width: u32, - #[lua(output(proxy))] - physical_position: bevy::math::IVec2, - refresh_rate_millihertz: std::option::Option, - scale_factor: f64, - video_modes: ReflectedValue, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::VideoMode", - functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::VideoMode; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct VideoMode { - #[lua(output(proxy))] - physical_size: bevy::math::UVec2, - bit_depth: u16, - refresh_rate_millihertz: u32, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::PrimaryMonitor", - functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::PrimaryMonitor; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct PrimaryMonitor {} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::SystemCursorIcon", - functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::SystemCursorIcon; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &system_cursor::SystemCursorIcon) -> bool; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct SystemCursorIcon {} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::WindowRef", - functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowRef; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct WindowRef {} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::NormalizedWindowRef", - functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::NormalizedWindowRef; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" -/// Fetch the entity of this window reference - - #[lua(kind = "Method", output(proxy))] - fn entity(&self) -> bevy::ecs::entity::Entity; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &window::NormalizedWindowRef) -> bool; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct NormalizedWindowRef(); -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::CursorOptions", - functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::CursorOptions; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct CursorOptions { - visible: bool, - #[lua(output(proxy))] - grab_mode: bevy::window::CursorGrabMode, - hit_test: bool, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::PresentMode", - functions[r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::PresentMode; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &window::PresentMode) -> bool; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct PresentMode {} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::WindowMode", - functions[r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &window::WindowMode) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowMode; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct WindowMode {} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::WindowResolution", - functions[r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowResolution; - -"#, - r#" -/// Creates a new [`WindowResolution`]. - - #[lua(kind = "Function", output(proxy))] - fn new(physical_width: f32, physical_height: f32) -> bevy::window::WindowResolution; - -"#, - r#" -/// Builder method for adding a scale factor override to the resolution. - - #[lua(kind = "Method", output(proxy))] - fn with_scale_factor_override( - self, - scale_factor_override: f32, - ) -> bevy::window::WindowResolution; - -"#, - r#" -/// The window's client area width in logical pixels. - - #[lua(kind = "Method")] - fn width(&self) -> f32; - -"#, - r#" -/// The window's client area height in logical pixels. - - #[lua(kind = "Method")] - fn height(&self) -> f32; - -"#, - r#" -/// The window's client size in logical pixels - - #[lua(kind = "Method", output(proxy))] - fn size(&self) -> bevy::math::Vec2; - -"#, - r#" -/// The window's client area width in physical pixels. - - #[lua(kind = "Method")] - fn physical_width(&self) -> u32; - -"#, - r#" -/// The window's client area height in physical pixels. - - #[lua(kind = "Method")] - fn physical_height(&self) -> u32; - -"#, - r#" -/// The window's client size in physical pixels - - #[lua(kind = "Method", output(proxy))] - fn physical_size(&self) -> bevy::math::UVec2; - -"#, - r#" -/// The ratio of physical pixels to logical pixels. -/// `physical_pixels = logical_pixels * scale_factor` - - #[lua(kind = "Method")] - fn scale_factor(&self) -> f32; - -"#, - r#" -/// The window scale factor as reported by the window backend. -/// This value is unaffected by [`WindowResolution::scale_factor_override`]. - - #[lua(kind = "Method")] - fn base_scale_factor(&self) -> f32; - -"#, - r#" -/// The scale factor set with [`WindowResolution::set_scale_factor_override`]. -/// This value may be different from the scale factor reported by the window backend. - - #[lua(kind = "Method")] - fn scale_factor_override(&self) -> std::option::Option; - -"#, - r#" -/// Set the window's logical resolution. - - #[lua(kind = "MutatingMethod")] - fn set(&mut self, width: f32, height: f32) -> (); - -"#, - r#" -/// Set the window's physical resolution. -/// This will ignore the scale factor setting, so most of the time you should -/// prefer to use [`WindowResolution::set`]. - - #[lua(kind = "MutatingMethod")] - fn set_physical_resolution(&mut self, width: u32, height: u32) -> (); - -"#, - r#" -/// Set the window's scale factor, this may get overridden by the backend. - - #[lua(kind = "MutatingMethod")] - fn set_scale_factor(&mut self, scale_factor: f32) -> (); - -"#, - r#" -/// Set the window's scale factor, and apply it to the currently known physical size. -/// This may get overridden by the backend. This is mostly useful on window creation, -/// so that the window is created with the expected size instead of waiting for a resize -/// event after its creation. - - #[lua(kind = "MutatingMethod")] - fn set_scale_factor_and_apply_to_physical_size(&mut self, scale_factor: f32) -> (); - -"#, - r#" -/// Set the window's scale factor, this will be used over what the backend decides. -/// This can change the logical and physical sizes if the resulting physical -/// size is not within the limits. - - #[lua(kind = "MutatingMethod")] - fn set_scale_factor_override( - &mut self, - scale_factor_override: std::option::Option, - ) -> (); - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &window::WindowResolution) -> bool; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct WindowResolution {} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::CompositeAlphaMode", - functions[r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &window::CompositeAlphaMode) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::CompositeAlphaMode; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct CompositeAlphaMode {} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::EnabledButtons", - functions[r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &window::EnabledButtons) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::EnabledButtons; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct EnabledButtons { - minimize: bool, - maximize: bool, - close: bool, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::WindowLevel", - functions[r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &window::WindowLevel) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowLevel; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct WindowLevel {} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::InternalWindowState", - functions[r#" -/// Consumes the current maximize request, if it exists. This should only be called by window backends. - - #[lua(kind = "MutatingMethod")] - fn take_maximize_request(&mut self) -> std::option::Option; - -"#, - r#" -/// Consumes the current minimize request, if it exists. This should only be called by window backends. - - #[lua(kind = "MutatingMethod")] - fn take_minimize_request(&mut self) -> std::option::Option; - -"#, - r#" -/// Consumes the current move request, if it exists. This should only be called by window backends. - - #[lua(kind = "MutatingMethod")] - fn take_move_request(&mut self) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::InternalWindowState; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &window::InternalWindowState) -> bool; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct InternalWindowState {} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::window::CursorGrabMode", - functions[r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &window::CursorGrabMode) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::CursorGrabMode; - -"#, - r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -struct CursorGrabMode {} -#[derive(Default)] -pub(crate) struct Globals; -impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { - fn add_instances< - 'lua, - T: bevy_mod_scripting_lua::tealr::mlu::InstanceCollector<'lua>, - >(self, instances: &mut T) -> bevy_mod_scripting_lua::tealr::mlu::mlua::Result<()> { - instances - .add_instance( - "WindowPosition", - bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::< - LuaWindowPosition, - >::new, - )?; - instances - .add_instance( - "WindowResolution", - bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::< - LuaWindowResolution, - >::new, - )?; - Ok(()) - } -} -pub struct BevyWindowAPIProvider; -impl bevy_mod_scripting_core::hosts::APIProvider for BevyWindowAPIProvider { - type APITarget = std::sync::Mutex; - type ScriptContext = std::sync::Mutex; - type DocTarget = bevy_mod_scripting_lua::docs::LuaDocFragment; - fn attach_api( - &mut self, - ctx: &mut Self::APITarget, - ) -> Result<(), bevy_mod_scripting_core::error::ScriptError> { - let ctx = ctx.get_mut().expect("Unable to acquire lock on Lua context"); - bevy_mod_scripting_lua::tealr::mlu::set_global_env(Globals, ctx) - .map_err(|e| bevy_mod_scripting_core::error::ScriptError::Other( - e.to_string(), - )) - } - fn get_doc_fragment(&self) -> Option { - Some( - bevy_mod_scripting_lua::docs::LuaDocFragment::new( - "BevyWindowAPI", - |tw| { - tw.document_global_instance::() - .expect("Something went wrong documenting globals") - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::< - bevy_mod_scripting_lua::tealr::mlu::UserDataProxy< - LuaWindowPosition, - >, - >() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::< - bevy_mod_scripting_lua::tealr::mlu::UserDataProxy< - LuaWindowResolution, - >, - >() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - .process_type::() - }, - ), - ) - } - fn setup_script( - &mut self, - script_data: &bevy_mod_scripting_core::hosts::ScriptData, - ctx: &mut Self::ScriptContext, - ) -> Result<(), bevy_mod_scripting_core::error::ScriptError> { - Ok(()) - } - fn setup_script_runtime( - &mut self, - world_ptr: bevy_mod_scripting_core::world::WorldPointer, - _script_data: &bevy_mod_scripting_core::hosts::ScriptData, - ctx: &mut Self::ScriptContext, - ) -> Result<(), bevy_mod_scripting_core::error::ScriptError> { - Ok(()) - } - fn register_with_app(&self, app: &mut bevy::app::App) { - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::< - bevy::window::prelude::WindowResizeConstraints, - >(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - app.register_foreign_lua_type::(); - } -} diff --git a/crates/bevy_script_api/src/providers/mod.rs b/crates/bevy_script_api/src/providers/mod.rs index b0ca5e66..1c5636d2 100644 --- a/crates/bevy_script_api/src/providers/mod.rs +++ b/crates/bevy_script_api/src/providers/mod.rs @@ -2,7 +2,6 @@ #![allow(clippy::all)] #![allow(unused, deprecated, dead_code)] #![cfg_attr(rustfmt, rustfmt_skip)] -pub mod bevy_a11y; pub mod bevy_ecs; pub mod bevy_transform; pub mod bevy_math; @@ -10,7 +9,6 @@ pub mod bevy_input; pub mod bevy_core; pub mod bevy_time; pub mod bevy_hierarchy; -pub mod bevy_window; pub mod bevy_reflect; extern crate self as bevy_script_api; use bevy_mod_scripting_core::docs::DocFragment; @@ -23,7 +21,6 @@ impl bevy_mod_scripting_core::hosts::APIProvider for LuaBevyAPIProvider { &mut self, ctx: &mut Self::APITarget, ) -> Result<(), bevy_mod_scripting_core::error::ScriptError> { - bevy_a11y::BevyA11YAPIProvider.attach_api(ctx)?; bevy_ecs::BevyEcsAPIProvider.attach_api(ctx)?; bevy_transform::BevyTransformAPIProvider.attach_api(ctx)?; bevy_math::BevyMathAPIProvider.attach_api(ctx)?; @@ -31,13 +28,11 @@ impl bevy_mod_scripting_core::hosts::APIProvider for LuaBevyAPIProvider { bevy_core::BevyCoreAPIProvider.attach_api(ctx)?; bevy_time::BevyTimeAPIProvider.attach_api(ctx)?; bevy_hierarchy::BevyHierarchyAPIProvider.attach_api(ctx)?; - bevy_window::BevyWindowAPIProvider.attach_api(ctx)?; bevy_reflect::BevyReflectAPIProvider.attach_api(ctx)?; Ok(()) } fn get_doc_fragment(&self) -> Option { [ - bevy_a11y::BevyA11YAPIProvider.get_doc_fragment(), bevy_ecs::BevyEcsAPIProvider.get_doc_fragment(), bevy_transform::BevyTransformAPIProvider.get_doc_fragment(), bevy_math::BevyMathAPIProvider.get_doc_fragment(), @@ -45,7 +40,6 @@ impl bevy_mod_scripting_core::hosts::APIProvider for LuaBevyAPIProvider { bevy_core::BevyCoreAPIProvider.get_doc_fragment(), bevy_time::BevyTimeAPIProvider.get_doc_fragment(), bevy_hierarchy::BevyHierarchyAPIProvider.get_doc_fragment(), - bevy_window::BevyWindowAPIProvider.get_doc_fragment(), bevy_reflect::BevyReflectAPIProvider.get_doc_fragment(), ] .into_iter() @@ -74,7 +68,6 @@ impl bevy_mod_scripting_core::hosts::APIProvider for LuaBevyAPIProvider { Ok(()) } fn register_with_app(&self, app: &mut bevy::app::App) { - bevy_a11y::BevyA11YAPIProvider.register_with_app(app); bevy_ecs::BevyEcsAPIProvider.register_with_app(app); bevy_transform::BevyTransformAPIProvider.register_with_app(app); bevy_math::BevyMathAPIProvider.register_with_app(app); @@ -82,7 +75,6 @@ impl bevy_mod_scripting_core::hosts::APIProvider for LuaBevyAPIProvider { bevy_core::BevyCoreAPIProvider.register_with_app(app); bevy_time::BevyTimeAPIProvider.register_with_app(app); bevy_hierarchy::BevyHierarchyAPIProvider.register_with_app(app); - bevy_window::BevyWindowAPIProvider.register_with_app(app); bevy_reflect::BevyReflectAPIProvider.register_with_app(app); } } diff --git a/crates/macro_tests/Cargo.toml b/crates/macro_tests/Cargo.toml index 89eb194c..d8b651d3 100644 --- a/crates/macro_tests/Cargo.toml +++ b/crates/macro_tests/Cargo.toml @@ -15,7 +15,7 @@ debug = false [dev-dependencies] trybuild = "1.0" -bevy = { version = "0.15.0-rc.3", default-features = false } +bevy = { version = "0.15.0", default-features = false } bevy_mod_scripting = { path = "../../", features = [ "lua", "lua_script_api", diff --git a/examples/lua/game_of_life.rs b/examples/lua/game_of_life.rs index 1048e0b7..994d80d9 100644 --- a/examples/lua/game_of_life.rs +++ b/examples/lua/game_of_life.rs @@ -3,12 +3,12 @@ use std::sync::Mutex; use bevy::{ diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}, + image::ImageSampler, prelude::*, reflect::Reflect, render::{ render_asset::RenderAssetUsages, render_resource::{Extent3d, TextureDimension, TextureFormat}, - texture::ImageSampler, }, window::{PrimaryWindow, WindowResized}, }; diff --git a/examples/rhai/game_of_life.rs b/examples/rhai/game_of_life.rs index a7a5eff9..6ed07482 100644 --- a/examples/rhai/game_of_life.rs +++ b/examples/rhai/game_of_life.rs @@ -1,11 +1,11 @@ use bevy::{ diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}, + image::ImageSampler, prelude::*, reflect::Reflect, render::{ render_asset::RenderAssetUsages, render_resource::{Extent3d, TextureDimension, TextureFormat}, - texture::ImageSampler, }, window::{PrimaryWindow, WindowResized}, }; diff --git a/makefile b/makefile index fdd2efe8..5fc3883b 100644 --- a/makefile +++ b/makefile @@ -22,14 +22,14 @@ TEST_NAME= # # valgrind outputs a callgrind.out.. We can analyze this with kcachegrind # kcachegrind NIGHTLY_VERSION=nightly-2024-11-05 -BEVY_VERSION=0.15.0-rc.3 +BEVY_VERSION=0.15.0 GLAM_VERSION=0.29.0 CODEGEN_PATH=${PWD}/target/codegen BEVY_PATH=${CODEGEN_PATH}/bevy GLAM_PATH=${CODEGEN_PATH}/glam OUTPUT_PATH=${CODEGEN_PATH}/output GENERATED_SRC_PATH=./crates/bevy_script_api/src/providers -GEN_BEVY_FEATURES=bevy_asset,bevy_gltf,bevy_animation,bevy_core_pipeline,bevy_ui,bevy_pbr,bevy_render,bevy_text,bevy_sprite,file_watcher,multi_threaded +GEN_BEVY_FEATURES=bevy_asset,bevy_animation,bevy_core_pipeline,bevy_ui,bevy_pbr,bevy_render,bevy_text,bevy_sprite,file_watcher,multi_threaded build_test_in_package: @cargo test --no-run --lib --workspace $(TEST_NAME)