From 3fee82e5ed198373c94f28ee4025a7cec217c94f Mon Sep 17 00:00:00 2001 From: Maksymilian Mozolewski Date: Mon, 8 Apr 2024 14:44:31 +0100 Subject: [PATCH] Make generated wrappers publically accessible (#114) --- crates/bevy_api_gen/templates/item.tera | 2 +- crates/bevy_api_gen/templates/mod.tera | 2 +- crates/bevy_script_api/src/lib.rs | 4 +- .../src/providers/bevy_core.rs | 2 +- .../bevy_script_api/src/providers/bevy_ecs.rs | 102 +- .../src/providers/bevy_hierarchy.rs | 18 +- .../src/providers/bevy_input.rs | 466 +- .../src/providers/bevy_reflect.rs | 5582 ++++++++--------- .../src/providers/bevy_time.rs | 52 +- .../src/providers/bevy_transform.rs | 120 +- .../src/providers/bevy_window.rs | 496 +- crates/bevy_script_api/src/providers/mod.rs | 16 +- 12 files changed, 3431 insertions(+), 3431 deletions(-) diff --git a/crates/bevy_api_gen/templates/item.tera b/crates/bevy_api_gen/templates/item.tera index f40dfaac..3a8a8bfa 100644 --- a/crates/bevy_api_gen/templates/item.tera +++ b/crates/bevy_api_gen/templates/item.tera @@ -76,7 +76,7 @@ functions[ {% set close_item = "}" %} {% endif %} -pub struct {{ item.ident -}} {{ open_item }} +struct {{ item.ident -}} {{ open_item }} {% if not item.is_enum %} {% for field in item.variants[0].fields %} {% if field.reflection_strategy != "Filtered" %} diff --git a/crates/bevy_api_gen/templates/mod.tera b/crates/bevy_api_gen/templates/mod.tera index 95dd89ce..186b98ac 100644 --- a/crates/bevy_api_gen/templates/mod.tera +++ b/crates/bevy_api_gen/templates/mod.tera @@ -4,7 +4,7 @@ #![cfg_attr(rustfmt, rustfmt_skip)] {% filter prettyplease %} {%- for crate in crates %} - pub(crate) mod {{ crate.name }}; + pub mod {{ crate.name }}; {% endfor -%} {% if args.self_is_bevy_script_api %} diff --git a/crates/bevy_script_api/src/lib.rs b/crates/bevy_script_api/src/lib.rs index eee50f03..ca79c6d1 100644 --- a/crates/bevy_script_api/src/lib.rs +++ b/crates/bevy_script_api/src/lib.rs @@ -9,10 +9,10 @@ pub mod rhai; pub mod common; #[cfg(feature = "lua")] -pub(crate) mod core_providers; +pub mod core_providers; // for now providers do not support any other lang so just remove this whole module if they are not needed #[cfg(feature = "lua")] -pub(crate) mod providers; +pub mod providers; pub mod script_ref; pub mod sub_reflect; diff --git a/crates/bevy_script_api/src/providers/bevy_core.rs b/crates/bevy_script_api/src/providers/bevy_core.rs index 2b74a658..f205ff73 100644 --- a/crates/bevy_script_api/src/providers/bevy_core.rs +++ b/crates/bevy_script_api/src/providers/bevy_core.rs @@ -36,7 +36,7 @@ fn index(&self) -> String { } "#] )] -pub struct Name {} +struct Name {} #[derive(Default)] pub(crate) struct Globals; impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { diff --git a/crates/bevy_script_api/src/providers/bevy_ecs.rs b/crates/bevy_script_api/src/providers/bevy_ecs.rs index 4e188b17..a05a4b0a 100644 --- a/crates/bevy_script_api/src/providers/bevy_ecs.rs +++ b/crates/bevy_script_api/src/providers/bevy_ecs.rs @@ -12,6 +12,23 @@ use bevy_script_api::{ derive(clone), remote = "bevy::ecs::entity::Entity", functions[r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &entity::Entity) -> bool; + +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::ecs::entity::Entity; + +"#, + r#" /// Creates a new entity ID with the specified `index` and a generation of 1. /// # Note /// Spawning a specific `entity` value is __rarely the right choice__. Most apps should favor @@ -64,23 +81,6 @@ use bevy_script_api::{ #[lua(kind = "Method")] fn generation(self) -> u32; -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &entity::Entity) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::ecs::entity::Entity; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -89,18 +89,12 @@ fn index(&self) -> String { } "#] )] -pub struct Entity {} +struct Entity {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::ecs::component::ComponentId", functions[r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - 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. @@ -118,8 +112,8 @@ pub struct Entity {} "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::ecs::component::ComponentId; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -132,6 +126,12 @@ pub struct Entity {} )] fn eq(&self, #[proxy] other: &component::ComponentId) -> bool; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::ecs::component::ComponentId; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -140,20 +140,21 @@ fn index(&self) -> String { } "#] )] -pub struct ComponentId(); +struct ComponentId(); #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::ecs::component::Tick", functions[r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &component::Tick) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::ecs::component::Tick; + +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -193,14 +194,13 @@ pub struct ComponentId(); "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::ecs::component::Tick; - -"#, - 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: &component::Tick) -> bool; "#, r#" @@ -210,12 +210,18 @@ fn index(&self) -> String { } "#] )] -pub struct Tick {} +struct Tick {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( 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. #[lua(kind = "Method")] @@ -271,12 +277,6 @@ pub 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")] @@ -285,7 +285,7 @@ fn index(&self) -> String { } "#] )] -pub struct ComponentTicks {} +struct ComponentTicks {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -297,7 +297,7 @@ pub struct ComponentTicks {} "#] )] -pub struct EntityHash {} +struct EntityHash {} #[derive(Default)] pub(crate) struct Globals; impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { diff --git a/crates/bevy_script_api/src/providers/bevy_hierarchy.rs b/crates/bevy_script_api/src/providers/bevy_hierarchy.rs index ad20f27d..e064a5cc 100644 --- a/crates/bevy_script_api/src/providers/bevy_hierarchy.rs +++ b/crates/bevy_script_api/src/providers/bevy_hierarchy.rs @@ -27,12 +27,19 @@ fn index(&self) -> String { } "#] )] -pub struct Children(); +struct Children(); #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(), remote = "bevy::hierarchy::prelude::Parent", functions[r#" +/// Gets the [`Entity`] ID of the parent. + + #[lua(kind = "Method", output(proxy))] + fn get(&self) -> bevy::ecs::entity::Entity; + +"#, + r#" #[lua( as_trait = "std::cmp::PartialEq", @@ -48,13 +55,6 @@ pub struct Children(); #[lua(as_trait = "std::cmp::Eq", kind = "Method")] fn assert_receiver_is_total_eq(&self) -> (); -"#, - r#" -/// Gets the [`Entity`] ID of the parent. - - #[lua(kind = "Method", output(proxy))] - fn get(&self) -> bevy::ecs::entity::Entity; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -63,7 +63,7 @@ fn index(&self) -> String { } "#] )] -pub struct Parent(); +struct Parent(); #[derive(Default)] pub(crate) struct Globals; impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { diff --git a/crates/bevy_script_api/src/providers/bevy_input.rs b/crates/bevy_script_api/src/providers/bevy_input.rs index 30c24657..14f70d41 100644 --- a/crates/bevy_script_api/src/providers/bevy_input.rs +++ b/crates/bevy_script_api/src/providers/bevy_input.rs @@ -13,12 +13,6 @@ use bevy_script_api::{ derive(clone), remote = "bevy::input::gamepad::Gamepad", functions[r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" /// Creates a new [`Gamepad`]. #[lua(kind = "Function", output(proxy))] @@ -27,8 +21,8 @@ use bevy_script_api::{ "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::Gamepad; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -41,6 +35,12 @@ use bevy_script_api::{ )] fn eq(&self, #[proxy] other: &gamepad::Gamepad) -> bool; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gamepad::Gamepad; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -49,7 +49,7 @@ fn index(&self) -> String { } "#] )] -pub struct Gamepad { +struct Gamepad { id: usize, } #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] @@ -57,30 +57,15 @@ pub struct Gamepad { derive(clone), remote = "bevy::input::gamepad::GamepadAxis", functions[r#" -/// Creates a new [`GamepadAxis`]. -/// # Examples -/// ``` -/// # use bevy_input::gamepad::{GamepadAxis, GamepadAxisType, Gamepad}; -/// # -/// let gamepad_axis = GamepadAxis::new( -/// Gamepad::new(1), -/// GamepadAxisType::LeftStickX, -/// ); -/// ``` - #[lua(kind = "Function", output(proxy))] - fn new( - #[proxy] - gamepad: bevy::input::gamepad::Gamepad, - #[proxy] - axis_type: bevy::input::gamepad::GamepadAxisType, - ) -> bevy::input::gamepad::GamepadAxis; + #[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::gamepad::GamepadAxis; "#, r#" @@ -95,9 +80,24 @@ pub struct Gamepad { "#, r#" +/// Creates a new [`GamepadAxis`]. +/// # Examples +/// ``` +/// # use bevy_input::gamepad::{GamepadAxis, GamepadAxisType, Gamepad}; +/// # +/// let gamepad_axis = GamepadAxis::new( +/// Gamepad::new(1), +/// GamepadAxisType::LeftStickX, +/// ); +/// ``` - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::GamepadAxis; + #[lua(kind = "Function", output(proxy))] + fn new( + #[proxy] + gamepad: bevy::input::gamepad::Gamepad, + #[proxy] + axis_type: bevy::input::gamepad::GamepadAxisType, + ) -> bevy::input::gamepad::GamepadAxis; "#, r#" @@ -107,7 +107,7 @@ fn index(&self) -> String { } "#] )] -pub struct GamepadAxis { +struct GamepadAxis { #[lua(output(proxy))] gamepad: bevy::input::gamepad::Gamepad, #[lua(output(proxy))] @@ -147,7 +147,7 @@ fn index(&self) -> String { } "#] )] -pub struct GamepadAxisType {} +struct GamepadAxisType {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -162,6 +162,18 @@ pub struct GamepadAxisType {} )] fn eq(&self, #[proxy] other: &gamepad::GamepadButton) -> bool; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gamepad::GamepadButton; + +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#, r#" /// Creates a new [`GamepadButton`]. @@ -183,18 +195,6 @@ pub struct GamepadAxisType {} button_type: bevy::input::gamepad::GamepadButtonType, ) -> bevy::input::gamepad::GamepadButton; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::GamepadButton; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -203,7 +203,7 @@ fn index(&self) -> String { } "#] )] -pub struct GamepadButton { +struct GamepadButton { #[lua(output(proxy))] gamepad: bevy::input::gamepad::Gamepad, #[lua(output(proxy))] @@ -243,7 +243,7 @@ fn index(&self) -> String { } "#] )] -pub struct GamepadButtonType {} +struct GamepadButtonType {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -253,12 +253,6 @@ pub struct GamepadButtonType {} #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::input::keyboard::KeyCode; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" @@ -270,6 +264,12 @@ pub struct GamepadButtonType {} )] fn eq(&self, #[proxy] other: &keyboard::KeyCode) -> bool; +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -278,15 +278,20 @@ fn index(&self) -> String { } "#] )] -pub struct KeyCode {} +struct KeyCode {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::input::mouse::MouseButton", 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: &mouse::MouseButton) -> bool; "#, r#" @@ -297,13 +302,8 @@ pub struct KeyCode {} "#, r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &mouse::MouseButton) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -313,7 +313,7 @@ fn index(&self) -> String { } "#] )] -pub struct MouseButton {} +struct MouseButton {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -342,7 +342,7 @@ fn index(&self) -> String { } "#] )] -pub struct TouchInput { +struct TouchInput { #[lua(output(proxy))] phase: bevy::input::touch::TouchPhase, #[lua(output(proxy))] @@ -358,6 +358,12 @@ pub struct TouchInput { remote = "bevy::input::keyboard::Key", 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", @@ -372,12 +378,6 @@ pub struct TouchInput { #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::input::keyboard::Key; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -386,15 +386,20 @@ fn index(&self) -> String { } "#] )] -pub struct Key {} +struct Key {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::input::keyboard::KeyboardInput", 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::KeyboardInput) -> bool; "#, r#" @@ -405,13 +410,8 @@ pub struct Key {} "#, r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &keyboard::KeyboardInput) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -421,7 +421,7 @@ fn index(&self) -> String { } "#] )] -pub struct KeyboardInput { +struct KeyboardInput { #[lua(output(proxy))] key_code: bevy::input::keyboard::KeyCode, #[lua(output(proxy))] @@ -437,14 +437,14 @@ pub struct KeyboardInput { remote = "bevy::input::keyboard::NativeKey", 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::input::keyboard::NativeKey; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::keyboard::NativeKey; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -465,7 +465,7 @@ fn index(&self) -> String { } "#] )] -pub struct NativeKey {} +struct NativeKey {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -500,13 +500,19 @@ fn index(&self) -> String { } "#] )] -pub struct NativeKeyCode {} +struct NativeKeyCode {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::input::mouse::MouseButtonInput", functions[r#" + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::mouse::MouseButtonInput; + +"#, + r#" + #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -521,12 +527,6 @@ pub struct NativeKeyCode {} #[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#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -535,7 +535,7 @@ fn index(&self) -> String { } "#] )] -pub struct MouseButtonInput { +struct MouseButtonInput { #[lua(output(proxy))] button: bevy::input::mouse::MouseButton, #[lua(output(proxy))] @@ -571,7 +571,7 @@ fn index(&self) -> String { } "#] )] -pub struct MouseMotion { +struct MouseMotion { #[lua(output(proxy))] delta: bevy::math::Vec2, } @@ -581,12 +581,6 @@ pub struct MouseMotion { remote = "bevy::input::mouse::MouseScrollUnit", 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", @@ -601,6 +595,12 @@ pub struct MouseMotion { #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::input::mouse::MouseScrollUnit; +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -609,13 +609,19 @@ fn index(&self) -> String { } "#] )] -pub struct MouseScrollUnit {} +struct MouseScrollUnit {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::input::mouse::MouseWheel", functions[r#" + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::mouse::MouseWheel; + +"#, + r#" + #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -624,12 +630,6 @@ pub struct MouseScrollUnit {} )] fn eq(&self, #[proxy] other: &mouse::MouseWheel) -> bool; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::mouse::MouseWheel; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -638,7 +638,7 @@ fn index(&self) -> String { } "#] )] -pub struct MouseWheel { +struct MouseWheel { #[lua(output(proxy))] unit: bevy::input::mouse::MouseScrollUnit, x: f32, @@ -652,6 +652,12 @@ pub struct MouseWheel { remote = "bevy::input::touch::ForceTouch", functions[r#" + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::touch::ForceTouch; + +"#, + r#" + #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -660,12 +666,6 @@ pub struct MouseWheel { )] fn eq(&self, #[proxy] other: &touch::ForceTouch) -> bool; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::touch::ForceTouch; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -674,7 +674,7 @@ fn index(&self) -> String { } "#] )] -pub struct ForceTouch {} +struct ForceTouch {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -692,14 +692,14 @@ pub struct ForceTouch {} "#, 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::touch::TouchPhase; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::touch::TouchPhase; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -709,19 +709,13 @@ fn index(&self) -> String { } "#] )] -pub struct TouchPhase {} +struct TouchPhase {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::input::touchpad::TouchpadMagnify", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::touchpad::TouchpadMagnify; - -"#, - r#" - #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -730,6 +724,12 @@ pub struct TouchPhase {} )] fn eq(&self, #[proxy] other: &touchpad::TouchpadMagnify) -> bool; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::touchpad::TouchpadMagnify; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -738,7 +738,7 @@ fn index(&self) -> String { } "#] )] -pub struct TouchpadMagnify(f32); +struct TouchpadMagnify(f32); #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -767,12 +767,29 @@ fn index(&self) -> String { } "#] )] -pub struct TouchpadRotate(f32); +struct TouchpadRotate(f32); #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::input::gamepad::AxisSettings", functions[r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &gamepad::AxisSettings) -> bool; + +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gamepad::AxisSettings; + +"#, + r#" /// Get the value above which inputs will be rounded up to 1.0. #[lua(kind = "Method")] @@ -875,23 +892,6 @@ pub struct TouchpadRotate(f32); 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::AxisSettings; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &gamepad::AxisSettings) -> bool; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -900,7 +900,7 @@ fn index(&self) -> String { } "#] )] -pub struct AxisSettings {} +struct AxisSettings {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -931,7 +931,7 @@ fn index(&self) -> String { } "#] )] -pub struct ButtonAxisSettings { +struct ButtonAxisSettings { high: f32, low: f32, threshold: f32, @@ -941,6 +941,12 @@ pub struct ButtonAxisSettings { derive(clone), remote = "bevy::input::gamepad::ButtonSettings", functions[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. /// A button is considered pressed if the `value` passed is greater than or equal to the press threshold. @@ -987,12 +993,6 @@ pub struct ButtonAxisSettings { #[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")] @@ -1001,13 +1001,24 @@ fn index(&self) -> String { } "#] )] -pub struct ButtonSettings {} +struct ButtonSettings {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::input::gamepad::GamepadAxisChangedEvent", functions[r#" + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + 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; @@ -1024,17 +1035,6 @@ pub struct ButtonSettings {} value: f32, ) -> bevy::input::gamepad::GamepadAxisChangedEvent; -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &gamepad::GamepadAxisChangedEvent) -> bool; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -1043,7 +1043,7 @@ fn index(&self) -> String { } "#] )] -pub struct GamepadAxisChangedEvent { +struct GamepadAxisChangedEvent { #[lua(output(proxy))] gamepad: bevy::input::gamepad::Gamepad, #[lua(output(proxy))] @@ -1055,16 +1055,9 @@ pub struct GamepadAxisChangedEvent { derive(clone), remote = "bevy::input::gamepad::GamepadButtonChangedEvent", functions[r#" -/// Creates a [`GamepadButtonChangedEvent`]. - #[lua(kind = "Function", output(proxy))] - fn new( - #[proxy] - gamepad: bevy::input::gamepad::Gamepad, - #[proxy] - button_type: bevy::input::gamepad::GamepadButtonType, - value: f32, - ) -> bevy::input::gamepad::GamepadButtonChangedEvent; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gamepad::GamepadButtonChangedEvent; "#, r#" @@ -1079,9 +1072,16 @@ pub struct GamepadAxisChangedEvent { "#, r#" +/// Creates a [`GamepadButtonChangedEvent`]. - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::GamepadButtonChangedEvent; + #[lua(kind = "Function", output(proxy))] + fn new( + #[proxy] + gamepad: bevy::input::gamepad::Gamepad, + #[proxy] + button_type: bevy::input::gamepad::GamepadButtonType, + value: f32, + ) -> bevy::input::gamepad::GamepadButtonChangedEvent; "#, r#" @@ -1091,7 +1091,7 @@ fn index(&self) -> String { } "#] )] -pub struct GamepadButtonChangedEvent { +struct GamepadButtonChangedEvent { #[lua(output(proxy))] gamepad: bevy::input::gamepad::Gamepad, #[lua(output(proxy))] @@ -1104,12 +1104,6 @@ pub struct GamepadButtonChangedEvent { remote = "bevy::input::gamepad::GamepadButtonInput", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::GamepadButtonInput; - -"#, - r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] fn assert_receiver_is_total_eq(&self) -> (); @@ -1124,6 +1118,12 @@ pub struct GamepadButtonChangedEvent { )] fn eq(&self, #[proxy] other: &gamepad::GamepadButtonInput) -> bool; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gamepad::GamepadButtonInput; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -1132,7 +1132,7 @@ fn index(&self) -> String { } "#] )] -pub struct GamepadButtonInput { +struct GamepadButtonInput { #[lua(output(proxy))] button: bevy::input::gamepad::GamepadButton, #[lua(output(proxy))] @@ -1166,12 +1166,23 @@ fn index(&self) -> String { } "#] )] -pub struct GamepadConnection {} +struct GamepadConnection {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::input::gamepad::GamepadConnectionEvent", functions[r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &gamepad::GamepadConnectionEvent) -> bool; + +"#, + r#" /// Creates a [`GamepadConnectionEvent`]. #[lua(kind = "Function", output(proxy))] @@ -1202,17 +1213,6 @@ pub struct GamepadConnection {} #[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", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &gamepad::GamepadConnectionEvent) -> bool; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -1221,7 +1221,7 @@ fn index(&self) -> String { } "#] )] -pub struct GamepadConnectionEvent { +struct GamepadConnectionEvent { #[lua(output(proxy))] gamepad: bevy::input::gamepad::Gamepad, #[lua(output(proxy))] @@ -1233,12 +1233,6 @@ pub struct GamepadConnectionEvent { remote = "bevy::input::gamepad::GamepadEvent", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::GamepadEvent; - -"#, - r#" - #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -1247,6 +1241,12 @@ pub struct GamepadConnectionEvent { )] fn eq(&self, #[proxy] other: &gamepad::GamepadEvent) -> bool; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gamepad::GamepadEvent; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -1255,7 +1255,7 @@ fn index(&self) -> String { } "#] )] -pub struct GamepadEvent {} +struct GamepadEvent {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(), @@ -1267,7 +1267,7 @@ fn index(&self) -> String { } "#] )] -pub struct GamepadSettings { +struct GamepadSettings { #[lua(output(proxy))] default_button_settings: bevy::input::gamepad::ButtonSettings, #[lua(output(proxy))] @@ -1283,6 +1283,19 @@ pub struct GamepadSettings { derive(clone), remote = "bevy::input::ButtonState", functions[r#" +/// Is this button pressed? + + #[lua(kind = "Method")] + fn is_pressed(&self) -> bool; + +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + +"#, + r#" #[lua( as_trait = "std::cmp::PartialEq", @@ -1298,19 +1311,6 @@ pub struct GamepadSettings { #[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(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -1319,32 +1319,32 @@ fn index(&self) -> String { } "#] )] -pub struct ButtonState {} +struct ButtonState {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::input::gamepad::GamepadInfo", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::GamepadInfo; + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &gamepad::GamepadInfo) -> bool; "#, 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::gamepad::GamepadInfo; "#, r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &gamepad::GamepadInfo) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -1354,7 +1354,7 @@ fn index(&self) -> String { } "#] )] -pub struct GamepadInfo { +struct GamepadInfo { name: std::string::String, } #[derive(Default)] diff --git a/crates/bevy_script_api/src/providers/bevy_reflect.rs b/crates/bevy_script_api/src/providers/bevy_reflect.rs index bd5f61d0..2af5976c 100644 --- a/crates/bevy_script_api/src/providers/bevy_reflect.rs +++ b/crates/bevy_script_api/src/providers/bevy_reflect.rs @@ -500,7 +500,7 @@ fn index(&self) -> String { } "#] )] -pub struct Duration {} +struct Duration {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -667,7 +667,7 @@ fn index(&self) -> String { } "#] )] -pub struct Instant(); +struct Instant(); #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -994,7 +994,7 @@ fn index(&self) -> String { } "#] )] -pub struct NonZeroI128(); +struct NonZeroI128(); #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -1321,7 +1321,7 @@ fn index(&self) -> String { } "#] )] -pub struct NonZeroI16(); +struct NonZeroI16(); #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -1648,7 +1648,7 @@ fn index(&self) -> String { } "#] )] -pub struct NonZeroI32(); +struct NonZeroI32(); #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -1975,7 +1975,7 @@ fn index(&self) -> String { } "#] )] -pub struct NonZeroI64(); +struct NonZeroI64(); #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -2298,7 +2298,7 @@ fn index(&self) -> String { } "#] )] -pub struct NonZeroI8(); +struct NonZeroI8(); #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -2503,7 +2503,7 @@ fn index(&self) -> String { } "#] )] -pub struct NonZeroU128(); +struct NonZeroU128(); #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -2708,7 +2708,7 @@ fn index(&self) -> String { } "#] )] -pub struct NonZeroU16(); +struct NonZeroU16(); #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -2913,7 +2913,7 @@ fn index(&self) -> String { } "#] )] -pub struct NonZeroU32(); +struct NonZeroU32(); #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -3118,7 +3118,7 @@ fn index(&self) -> String { } "#] )] -pub struct NonZeroU64(); +struct NonZeroU64(); #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -3319,7 +3319,7 @@ fn index(&self) -> String { } "#] )] -pub struct NonZeroU8(); +struct NonZeroU8(); #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -3524,7 +3524,7 @@ fn index(&self) -> String { } "#] )] -pub struct NonZeroUsize(); +struct NonZeroUsize(); #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -3663,7 +3663,7 @@ fn index(&self) -> String { } "#] )] -pub struct PathBuf {} +struct PathBuf {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -3702,7 +3702,7 @@ fn index(&self) -> String { } "#] )] -pub struct RangeFull {} +struct RangeFull {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -3710,12 +3710,11 @@ pub struct RangeFull {} functions[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::Quat) -> bool; + fn clone(&self) -> bevy::math::Quat; "#, r#" @@ -3731,105 +3730,6 @@ pub struct RangeFull {} )] fn sub(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::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::Vec3A) -> bevy::math::Vec3A; - -"#, - 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", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::Quat) -> bevy::math::Quat; - -"#, - 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 -/// two quaternions! That corresponds to multiplication. - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: bevy::math::Quat) -> bevy::math::Quat; - -"#, - 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: 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#" -/// 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::Vec3) -> bevy::math::Vec3; - "#, r#" /// Creates a new rotation quaternion. @@ -4207,19 +4107,24 @@ pub struct RangeFull {} "#, 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 +/// two quaternions! That corresponds to multiplication. #[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::Quat; + fn add(self, #[proxy] rhs: bevy::math::Quat) -> bevy::math::Quat; "#, r#" -/// Rotates the [`Direction3d`] using a [`Quat`]. +/// Multiplies a quaternion by a scalar value. +/// The product is not guaranteed to be normalized. #[lua( as_trait = "std::ops::Mul", @@ -4228,26 +4133,24 @@ pub struct RangeFull {} composite = "mul", metamethod = "Mul", )] - fn mul( - self, - #[proxy] - direction: bevy::math::primitives::Direction3d, - ) -> bevy::math::primitives::Direction3d; + fn mul(self, rhs: f32) -> bevy::math::Quat; "#, r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{}", _self) -} -"#] -)] -pub struct Quat(); -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::math::Vec3", - functions[r#" + + #[lua( + as_trait = "std::ops::Neg", + kind = "MetaFunction", + output(proxy), + composite = "neg", + metamethod = "Unm", + )] + fn neg(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", @@ -4256,7 +4159,7 @@ pub struct Quat(); composite = "div", metamethod = "Div", )] - fn div(self, #[proxy] rhs: bevy::math::Vec3) -> bevy::math::Vec3; + fn div(self, rhs: f32) -> bevy::math::Quat; "#, r#" @@ -4268,19 +4171,22 @@ pub struct Quat(); composite = "mul", metamethod = "Mul", )] - fn mul(self, rhs: f32) -> bevy::math::Vec3; + fn mul(self, #[proxy] rhs: bevy::math::Vec3A) -> bevy::math::Vec3A; "#, 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::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::Vec3) -> bevy::math::Vec3; + fn mul(self, #[proxy] rhs: bevy::math::Vec3) -> bevy::math::Vec3; "#, r#" @@ -4291,32 +4197,57 @@ pub struct Quat(); composite = "eq", metamethod = "Eq", )] - fn eq(&self, #[proxy] other: &glam::Vec3) -> bool; + fn eq(&self, #[proxy] rhs: &glam::Quat) -> bool; "#, 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::Sub", + as_trait = "std::ops::Mul", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "mul", + metamethod = "Mul", )] - fn sub(self, rhs: f32) -> bevy::math::Vec3; + fn mul(self, #[proxy] rhs: bevy::math::Quat) -> bevy::math::Quat; "#, r#" +/// Rotates the [`Direction3d`] using a [`Quat`]. #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", + as_trait = "std::ops::Mul", + kind = "MetaFunction", output(proxy), + composite = "mul", + metamethod = "Mul", )] - fn clone(&self) -> bevy::math::Vec3; + fn mul( + self, + #[proxy] + direction: bevy::math::primitives::Direction3d, + ) -> bevy::math::primitives::Direction3d; "#, r#" +#[lua(kind="MetaMethod", metamethod="ToString")] +fn index(&self) -> String { + format!("{}", _self) +} +"#] +)] +struct Quat(); +#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] +#[proxy( + derive(clone), + remote = "bevy::math::Vec3", + functions[r#" #[lua( as_trait = "std::ops::Add", @@ -4329,98 +4260,38 @@ pub struct Quat(); "#, r#" +/// Creates a new vector. - #[lua( - as_trait = "std::ops::Neg", - kind = "MetaFunction", - output(proxy), - composite = "neg", - metamethod = "Unm", - )] - fn neg(self) -> bevy::math::Vec3; + #[lua(kind = "Function", output(proxy))] + fn new(x: f32, y: f32, z: f32) -> bevy::math::Vec3; "#, r#" +/// Creates a vector with all elements set to `v`. - #[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; + #[lua(kind = "Function", output(proxy))] + fn splat(v: f32) -> bevy::math::Vec3; "#, 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( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, #[proxy] rhs: bevy::math::Vec3) -> bevy::math::Vec3; + #[lua(kind = "Function", output(proxy))] + fn select( + #[proxy] + mask: bevy::math::BVec3, + #[proxy] + if_true: bevy::math::Vec3, + #[proxy] + if_false: bevy::math::Vec3, + ) -> bevy::math::Vec3; "#, r#" - - #[lua( - as_trait = "std::ops::Sub", - kind = "MetaFunction", - output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, #[proxy] rhs: bevy::math::Vec3) -> bevy::math::Vec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, rhs: f32) -> bevy::math::Vec3; - -"#, - r#" -/// Creates a new vector. - - #[lua(kind = "Function", output(proxy))] - fn new(x: f32, y: f32, z: f32) -> bevy::math::Vec3; - -"#, - r#" -/// Creates a vector with all elements set to `v`. - - #[lua(kind = "Function", output(proxy))] - fn splat(v: f32) -> bevy::math::Vec3; - -"#, - 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::BVec3, - #[proxy] - if_true: bevy::math::Vec3, - #[proxy] - if_false: bevy::math::Vec3, - ) -> bevy::math::Vec3; - -"#, - r#" -/// Creates a new vector from an array. +/// Creates a new vector from an array. #[lua(kind = "Function", output(proxy))] fn from_array(a: [f32; 3]) -> bevy::math::Vec3; @@ -4947,6 +4818,28 @@ pub struct Quat(); #[lua(kind = "Method", output(proxy))] fn as_u64vec3(&self) -> bevy::math::U64Vec3; +"#, + 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::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, rhs: f32) -> bevy::math::Vec3; + "#, r#" @@ -4959,6 +4852,113 @@ pub struct Quat(); )] fn div(self, rhs: f32) -> bevy::math::Vec3; +"#, + r#" + + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, #[proxy] rhs: bevy::math::Vec3) -> bevy::math::Vec3; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, rhs: f32) -> bevy::math::Vec3; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(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: 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::Vec3) -> bevy::math::Vec3; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Neg", + kind = "MetaFunction", + output(proxy), + composite = "neg", + metamethod = "Unm", + )] + fn neg(self) -> bevy::math::Vec3; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, #[proxy] rhs: bevy::math::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::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &glam::Vec3) -> bool; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -4979,7 +4979,7 @@ fn index(&mut self, lua: &Lua, idx: crate::lua::util::LuaIndex, val: f32) -> Res } "#] )] -pub struct Vec3 { +struct Vec3 { x: f32, y: f32, z: f32, @@ -4998,6 +4998,36 @@ pub struct Vec3 { )] fn eq(&self, #[proxy] other: &glam::IVec2) -> bool; +"#, + 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: bevy::math::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#" @@ -5008,19 +5038,19 @@ pub struct Vec3 { composite = "sub", metamethod = "Sub", )] - fn sub(self, #[proxy] rhs: bevy::math::IVec2) -> bevy::math::IVec2; + fn sub(self, rhs: i32) -> bevy::math::IVec2; "#, 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::IVec2) -> bevy::math::IVec2; + fn rem(self, #[proxy] rhs: bevy::math::IVec2) -> bevy::math::IVec2; "#, r#" @@ -5032,19 +5062,19 @@ pub struct Vec3 { composite = "rem", metamethod = "Mod", )] - fn rem(self, #[proxy] rhs: bevy::math::IVec2) -> bevy::math::IVec2; + fn rem(self, rhs: i32) -> bevy::math::IVec2; "#, 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::IVec2; + fn add(self, rhs: i32) -> bevy::math::IVec2; "#, r#" @@ -5056,7 +5086,7 @@ pub struct Vec3 { composite = "sub", metamethod = "Sub", )] - fn sub(self, rhs: i32) -> bevy::math::IVec2; + fn sub(self, #[proxy] rhs: bevy::math::IVec2) -> bevy::math::IVec2; "#, r#" @@ -5070,17 +5100,41 @@ pub struct Vec3 { "#, r#" -/// Creates a new vector. - #[lua(kind = "Function", output(proxy))] - fn new(x: i32, y: i32) -> bevy::math::IVec2; + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, rhs: i32) -> bevy::math::IVec2; "#, r#" -/// Creates a vector with all elements set to `v`. - #[lua(kind = "Function", output(proxy))] - fn splat(v: i32) -> bevy::math::IVec2; + #[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. + + #[lua(kind = "Function", output(proxy))] + fn new(x: i32, y: i32) -> bevy::math::IVec2; + +"#, + r#" +/// Creates a vector with all elements set to `v`. + + #[lua(kind = "Function", output(proxy))] + fn splat(v: i32) -> bevy::math::IVec2; "#, r#" @@ -5424,18 +5478,6 @@ pub struct Vec3 { #[lua(kind = "Method", output(proxy))] fn saturating_div(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, rhs: i32) -> bevy::math::IVec2; - "#, r#" @@ -5448,59 +5490,17 @@ pub struct Vec3 { )] fn add(self, #[proxy] rhs: bevy::math::IVec2) -> 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::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, rhs: i32) -> bevy::math::IVec2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(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::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::IVec2) -> bevy::math::IVec2; + fn mul(self, rhs: i32) -> bevy::math::IVec2; "#, r#" @@ -5522,7 +5522,7 @@ fn index(&mut self, lua: &Lua, idx: crate::lua::util::LuaIndex, val: i32) -> Res } "#] )] -pub struct IVec2 { +struct IVec2 { x: i32, y: i32, } @@ -5532,46 +5532,6 @@ pub struct IVec2 { remote = "bevy::math::IVec3", functions[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::IVec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - 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::Div", kind = "MetaFunction", @@ -5581,77 +5541,6 @@ pub struct IVec2 { )] 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: bevy::math::IVec3) -> bevy::math::IVec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(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#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &glam::IVec3) -> bool; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, rhs: i32) -> 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#" /// Creates a new vector. @@ -6010,88 +5899,280 @@ pub struct IVec2 { 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::IVec3; + fn add(self, #[proxy] rhs: bevy::math::IVec3) -> bevy::math::IVec3; "#, 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::IVec3; + fn sub(self, rhs: i32) -> bevy::math::IVec3; "#, 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::IVec3) -> bevy::math::IVec3; + fn add(self, rhs: i32) -> 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))? -} -"#] -)] -pub struct IVec3 { - x: i32, - y: i32, - z: i32, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::math::IVec4", - functions[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: bevy::math::IVec4) -> bevy::math::IVec4; + 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, w: i32) -> bevy::math::IVec4; + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::IVec3; "#, r#" -/// Creates a vector with all elements set to `v`. + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &glam::IVec3) -> bool; + +"#, + 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: bevy::math::IVec3) -> bevy::math::IVec3; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, rhs: i32) -> bevy::math::IVec3; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, rhs: i32) -> 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#" + + #[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::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, #[proxy] rhs: bevy::math::IVec3) -> 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 IVec3 { + x: i32, + y: i32, + z: i32, +} +#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] +#[proxy( + derive(clone), + remote = "bevy::math::IVec4", + functions[r#" + + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, #[proxy] rhs: bevy::math::IVec4) -> bevy::math::IVec4; + +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::IVec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, rhs: i32) -> bevy::math::IVec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::IVec4) -> bevy::math::IVec4; + +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &glam::IVec4) -> bool; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(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, rhs: i32) -> bevy::math::IVec4; + +"#, + r#" + + #[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. + + #[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; @@ -6415,46 +6496,12 @@ pub struct IVec3 { #[lua(kind = "Method", output(proxy))] fn saturating_div(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, rhs: i32) -> bevy::math::IVec4; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, rhs: i32) -> bevy::math::IVec4; - "#, 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::IVec4; - "#, r#" @@ -6465,7 +6512,7 @@ pub struct IVec3 { composite = "div", metamethod = "Div", )] - fn div(self, #[proxy] rhs: bevy::math::IVec4) -> bevy::math::IVec4; + fn div(self, rhs: i32) -> bevy::math::IVec4; "#, r#" @@ -6477,7 +6524,7 @@ pub struct IVec3 { composite = "sub", metamethod = "Sub", )] - fn sub(self, rhs: i32) -> bevy::math::IVec4; + fn sub(self, #[proxy] rhs: bevy::math::IVec4) -> bevy::math::IVec4; "#, r#" @@ -6491,42 +6538,6 @@ pub struct IVec3 { )] fn add(self, #[proxy] rhs: bevy::math::IVec4) -> bevy::math::IVec4; -"#, - r#" - - #[lua( - as_trait = "std::ops::Sub", - kind = "MetaFunction", - output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, #[proxy] rhs: bevy::math::IVec4) -> bevy::math::IVec4; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, rhs: i32) -> bevy::math::IVec4; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, rhs: i32) -> bevy::math::IVec4; - "#, r#" @@ -6537,30 +6548,19 @@ pub struct IVec3 { composite = "neg", metamethod = "Unm", )] - fn neg(self) -> bevy::math::IVec4; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &glam::IVec4) -> bool; + fn neg(self) -> bevy::math::IVec4; "#, 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::IVec4) -> bevy::math::IVec4; + fn mul(self, rhs: i32) -> bevy::math::IVec4; "#, r#" @@ -6582,7 +6582,7 @@ fn index(&mut self, lua: &Lua, idx: crate::lua::util::LuaIndex, val: i32) -> Res } "#] )] -pub struct IVec4 { +struct IVec4 { x: i32, y: i32, z: i32, @@ -6595,42 +6595,13 @@ pub struct IVec4 { functions[r#" #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, rhs: i64) -> bevy::math::I64Vec2; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &glam::I64Vec2) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - 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, #[proxy] rhs: bevy::math::I64Vec2) -> bevy::math::I64Vec2; "#, r#" @@ -6642,31 +6613,19 @@ pub struct IVec4 { composite = "sub", metamethod = "Sub", )] - fn sub(self, #[proxy] rhs: bevy::math::I64Vec2) -> bevy::math::I64Vec2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: bevy::math::I64Vec2) -> bevy::math::I64Vec2; + fn sub(self, rhs: i64) -> bevy::math::I64Vec2; "#, 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: i64) -> bevy::math::I64Vec2; + fn rem(self, #[proxy] rhs: bevy::math::I64Vec2) -> bevy::math::I64Vec2; "#, r#" @@ -6678,7 +6637,7 @@ pub struct IVec4 { composite = "rem", metamethod = "Mod", )] - fn rem(self, #[proxy] rhs: bevy::math::I64Vec2) -> bevy::math::I64Vec2; + fn rem(self, rhs: i64) -> bevy::math::I64Vec2; "#, r#" @@ -6690,29 +6649,7 @@ pub struct IVec4 { composite = "div", metamethod = "Div", )] - fn div(self, #[proxy] rhs: bevy::math::I64Vec2) -> bevy::math::I64Vec2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::I64Vec2) -> bevy::math::I64Vec2; - -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::I64Vec2; + fn div(self, rhs: i64) -> bevy::math::I64Vec2; "#, r#" @@ -6724,31 +6661,31 @@ pub struct IVec4 { composite = "sub", metamethod = "Sub", )] - fn sub(self, rhs: i64) -> bevy::math::I64Vec2; + fn sub(self, #[proxy] rhs: bevy::math::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, rhs: i64) -> bevy::math::I64Vec2; + fn neg(self) -> 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, rhs: i64) -> bevy::math::I64Vec2; + fn add(self, rhs: i64) -> bevy::math::I64Vec2; "#, r#" @@ -7055,95 +6992,252 @@ pub struct IVec4 { /// 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::I64Vec2) -> bevy::math::I64Vec2; + #[lua(kind = "Method", output(proxy))] + fn wrapping_sub(self, #[proxy] rhs: bevy::math::I64Vec2) -> bevy::math::I64Vec2; + +"#, + 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::I64Vec2) -> bevy::math::I64Vec2; + +"#, + 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::I64Vec2) -> bevy::math::I64Vec2; + +"#, + 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::I64Vec2) -> bevy::math::I64Vec2; + +"#, + 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::I64Vec2) -> bevy::math::I64Vec2; + +"#, + 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::I64Vec2) -> bevy::math::I64Vec2; + +"#, + 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::I64Vec2) -> bevy::math::I64Vec2; + +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &glam::I64Vec2) -> bool; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::I64Vec2) -> bevy::math::I64Vec2; + +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::I64Vec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, #[proxy] rhs: bevy::math::I64Vec2) -> bevy::math::I64Vec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, rhs: i64) -> bevy::math::I64Vec2; + +"#, + 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 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::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, rhs: i64) -> 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#" -/// 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::I64Vec2) -> bevy::math::I64Vec2; + #[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#" -/// 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::I64Vec2) -> bevy::math::I64Vec2; + #[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; "#, 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::I64Vec2) -> bevy::math::I64Vec2; + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::I64Vec3; "#, 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::I64Vec2) -> bevy::math::I64Vec2; + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, rhs: i64) -> bevy::math::I64Vec3; "#, 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::I64Vec2) -> bevy::math::I64Vec2; + #[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#" -/// 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::I64Vec2) -> bevy::math::I64Vec2; + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, rhs: i64) -> bevy::math::I64Vec3; "#, r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{}", _self) -} -"#] -)] -pub 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::Div", + as_trait = "std::ops::Neg", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "neg", + metamethod = "Unm", )] - fn div(self, #[proxy] rhs: bevy::math::I64Vec3) -> bevy::math::I64Vec3; + fn neg(self) -> 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, rhs: i64) -> bevy::math::I64Vec3; + fn add(self, rhs: i64) -> bevy::math::I64Vec3; "#, r#" @@ -7503,64 +7597,13 @@ pub struct I64Vec2 { 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::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::I64Vec3) -> bool; - -"#, - r#" - - #[lua( - 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::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: bevy::math::I64Vec3) -> bevy::math::I64Vec3; - -"#, - 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::I64Vec3; "#, r#" @@ -7578,61 +7621,18 @@ pub struct I64Vec2 { r#" #[lua( - as_trait = "std::ops::Neg", - kind = "MetaFunction", - output(proxy), - composite = "neg", - metamethod = "Unm", - )] - fn neg(self) -> 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::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::I64Vec3) -> bevy::math::I64Vec3; + fn eq(&self, #[proxy] other: &glam::I64Vec3) -> bool; "#, r#" - #[lua( - as_trait = "std::ops::Sub", - kind = "MetaFunction", - output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, rhs: i64) -> bevy::math::I64Vec3; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -7642,7 +7642,7 @@ fn index(&self) -> String { } "#] )] -pub struct I64Vec3 { +struct I64Vec3 { x: i64, y: i64, z: i64, @@ -7665,44 +7665,50 @@ pub struct 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: bevy::math::I64Vec4) -> bevy::math::I64Vec4; "#, 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::I64Vec4; + fn mul(self, rhs: i64) -> bevy::math::I64Vec4; "#, 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: i64) -> bevy::math::I64Vec4; + fn sub(self, #[proxy] rhs: bevy::math::I64Vec4) -> bevy::math::I64Vec4; "#, 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::I64Vec4) -> bevy::math::I64Vec4; + fn div(self, #[proxy] rhs: bevy::math::I64Vec4) -> bevy::math::I64Vec4; "#, r#" @@ -7715,6 +7721,18 @@ pub struct I64Vec3 { )] fn eq(&self, #[proxy] other: &glam::I64Vec4) -> bool; +"#, + r#" + + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, rhs: i64) -> bevy::math::I64Vec4; + "#, r#" @@ -7725,7 +7743,7 @@ pub struct I64Vec3 { composite = "div", metamethod = "Div", )] - fn div(self, #[proxy] rhs: bevy::math::I64Vec4) -> bevy::math::I64Vec4; + fn div(self, rhs: i64) -> bevy::math::I64Vec4; "#, r#" @@ -7749,18 +7767,6 @@ pub struct I64Vec3 { )] fn clone(&self) -> bevy::math::I64Vec4; -"#, - r#" - - #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, rhs: i64) -> bevy::math::I64Vec4; - "#, r#" @@ -7771,7 +7777,7 @@ pub struct I64Vec3 { composite = "add", metamethod = "Add", )] - fn add(self, #[proxy] rhs: bevy::math::I64Vec4) -> bevy::math::I64Vec4; + fn add(self, rhs: i64) -> bevy::math::I64Vec4; "#, r#" @@ -7783,7 +7789,7 @@ pub struct I64Vec3 { composite = "mul", metamethod = "Mul", )] - fn mul(self, rhs: i64) -> bevy::math::I64Vec4; + fn mul(self, #[proxy] rhs: bevy::math::I64Vec4) -> bevy::math::I64Vec4; "#, r#" @@ -7797,18 +7803,6 @@ pub struct I64Vec3 { )] fn neg(self) -> bevy::math::I64Vec4; -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::I64Vec4) -> bevy::math::I64Vec4; - "#, r#" /// Creates a new vector. @@ -8142,6 +8136,12 @@ pub struct I64Vec3 { #[lua(kind = "Method", output(proxy))] fn saturating_div(self, #[proxy] rhs: bevy::math::I64Vec4) -> bevy::math::I64Vec4; +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -8150,7 +8150,7 @@ fn index(&self) -> String { } "#] )] -pub struct I64Vec4 { +struct I64Vec4 { x: i64, y: i64, z: i64, @@ -8162,83 +8162,6 @@ pub struct I64Vec4 { remote = "bevy::math::UVec2", functions[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::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, rhs: u32) -> 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::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, #[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, 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; - -"#, - r#" - #[lua( as_trait = "std::ops::Sub", kind = "MetaFunction", @@ -8532,13 +8455,13 @@ pub struct I64Vec4 { 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#" @@ -8556,103 +8479,88 @@ pub struct 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: bevy::math::UVec2) -> bevy::math::UVec2; + fn add(self, rhs: u32) -> bevy::math::UVec2; + +"#, + 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::Rem", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "rem", + metamethod = "Mod", )] - fn sub(self, rhs: u32) -> bevy::math::UVec2; + fn rem(self, #[proxy] rhs: bevy::math::UVec2) -> bevy::math::UVec2; "#, 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::UVec2; + fn eq(&self, #[proxy] other: &glam::UVec2) -> bool; "#, 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: u32) -> Result<(),_> { - self.val_mut(|s| Ok(s[*idx] = val))? -} -"#] -)] -pub struct UVec2 { - x: u32, - y: u32, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::math::UVec3", - functions[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::UVec3; + fn add(self, #[proxy] rhs: bevy::math::UVec2) -> bevy::math::UVec2; "#, r#" #[lua( - as_trait = "std::cmp::PartialEq", + as_trait = "std::ops::Div", kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", + output(proxy), + composite = "div", + metamethod = "Div", )] - fn eq(&self, #[proxy] other: &glam::UVec3) -> bool; + fn div(self, #[proxy] rhs: bevy::math::UVec2) -> bevy::math::UVec2; "#, 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: bevy::math::UVec3) -> bevy::math::UVec3; + fn clone(&self) -> bevy::math::UVec2; "#, r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, rhs: u32) -> bevy::math::UVec2; "#, r#" @@ -8664,19 +8572,58 @@ pub struct UVec2 { composite = "mul", metamethod = "Mul", )] - fn mul(self, rhs: u32) -> bevy::math::UVec3; + fn mul(self, #[proxy] rhs: bevy::math::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")] +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: u32) -> Result<(),_> { + self.val_mut(|s| Ok(s[*idx] = val))? +} +"#] +)] +struct UVec2 { + x: u32, + y: u32, +} +#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] +#[proxy( + derive(clone), + remote = "bevy::math::UVec3", + functions[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::UVec3) -> bevy::math::UVec3; + fn add(self, #[proxy] rhs: bevy::math::UVec3) -> bevy::math::UVec3; "#, r#" @@ -8984,13 +8931,24 @@ pub struct UVec2 { 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::UVec3) -> bevy::math::UVec3; + fn rem(self, rhs: u32) -> bevy::math::UVec3; + +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &glam::UVec3) -> bool; "#, r#" @@ -9002,17 +8960,25 @@ pub struct UVec2 { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::UVec3) -> bevy::math::UVec3; + fn mul(self, rhs: u32) -> bevy::math::UVec3; + +"#, + 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", + as_trait = "std::ops::Sub", + kind = "MetaFunction", output(proxy), + composite = "sub", + metamethod = "Sub", )] - fn clone(&self) -> bevy::math::UVec3; + fn sub(self, #[proxy] rhs: bevy::math::UVec3) -> bevy::math::UVec3; "#, r#" @@ -9026,6 +8992,18 @@ pub struct UVec2 { )] fn add(self, rhs: u32) -> bevy::math::UVec3; +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::UVec3) -> bevy::math::UVec3; + "#, r#" @@ -9060,7 +9038,29 @@ pub 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::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, rhs: u32) -> bevy::math::UVec3; + +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::UVec3; "#, r#" @@ -9082,7 +9082,7 @@ fn index(&mut self, lua: &Lua, idx: crate::lua::util::LuaIndex, val: u32) -> Res } "#] )] -pub struct UVec3 { +struct UVec3 { x: u32, y: u32, z: u32, @@ -9093,30 +9093,6 @@ pub struct UVec3 { remote = "bevy::math::UVec4", functions[r#" - #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - 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#" - #[lua( as_trait = "std::ops::Div", kind = "MetaFunction", @@ -9126,30 +9102,6 @@ pub struct UVec3 { )] fn div(self, rhs: u32) -> bevy::math::UVec4; -"#, - r#" - - #[lua( - as_trait = "std::ops::Sub", - kind = "MetaFunction", - output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, rhs: u32) -> bevy::math::UVec4; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, #[proxy] rhs: bevy::math::UVec4) -> bevy::math::UVec4; - "#, r#" /// Creates a new vector. @@ -9435,17 +9387,24 @@ pub struct UVec3 { 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::UVec4; + fn eq(&self, #[proxy] other: &glam::UVec4) -> bool; "#, 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, rhs: u32) -> bevy::math::UVec4; "#, r#" @@ -9459,6 +9418,40 @@ pub struct UVec3 { )] fn add(self, #[proxy] rhs: bevy::math::UVec4) -> bevy::math::UVec4; +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, #[proxy] rhs: bevy::math::UVec4) -> bevy::math::UVec4; + +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::UVec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, #[proxy] rhs: bevy::math::UVec4) -> bevy::math::UVec4; + "#, r#" @@ -9475,25 +9468,31 @@ pub struct UVec3 { 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::UVec4; + fn sub(self, rhs: u32) -> bevy::math::UVec4; "#, 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::UVec4) -> bevy::math::UVec4; + fn rem(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#" @@ -9511,12 +9510,13 @@ pub struct UVec3 { 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::UVec4) -> bool; + fn rem(self, rhs: u32) -> bevy::math::UVec4; "#, r#" @@ -9538,7 +9538,7 @@ fn index(&mut self, lua: &Lua, idx: crate::lua::util::LuaIndex, val: u32) -> Res } "#] )] -pub struct UVec4 { +struct UVec4 { x: u32, y: u32, z: u32, @@ -9551,13 +9551,13 @@ pub struct UVec4 { 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, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; + fn div(self, rhs: u64) -> bevy::math::U64Vec2; "#, r#" @@ -9571,18 +9571,6 @@ pub struct UVec4 { )] fn rem(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, rhs: u64) -> bevy::math::U64Vec2; - "#, r#" @@ -9602,22 +9590,10 @@ pub struct UVec4 { 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", + composite = "add", + metamethod = "Add", )] - fn mul(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; + fn add(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; "#, r#" @@ -9629,31 +9605,29 @@ pub struct UVec4 { composite = "div", metamethod = "Div", )] - fn div(self, rhs: u64) -> bevy::math::U64Vec2; + fn div(self, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; "#, 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::U64Vec2) -> bevy::math::U64Vec2; + fn rem(self, rhs: u64) -> bevy::math::U64Vec2; "#, 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, #[proxy] rhs: bevy::math::U64Vec2) -> bevy::math::U64Vec2; + fn clone(&self) -> bevy::math::U64Vec2; "#, r#" @@ -9670,17 +9644,25 @@ pub struct UVec4 { 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::U64Vec2; + fn sub(self, rhs: u64) -> bevy::math::U64Vec2; "#, r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[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#" @@ -9692,7 +9674,25 @@ pub struct UVec4 { composite = "sub", metamethod = "Sub", )] - fn sub(self, rhs: u64) -> bevy::math::U64Vec2; + 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::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, rhs: u64) -> bevy::math::U64Vec2; "#, r#" @@ -9982,7 +9982,7 @@ fn index(&self) -> String { } "#] )] -pub struct U64Vec2 { +struct U64Vec2 { x: u64, y: u64, } @@ -9991,59 +9991,6 @@ pub struct U64Vec2 { derive(clone), remote = "bevy::math::U64Vec3", functions[r#" - - #[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; - -"#, - 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, 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: bevy::math::U64Vec3) -> bevy::math::U64Vec3; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &glam::U64Vec3) -> bool; - -"#, - r#" /// Creates a new vector. #[lua(kind = "Function", output(proxy))] @@ -10348,11 +10295,103 @@ pub struct U64Vec2 { 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::U64Vec3; + fn add(self, #[proxy] rhs: bevy::math::U64Vec3) -> bevy::math::U64Vec3; + +"#, + r#" + + #[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; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, #[proxy] rhs: bevy::math::U64Vec3) -> bevy::math::U64Vec3; + +"#, + r#" + + #[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; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, rhs: u64) -> bevy::math::U64Vec3; + +"#, + r#" + + #[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", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, rhs: u64) -> bevy::math::U64Vec3; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, rhs: u64) -> bevy::math::U64Vec3; + +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -10370,61 +10409,108 @@ pub struct U64Vec2 { r#" #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::U64Vec3; + +"#, + 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::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, #[proxy] rhs: bevy::math::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", output(proxy), - composite = "add", - metamethod = "Add", )] - fn add(self, #[proxy] rhs: bevy::math::U64Vec3) -> bevy::math::U64Vec3; + fn clone(&self) -> bevy::math::U64Vec4; "#, 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: u64) -> bevy::math::U64Vec3; + fn mul(self, #[proxy] rhs: bevy::math::U64Vec4) -> bevy::math::U64Vec4; "#, 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: bevy::math::U64Vec3) -> bevy::math::U64Vec3; + fn div(self, rhs: u64) -> bevy::math::U64Vec4; "#, 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::U64Vec3) -> bevy::math::U64Vec3; + fn sub(self, rhs: u64) -> bevy::math::U64Vec4; "#, 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: u64) -> bevy::math::U64Vec3; + fn mul(self, rhs: u64) -> bevy::math::U64Vec4; "#, r#" @@ -10436,35 +10522,19 @@ pub struct U64Vec2 { composite = "rem", metamethod = "Mod", )] - fn rem(self, rhs: u64) -> bevy::math::U64Vec3; + fn rem(self, rhs: u64) -> bevy::math::U64Vec4; "#, r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{}", _self) -} -"#] -)] -pub 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::Sub", kind = "MetaFunction", output(proxy), - composite = "div", - metamethod = "Div", + composite = "sub", + metamethod = "Sub", )] - fn div(self, #[proxy] rhs: bevy::math::U64Vec4) -> bevy::math::U64Vec4; + fn sub(self, #[proxy] rhs: bevy::math::U64Vec4) -> bevy::math::U64Vec4; "#, r#" @@ -10478,23 +10548,17 @@ pub struct U64Vec3 { )] fn rem(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::Rem", + as_trait = "std::ops::Add", kind = "MetaFunction", output(proxy), - composite = "rem", - metamethod = "Mod", + composite = "add", + metamethod = "Add", )] - fn rem(self, rhs: u64) -> bevy::math::U64Vec4; + fn add(self, #[proxy] rhs: bevy::math::U64Vec4) -> bevy::math::U64Vec4; "#, r#" @@ -10780,25 +10844,19 @@ pub struct U64Vec3 { "#, r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &glam::U64Vec4) -> bool; + #[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::cmp::PartialEq", kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "eq", + metamethod = "Eq", )] - fn mul(self, rhs: u64) -> bevy::math::U64Vec4; + fn eq(&self, #[proxy] other: &glam::U64Vec4) -> bool; "#, r#" @@ -10810,7 +10868,7 @@ pub struct U64Vec3 { composite = "div", metamethod = "Div", )] - fn div(self, rhs: u64) -> bevy::math::U64Vec4; + fn div(self, #[proxy] rhs: bevy::math::U64Vec4) -> bevy::math::U64Vec4; "#, r#" @@ -10826,13 +10884,31 @@ pub struct U64Vec3 { "#, r#" +#[lua(kind="MetaMethod", metamethod="ToString")] +fn index(&self) -> String { + format!("{}", _self) +} +"#] +)] +struct U64Vec4 { + x: u64, + y: u64, + z: u64, + w: u64, +} +#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] +#[proxy( + derive(clone), + remote = "bevy::math::Vec2", + 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::U64Vec4; + fn eq(&self, #[proxy] other: &glam::Vec2) -> bool; "#, r#" @@ -10844,7 +10920,7 @@ pub struct U64Vec3 { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::U64Vec4) -> bevy::math::U64Vec4; + fn mul(self, #[proxy] rhs: bevy::math::Vec2) -> bevy::math::Vec2; "#, r#" @@ -10856,60 +10932,29 @@ pub struct U64Vec3 { composite = "add", metamethod = "Add", )] - fn add(self, #[proxy] rhs: bevy::math::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; + fn add(self, rhs: f32) -> bevy::math::Vec2; "#, 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::U64Vec4) -> bevy::math::U64Vec4; + fn clone(&self) -> bevy::math::Vec2; "#, r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{}", _self) -} -"#] -)] -pub struct U64Vec4 { - x: u64, - y: u64, - z: u64, - w: u64, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::math::Vec2", - functions[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::Vec2) -> bevy::math::Vec2; + fn rem(self, #[proxy] rhs: bevy::math::Vec2) -> bevy::math::Vec2; "#, r#" @@ -10927,47 +10972,49 @@ pub struct U64Vec4 { 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: f32) -> bevy::math::Vec2; + fn add(self, #[proxy] rhs: bevy::math::Vec2) -> bevy::math::Vec2; "#, 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::Vec2; + fn div(self, #[proxy] rhs: bevy::math::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, rhs: f32) -> bevy::math::Vec2; + fn mul(self, rhs: f32) -> bevy::math::Vec2; "#, 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::Vec2; + fn div(self, rhs: f32) -> bevy::math::Vec2; "#, r#" @@ -10985,37 +11032,25 @@ pub struct U64Vec4 { r#" #[lua( - as_trait = "std::ops::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, #[proxy] rhs: bevy::math::Vec2) -> bevy::math::Vec2; - -"#, - 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::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::Vec2; + fn rem(self, rhs: f32) -> bevy::math::Vec2; "#, r#" @@ -11561,63 +11596,28 @@ pub struct U64Vec4 { /// 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#" -/// Casts all elements of `self` to `u64`. - - #[lua(kind = "Method", output(proxy))] - fn as_u64vec2(&self) -> bevy::math::U64Vec2; + fn as_ivec2(&self) -> bevy::math::IVec2; "#, r#" +/// Casts all elements of `self` to `u32`. - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: bevy::math::Vec2) -> bevy::math::Vec2; + #[lua(kind = "Method", output(proxy))] + fn as_uvec2(&self) -> bevy::math::UVec2; "#, 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, rhs: f32) -> bevy::math::Vec2; + #[lua(kind = "Method", output(proxy))] + fn as_i64vec2(&self) -> bevy::math::I64Vec2; "#, r#" +/// Casts all elements of `self` to `u64`. - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &glam::Vec2) -> bool; + #[lua(kind = "Method", output(proxy))] + fn as_u64vec2(&self) -> bevy::math::U64Vec2; "#, r#" @@ -11639,7 +11639,7 @@ fn index(&mut self, lua: &Lua, idx: crate::lua::util::LuaIndex, val: f32) -> Res } "#] )] -pub struct Vec2 { +struct Vec2 { x: f32, y: f32, } @@ -11649,42 +11649,6 @@ pub struct Vec2 { remote = "bevy::math::Vec3A", functions[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::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::Vec3A) -> 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::Add", kind = "MetaFunction", @@ -11698,36 +11662,13 @@ pub struct Vec2 { 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::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] rhs: &glam::Vec3A) -> 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, rhs: f32) -> bevy::math::Vec3A; + fn mul(self, rhs: f32) -> bevy::math::Vec3A; "#, r#" @@ -12301,25 +12242,25 @@ pub struct Vec2 { 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::Vec3A; + fn div(self, #[proxy] rhs: bevy::math::Vec3A) -> bevy::math::Vec3A; "#, 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, rhs: f32) -> bevy::math::Vec3A; + fn div(self, rhs: f32) -> bevy::math::Vec3A; "#, r#" @@ -12335,25 +12276,24 @@ pub struct Vec2 { r#" #[lua( - as_trait = "std::ops::Neg", + as_trait = "std::cmp::PartialEq", kind = "MetaFunction", - output(proxy), - composite = "neg", - metamethod = "Unm", + composite = "eq", + metamethod = "Eq", )] - fn neg(self) -> bevy::math::Vec3A; + fn eq(&self, #[proxy] rhs: &glam::Vec3A) -> bool; "#, 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::Vec3A; + fn sub(self, #[proxy] rhs: bevy::math::Vec3A) -> bevy::math::Vec3A; "#, r#" @@ -12369,39 +12309,15 @@ pub struct Vec2 { "#, 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: f32) -> Result<(),_> { - self.val_mut(|s| Ok(s[*idx] = val))? -} -"#] -)] -pub struct Vec3A(); -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::math::Vec4", - functions[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, rhs: f32) -> bevy::math::Vec3A; "#, r#" @@ -12413,28 +12329,19 @@ pub struct Vec3A(); composite = "add", metamethod = "Add", )] - fn add(self, #[proxy] rhs: bevy::math::Vec4) -> bevy::math::Vec4; - -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::Vec4; + fn add(self, rhs: f32) -> bevy::math::Vec3A; "#, 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] rhs: &glam::Vec4) -> bool; + fn sub(self, rhs: f32) -> bevy::math::Vec3A; "#, r#" @@ -12446,91 +12353,100 @@ pub struct Vec3A(); composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::Vec4) -> bevy::math::Vec4; + fn mul(self, #[proxy] rhs: bevy::math::Vec3A) -> bevy::math::Vec3A; "#, 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, rhs: f32) -> bevy::math::Vec4; + fn neg(self) -> 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::Vec4) -> bevy::math::Vec4; - +#[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: f32) -> Result<(),_> { + self.val_mut(|s| Ok(s[*idx] = val))? +} +"#] +)] +struct Vec3A(); +#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] +#[proxy( + derive(clone), + remote = "bevy::math::Vec4", + functions[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: f32) -> bevy::math::Vec4; + fn eq(&self, #[proxy] rhs: &glam::Vec4) -> bool; "#, 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::Vec4; + fn clone(&self) -> 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, rhs: f32) -> bevy::math::Vec4; + fn add(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, rhs: f32) -> bevy::math::Vec4; + fn mul(self, rhs: f32) -> bevy::math::Vec4; "#, 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::Vec4) -> bevy::math::Vec4; + fn neg(self) -> bevy::math::Vec4; "#, r#" @@ -13051,6 +12967,66 @@ pub struct Vec3A(); #[lua(kind = "Method", output(proxy))] fn as_u64vec4(&self) -> bevy::math::U64Vec4; +"#, + r#" + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, #[proxy] rhs: bevy::math::Vec4) -> bevy::math::Vec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, rhs: f32) -> bevy::math::Vec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, rhs: f32) -> bevy::math::Vec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, rhs: f32) -> bevy::math::Vec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, #[proxy] rhs: bevy::math::Vec4) -> bevy::math::Vec4; + "#, r#" @@ -13061,7 +13037,31 @@ pub struct Vec3A(); composite = "mul", metamethod = "Mul", )] - fn mul(self, rhs: f32) -> bevy::math::Vec4; + fn mul(self, #[proxy] rhs: bevy::math::Vec4) -> bevy::math::Vec4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, rhs: f32) -> bevy::math::Vec4; + +"#, + 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#" @@ -13083,15 +13083,20 @@ fn index(&mut self, lua: &Lua, idx: crate::lua::util::LuaIndex, val: f32) -> Res } "#] )] -pub struct Vec4(); +struct Vec4(); #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::math::BVec2", 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: &glam::BVec2) -> bool; "#, r#" @@ -13149,13 +13154,8 @@ pub struct Vec4(); "#, r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &glam::BVec2) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -13175,7 +13175,7 @@ fn index(&self) -> String { } "#] )] -pub struct BVec2 { +struct BVec2 { x: bool, y: bool, } @@ -13193,6 +13193,22 @@ pub struct BVec2 { )] fn eq(&self, #[proxy] other: &glam::BVec3) -> bool; +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::BVec3; + +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#, r#" /// Creates a new vector mask. @@ -13246,22 +13262,6 @@ pub struct BVec2 { #[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 = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::BVec3; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -13270,7 +13270,7 @@ fn index(&self) -> String { } "#] )] -pub struct BVec3 { +struct BVec3 { x: bool, y: bool, z: bool, @@ -13280,16 +13280,6 @@ pub struct BVec3 { derive(clone), remote = "bevy::math::BVec4", functions[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. #[lua(kind = "Function", output(proxy))] @@ -13341,12 +13331,6 @@ pub struct BVec3 { #[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#" @@ -13358,6 +13342,22 @@ pub 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#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -13366,7 +13366,7 @@ fn index(&self) -> String { } "#] )] -pub struct BVec4 { +struct BVec4 { x: bool, y: bool, z: bool, @@ -13378,6 +13378,42 @@ pub struct BVec4 { remote = "bevy::math::DVec2", functions[r#" + #[lua( + as_trait = "std::ops::Div", + kind = "MetaFunction", + output(proxy), + composite = "div", + metamethod = "Div", + )] + fn div(self, rhs: f64) -> bevy::math::DVec2; + +"#, + 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::Rem", + kind = "MetaFunction", + output(proxy), + composite = "rem", + metamethod = "Mod", + )] + fn rem(self, #[proxy] rhs: bevy::math::DVec2) -> bevy::math::DVec2; + +"#, + r#" + #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -13390,13 +13426,13 @@ pub struct BVec4 { 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: f64) -> bevy::math::DVec2; + fn rem(self, rhs: f64) -> bevy::math::DVec2; "#, r#" @@ -13973,29 +14009,75 @@ pub struct BVec4 { "#, r#" -/// Casts all elements of `self` to `i64`. +/// Casts all elements of `self` to `i64`. + + #[lua(kind = "Method", output(proxy))] + fn as_i64vec2(&self) -> bevy::math::I64Vec2; + +"#, + r#" +/// Casts all elements of `self` to `u64`. + + #[lua(kind = "Method", output(proxy))] + fn as_u64vec2(&self) -> bevy::math::U64Vec2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Neg", + kind = "MetaFunction", + output(proxy), + composite = "neg", + metamethod = "Unm", + )] + fn neg(self) -> bevy::math::DVec2; + +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::DVec2; + +"#, + r#" - #[lua(kind = "Method", output(proxy))] - fn as_i64vec2(&self) -> bevy::math::I64Vec2; + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, rhs: f64) -> bevy::math::DVec2; "#, r#" -/// Casts all elements of `self` to `u64`. - #[lua(kind = "Method", output(proxy))] - fn as_u64vec2(&self) -> bevy::math::U64Vec2; + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, #[proxy] rhs: bevy::math::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, rhs: f64) -> bevy::math::DVec2; "#, r#" @@ -14019,7 +14101,46 @@ pub struct BVec4 { composite = "div", metamethod = "Div", )] - fn div(self, rhs: f64) -> bevy::math::DVec2; + fn div(self, #[proxy] rhs: bevy::math::DVec2) -> bevy::math::DVec2; + +"#, + 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 DVec2 { + x: f64, + y: f64, +} +#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] +#[proxy( + derive(clone), + remote = "bevy::math::DVec3", + functions[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#" @@ -14031,7 +14152,7 @@ pub struct BVec4 { composite = "div", metamethod = "Div", )] - fn div(self, #[proxy] rhs: bevy::math::DVec2) -> bevy::math::DVec2; + fn div(self, rhs: f64) -> bevy::math::DVec3; "#, r#" @@ -14043,53 +14164,66 @@ pub struct BVec4 { composite = "add", metamethod = "Add", )] - fn add(self, #[proxy] rhs: bevy::math::DVec2) -> bevy::math::DVec2; + fn add(self, #[proxy] rhs: bevy::math::DVec3) -> bevy::math::DVec3; "#, r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &glam::DVec3) -> bool; + +"#, + r#" + + #[lua( + 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::DVec3; "#, 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::DVec3; "#, 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, #[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::DVec2; + fn sub(self, rhs: f64) -> bevy::math::DVec3; "#, r#" @@ -14101,46 +14235,29 @@ pub struct BVec4 { composite = "rem", metamethod = "Mod", )] - fn rem(self, #[proxy] rhs: bevy::math::DVec2) -> bevy::math::DVec2; + fn rem(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]) -} + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::DVec3; + "#, 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))? -} -"#] -)] -pub struct DVec2 { - x: f64, - y: f64, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::math::DVec3", - functions[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: bevy::math::DVec3) -> bevy::math::DVec3; + fn neg(self) -> bevy::math::DVec3; "#, r#" @@ -14657,182 +14774,65 @@ pub struct DVec2 { "#, r#" -/// Returns some vector that is orthogonal to the given one. -/// The input vector must be finite and non-zero. -/// The output vector is not necessarily unit length. For that use -/// [`Self::any_orthonormal_vector()`] instead. - - #[lua(kind = "Method", output(proxy))] - fn any_orthogonal_vector(&self) -> bevy::math::DVec3; - -"#, - r#" -/// Returns any unit vector that is orthogonal to the given one. -/// The input vector must be unit length. -/// # Panics -/// Will panic if `self` is not normalized when `glam_assert` is enabled. - - #[lua(kind = "Method", output(proxy))] - fn any_orthonormal_vector(&self) -> bevy::math::DVec3; - -"#, - r#" -/// Casts all elements of `self` to `f32`. - - #[lua(kind = "Method", output(proxy))] - fn as_vec3(&self) -> bevy::math::Vec3; - -"#, - 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 = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::DVec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, #[proxy] rhs: bevy::math::DVec3) -> bevy::math::DVec3; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Neg", - kind = "MetaFunction", - output(proxy), - composite = "neg", - metamethod = "Unm", - )] - fn neg(self) -> bevy::math::DVec3; +/// Returns some vector that is orthogonal to the given one. +/// The input vector must be finite and non-zero. +/// The output vector is not necessarily unit length. For that use +/// [`Self::any_orthonormal_vector()`] instead. + + #[lua(kind = "Method", output(proxy))] + fn any_orthogonal_vector(&self) -> bevy::math::DVec3; "#, r#" +/// Returns any unit vector that is orthogonal to the given one. +/// The input vector must be unit length. +/// # Panics +/// Will panic if `self` is not normalized when `glam_assert` is enabled. - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &glam::DVec3) -> bool; + #[lua(kind = "Method", output(proxy))] + fn any_orthonormal_vector(&self) -> bevy::math::DVec3; "#, r#" +/// Casts all elements of `self` to `f32`. - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, rhs: f64) -> bevy::math::DVec3; + #[lua(kind = "Method", output(proxy))] + fn as_vec3(&self) -> bevy::math::Vec3; "#, r#" +/// Casts all elements of `self` to `f32`. - #[lua( - as_trait = "std::ops::Div", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, rhs: f64) -> bevy::math::DVec3; + #[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::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, rhs: f64) -> bevy::math::DVec3; + #[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::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, rhs: f64) -> bevy::math::DVec3; + #[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::Sub", - kind = "MetaFunction", - output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, rhs: f64) -> bevy::math::DVec3; + #[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::Rem", - kind = "MetaFunction", - output(proxy), - composite = "rem", - metamethod = "Mod", - )] - fn rem(self, #[proxy] rhs: bevy::math::DVec3) -> bevy::math::DVec3; + #[lua(kind = "Method", output(proxy))] + fn as_u64vec3(&self) -> bevy::math::U64Vec3; "#, r#" @@ -14850,13 +14850,13 @@ pub struct DVec2 { 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::DVec3) -> bevy::math::DVec3; + fn div(self, #[proxy] rhs: bevy::math::DVec3) -> bevy::math::DVec3; "#, r#" @@ -14878,7 +14878,7 @@ fn index(&mut self, lua: &Lua, idx: crate::lua::util::LuaIndex, val: f64) -> Res } "#] )] -pub struct DVec3 { +struct DVec3 { x: f64, y: f64, z: f64, @@ -14890,37 +14890,23 @@ pub struct DVec3 { functions[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::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::DVec4) -> bevy::math::DVec4; + fn mul(self, #[proxy] rhs: bevy::math::DVec4) -> bevy::math::DVec4; "#, 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: f64) -> bevy::math::DVec4; + fn clone(&self) -> bevy::math::DVec4; "#, r#" @@ -14932,42 +14918,19 @@ pub struct DVec3 { composite = "rem", metamethod = "Mod", )] - fn rem(self, rhs: f64) -> 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; + fn rem(self, #[proxy] rhs: bevy::math::DVec4) -> bevy::math::DVec4; "#, 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::DVec4) -> bevy::math::DVec4; + fn add(self, #[proxy] rhs: bevy::math::DVec4) -> bevy::math::DVec4; "#, r#" @@ -15511,37 +15474,61 @@ pub struct DVec3 { 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: f64) -> bevy::math::DVec4; + fn rem(self, rhs: f64) -> bevy::math::DVec4; "#, 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::DVec4) -> bevy::math::DVec4; + fn div(self, #[proxy] rhs: bevy::math::DVec4) -> bevy::math::DVec4; "#, 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::DVec4) -> bevy::math::DVec4; + fn sub(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#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, rhs: f64) -> bevy::math::DVec4; "#, r#" @@ -15553,17 +15540,30 @@ pub struct DVec3 { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::DVec4) -> bevy::math::DVec4; + fn mul(self, rhs: f64) -> bevy::math::DVec4; "#, r#" #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", + 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::Add", + kind = "MetaFunction", output(proxy), + composite = "add", + metamethod = "Add", )] - fn clone(&self) -> bevy::math::DVec4; + fn add(self, rhs: f64) -> bevy::math::DVec4; "#, r#" @@ -15585,7 +15585,7 @@ fn index(&mut self, lua: &Lua, idx: crate::lua::util::LuaIndex, val: f64) -> Res } "#] )] -pub struct DVec4 { +struct DVec4 { x: f64, y: f64, z: f64, @@ -15596,30 +15596,6 @@ pub struct DVec4 { derive(clone), remote = "bevy::math::Mat2", functions[r#" - - #[lua( - as_trait = "std::ops::Neg", - kind = "MetaFunction", - output(proxy), - composite = "neg", - metamethod = "Unm", - )] - fn neg(self) -> bevy::math::Mat2; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: bevy::math::Mat2) -> bevy::math::Mat2; - -"#, - r#" /// Creates a 2x2 matrix from two column vectors. #[lua(kind = "Function", output(proxy))] @@ -15801,13 +15777,23 @@ pub struct DVec4 { r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::Mat2; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Neg", kind = "MetaFunction", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "neg", + metamethod = "Unm", )] - fn sub(self, #[proxy] rhs: bevy::math::Mat2) -> bevy::math::Mat2; + fn neg(self) -> bevy::math::Mat2; "#, r#" @@ -15845,6 +15831,18 @@ pub struct DVec4 { )] fn mul(self, #[proxy] rhs: bevy::math::Vec2) -> bevy::math::Vec2; +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, #[proxy] rhs: bevy::math::Mat2) -> bevy::math::Mat2; + "#, r#" @@ -15860,11 +15858,13 @@ pub struct DVec4 { 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::Mat2; + fn add(self, #[proxy] rhs: bevy::math::Mat2) -> bevy::math::Mat2; "#, r#" @@ -15898,7 +15898,7 @@ fn index(&self, ctx : &Lua, idx: crate::lua::util::LuaIndex) -> Result bevy::math::Vec3A; + fn neg(self) -> bevy::math::Mat3; "#, r#" #[lua( - as_trait = "std::cmp::PartialEq", + as_trait = "std::ops::Sub", kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] rhs: &glam::Mat3) -> 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::Mat3; + fn sub(self, #[proxy] rhs: bevy::math::Mat3) -> bevy::math::Mat3; "#, r#" @@ -15945,7 +15936,7 @@ pub struct Mat2(); composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::Affine2) -> bevy::math::Mat3; + fn mul(self, #[proxy] rhs: bevy::math::Vec3) -> bevy::math::Vec3; "#, r#" @@ -15957,67 +15948,64 @@ pub struct Mat2(); composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::Vec3) -> bevy::math::Vec3; + fn mul(self, #[proxy] rhs: bevy::math::Affine2) -> bevy::math::Mat3; "#, 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::Mat3) -> bevy::math::Mat3; + fn mul(self, rhs: f32) -> bevy::math::Mat3; "#, 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::Mat3) -> bevy::math::Mat3; + fn eq(&self, #[proxy] rhs: &glam::Mat3) -> bool; "#, 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: f32) -> bevy::math::Mat3; + fn add(self, #[proxy] rhs: bevy::math::Mat3) -> bevy::math::Mat3; "#, 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; + fn clone(&self) -> bevy::math::Mat3; "#, 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::Mat3; + fn mul(self, #[proxy] rhs: bevy::math::Mat3) -> bevy::math::Mat3; "#, r#" @@ -16312,6 +16300,18 @@ pub struct Mat2(); #[lua(kind = "Method", output(proxy))] fn as_dmat3(&self) -> 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::Vec3A) -> bevy::math::Vec3A; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -16344,7 +16344,7 @@ fn index(&self, ctx : &Lua, idx: crate::lua::util::LuaIndex) -> Result bevy::math::DMat3; -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, rhs: f32) -> 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::Vec3A) -> 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::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#" @@ -16733,13 +16674,13 @@ pub struct Mat3 { 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::Mat3A; + fn mul(self, #[proxy] rhs: bevy::math::Mat3A) -> bevy::math::Mat3A; "#, r#" @@ -16751,7 +16692,7 @@ pub struct Mat3 { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::Mat3A) -> bevy::math::Mat3A; + fn mul(self, #[proxy] rhs: bevy::math::Affine2) -> bevy::math::Mat3A; "#, r#" @@ -16763,53 +16704,10 @@ pub struct Mat3 { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::Affine2) -> bevy::math::Mat3A; + fn mul(self, #[proxy] rhs: bevy::math::Vec3A) -> bevy::math::Vec3A; "#, r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{}", _self) -} -"#, - r#" -#[lua(kind = "MetaMethod", raw, metamethod="Index")] -fn index(&self, ctx : &Lua, idx: crate::lua::util::LuaIndex) -> Result { - Ok(LuaVec3A::new_ref( - self.reflect_ref(ctx.get_world()?).sub_ref(bevy_script_api::ReflectionPathElement::SubReflection{ - label:"col", - get: std::sync::Arc::new(|ref_| Err(bevy_script_api::error::ReflectionError::InsufficientProvenance{ - path: "".to_owned(), - msg: "Cannot get column of matrix with immutable reference".to_owned() - })), - get_mut: std::sync::Arc::new(move |ref_| { - if ref_.is::(){ - Ok(ref_.downcast_mut::() - .unwrap() - .col_mut(*idx)) - } else { - Err(bevy_script_api::error::ReflectionError::CannotDowncast{from: ref_.get_represented_type_info().unwrap().type_path().into(), to:"Mat3".into()}) - } - }) - }) - ) - ) -} -"#] -)] -pub struct Mat3A { - #[lua(output(proxy))] - x_axis: bevy::math::Vec3A, - #[lua(output(proxy))] - y_axis: bevy::math::Vec3A, - #[lua(output(proxy))] - z_axis: bevy::math::Vec3A, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::math::Mat4", - functions[r#" #[lua( as_trait = "std::ops::Add", @@ -16818,7 +16716,7 @@ pub struct Mat3A { composite = "add", metamethod = "Add", )] - fn add(self, #[proxy] rhs: bevy::math::Mat4) -> bevy::math::Mat4; + fn add(self, #[proxy] rhs: bevy::math::Mat3A) -> bevy::math::Mat3A; "#, r#" @@ -16830,7 +16728,7 @@ pub struct Mat3A { composite = "mul", metamethod = "Mul", )] - fn mul(self, rhs: f32) -> bevy::math::Mat4; + fn mul(self, rhs: f32) -> bevy::math::Mat3A; "#, r#" @@ -16842,17 +16740,7 @@ pub struct Mat3A { composite = "neg", metamethod = "Unm", )] - fn neg(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::Mat4; + fn neg(self) -> bevy::math::Mat3A; "#, r#" @@ -16860,23 +16748,11 @@ pub struct Mat3A { #[lua( as_trait = "std::ops::Sub", kind = "MetaFunction", - output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, #[proxy] rhs: bevy::math::Mat4) -> bevy::math::Mat4; - -"#, - r#" - - #[lua( - as_trait = "std::ops::Mul", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", + output(proxy), + composite = "sub", + metamethod = "Sub", )] - fn mul(self, #[proxy] rhs: bevy::math::Vec4) -> bevy::math::Vec4; + fn sub(self, #[proxy] rhs: bevy::math::Mat3A) -> bevy::math::Mat3A; "#, r#" @@ -16887,10 +16763,53 @@ pub struct Mat3A { composite = "eq", metamethod = "Eq", )] - fn eq(&self, #[proxy] rhs: &glam::Mat4) -> bool; + fn eq(&self, #[proxy] rhs: &glam::Mat3A) -> bool; "#, r#" +#[lua(kind="MetaMethod", metamethod="ToString")] +fn index(&self) -> String { + format!("{}", _self) +} +"#, + r#" +#[lua(kind = "MetaMethod", raw, metamethod="Index")] +fn index(&self, ctx : &Lua, idx: crate::lua::util::LuaIndex) -> Result { + Ok(LuaVec3A::new_ref( + self.reflect_ref(ctx.get_world()?).sub_ref(bevy_script_api::ReflectionPathElement::SubReflection{ + label:"col", + get: std::sync::Arc::new(|ref_| Err(bevy_script_api::error::ReflectionError::InsufficientProvenance{ + path: "".to_owned(), + msg: "Cannot get column of matrix with immutable reference".to_owned() + })), + get_mut: std::sync::Arc::new(move |ref_| { + if ref_.is::(){ + Ok(ref_.downcast_mut::() + .unwrap() + .col_mut(*idx)) + } else { + Err(bevy_script_api::error::ReflectionError::CannotDowncast{from: ref_.get_represented_type_info().unwrap().type_path().into(), to:"Mat3".into()}) + } + }) + }) + ) + ) +} +"#] +)] +struct Mat3A { + #[lua(output(proxy))] + x_axis: bevy::math::Vec3A, + #[lua(output(proxy))] + y_axis: bevy::math::Vec3A, + #[lua(output(proxy))] + z_axis: bevy::math::Vec3A, +} +#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] +#[proxy( + derive(clone), + remote = "bevy::math::Mat4", + functions[r#" #[lua( as_trait = "std::ops::Mul", @@ -16899,7 +16818,7 @@ pub struct Mat3A { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::Mat4) -> bevy::math::Mat4; + fn mul(self, #[proxy] rhs: bevy::math::Vec4) -> bevy::math::Vec4; "#, r#" @@ -17454,6 +17373,65 @@ pub struct Mat3A { #[lua(kind = "Method", output(proxy))] fn as_dmat4(&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::Mat4) -> bevy::math::Mat4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, #[proxy] rhs: bevy::math::Mat4) -> bevy::math::Mat4; + +"#, + 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::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, rhs: f32) -> bevy::math::Mat4; + +"#, + 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#" @@ -17466,6 +17444,28 @@ pub struct Mat3A { )] fn mul(self, #[proxy] rhs: bevy::math::Affine3A) -> bevy::math::Mat4; +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::Mat4; + +"#, + r#" + + #[lua( + as_trait = "std::ops::Neg", + kind = "MetaFunction", + output(proxy), + composite = "neg", + metamethod = "Unm", + )] + fn neg(self) -> bevy::math::Mat4; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -17498,7 +17498,7 @@ fn index(&self, ctx : &Lua, idx: crate::lua::util::LuaIndex) -> Result 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::ops::Neg", - kind = "MetaFunction", - output(proxy), - composite = "neg", - metamethod = "Unm", - )] - fn neg(self) -> bevy::math::DMat2; - -"#, - r#" /// Creates a 2x2 matrix from two column vectors. #[lua(kind = "Function", output(proxy))] @@ -17741,6 +17707,27 @@ pub struct Mat4 { )] fn mul(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#" @@ -17757,12 +17744,13 @@ pub struct Mat4 { 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] rhs: &glam::DMat2) -> bool; + fn neg(self) -> bevy::math::DMat2; "#, r#" @@ -17776,6 +17764,18 @@ pub struct Mat4 { )] fn mul(self, rhs: f64) -> bevy::math::DMat2; +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "MetaFunction", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, #[proxy] rhs: bevy::math::DMat2) -> bevy::math::DMat2; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -17808,7 +17808,7 @@ fn index(&self, ctx : &Lua, idx: crate::lua::util::LuaIndex) -> Result bevy::math::DMat3; + +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> 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( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(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::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#" /// Creates a 3x3 matrix from three column vectors. #[lua(kind = "Function", output(proxy))] @@ -18107,64 +18176,6 @@ pub struct DMat2 { #[lua(kind = "Method", output(proxy))] fn as_mat3(&self) -> bevy::math::Mat3; -"#, - r#" - - #[lua( - as_trait = "std::ops::Neg", - kind = "MetaFunction", - output(proxy), - composite = "neg", - metamethod = "Unm", - )] - fn neg(self) -> 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( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(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::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::DMat3; - "#, r#" @@ -18201,17 +18212,6 @@ pub struct DMat2 { )] fn mul(self, #[proxy] rhs: bevy::math::DMat3) -> bevy::math::DMat3; -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] rhs: &glam::DMat3) -> bool; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -18244,7 +18244,7 @@ fn index(&self, ctx : &Lua, idx: crate::lua::util::LuaIndex) -> Result bevy::math::DMat4; + fn eq(&self, #[proxy] rhs: &glam::DMat4) -> bool; "#, 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::DMat4) -> bevy::math::DMat4; + fn mul(self, rhs: f64) -> bevy::math::DMat4; "#, 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::DMat4) -> bool; + fn mul(self, #[proxy] rhs: bevy::math::DMat4) -> bevy::math::DMat4; "#, 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: bevy::math::DMat4) -> bevy::math::DMat4; + fn neg(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#" #[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, #[proxy] rhs: bevy::math::DMat4) -> bevy::math::DMat4; + fn clone(&self) -> bevy::math::DMat4; "#, r#" @@ -18873,23 +18871,25 @@ pub struct DMat3 { r#" #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", + as_trait = "std::ops::Mul", + kind = "MetaFunction", output(proxy), + composite = "mul", + metamethod = "Mul", )] - fn clone(&self) -> bevy::math::DMat4; + fn mul(self, #[proxy] rhs: bevy::math::DAffine3) -> bevy::math::DMat4; "#, 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::DMat4; + fn sub(self, #[proxy] rhs: bevy::math::DMat4) -> bevy::math::DMat4; "#, r#" @@ -18923,7 +18923,7 @@ fn index(&self, ctx : &Lua, idx: crate::lua::util::LuaIndex) -> Result 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::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::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::Affine2) -> bevy::math::Affine2; - -"#, - r#" /// Creates an affine transform from three column vectors. #[lua(kind = "Function", output(proxy))] @@ -19152,16 +19095,73 @@ pub struct DMat4 { /// 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::Affine2, max_abs_diff: f32) -> bool; + #[lua(kind = "Method")] + fn abs_diff_eq(&self, #[proxy] rhs: bevy::math::Affine2, max_abs_diff: f32) -> 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::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::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::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] rhs: &glam::Affine2) -> bool; + +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::Affine2; "#, 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::Affine2; + #[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#" @@ -19171,7 +19171,7 @@ fn index(&self) -> String { } "#] )] -pub struct Affine2 { +struct Affine2 { #[lua(output(proxy))] matrix2: bevy::math::Mat2, #[lua(output(proxy))] @@ -19471,46 +19471,46 @@ pub 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#" #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", + as_trait = "std::ops::Mul", + kind = "MetaFunction", output(proxy), + composite = "mul", + metamethod = "Mul", )] - fn clone(&self) -> bevy::math::Affine3A; + fn mul(self, #[proxy] rhs: bevy::math::Affine3A) -> bevy::math::Affine3A; "#, 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, #[proxy] rhs: bevy::math::Affine3A) -> bevy::math::Affine3A; + fn clone(&self) -> bevy::math::Affine3A; "#, 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::Mat4) -> bevy::math::Mat4; + fn eq(&self, #[proxy] rhs: &glam::Affine3A) -> bool; "#, r#" @@ -19520,7 +19520,7 @@ fn index(&self) -> String { } "#] )] -pub struct Affine3A { +struct Affine3A { #[lua(output(proxy))] matrix3: bevy::math::Mat3A, #[lua(output(proxy))] @@ -19531,6 +19531,51 @@ pub struct Affine3A { derive(clone), remote = "bevy::math::DAffine2", functions[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::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 = "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#" /// Creates an affine transform from three column vectors. #[lua(kind = "Function", output(proxy))] @@ -19692,51 +19737,6 @@ pub struct Affine3A { #[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::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::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::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] rhs: &glam::DAffine2) -> bool; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -19745,7 +19745,7 @@ fn index(&self) -> String { } "#] )] -pub struct DAffine2 { +struct DAffine2 { #[lua(output(proxy))] matrix2: bevy::math::DMat2, #[lua(output(proxy))] @@ -19766,6 +19766,27 @@ pub struct DAffine2 { )] 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( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] rhs: &glam::DAffine3) -> bool; + "#, r#" /// Creates an affine transform from three column vectors. @@ -20026,19 +20047,124 @@ pub struct DAffine2 { /// 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::DAffine3, max_abs_diff: f64) -> bool; + #[lua(kind = "Method")] + fn abs_diff_eq(&self, #[proxy] rhs: bevy::math::DAffine3, 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::DAffine3; + +"#, + 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(kind="MetaMethod", metamethod="ToString")] +fn index(&self) -> String { + format!("{}", _self) +} +"#] +)] +struct DAffine3 { + #[lua(output(proxy))] + matrix3: bevy::math::DMat3, + #[lua(output(proxy))] + translation: bevy::math::DVec3, +} +#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] +#[proxy( + derive(clone), + remote = "bevy::math::DQuat", + functions[r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] rhs: &glam::DQuat) -> bool; + +"#, + 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; + +"#, + 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#" +/// Adds two quaternions. +/// The sum is not guaranteed to be normalized. +/// Note that addition is not the same as combining the rotations represented by the +/// two quaternions! That corresponds to multiplication. + + #[lua( + as_trait = "std::ops::Add", + kind = "MetaFunction", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, #[proxy] rhs: bevy::math::DQuat) -> bevy::math::DQuat; "#, r#" -/// Return the inverse of this transform. -/// Note that if the transform is not invertible the result will be invalid. +/// 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 inverse(&self) -> bevy::math::DAffine3; + #[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#" +/// 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", @@ -20047,18 +20173,21 @@ pub struct DAffine2 { composite = "mul", metamethod = "Mul", )] - fn mul(self, #[proxy] rhs: bevy::math::DAffine3) -> bevy::math::DAffine3; + fn mul(self, #[proxy] rhs: bevy::math::DQuat) -> bevy::math::DQuat; "#, r#" +/// Multiplies a quaternion by a scalar value. +/// The product is not guaranteed to be normalized. #[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::DAffine3) -> bool; + fn mul(self, rhs: f64) -> bevy::math::DQuat; "#, r#" @@ -20068,27 +20197,22 @@ pub struct DAffine2 { kind = "Method", output(proxy), )] - fn clone(&self) -> bevy::math::DAffine3; + fn clone(&self) -> 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#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{}", _self) -} -"#] -)] -pub struct DAffine3 { - #[lua(output(proxy))] - matrix3: bevy::math::DMat3, - #[lua(output(proxy))] - translation: bevy::math::DVec3, -} -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::math::DQuat", - functions[r#" /// Creates a new rotation quaternion. /// This should generally not be called manually unless you know what you are doing. /// Use one of the other constructors instead such as `identity` or `from_axis_angle`. @@ -20452,130 +20576,6 @@ pub struct DAffine3 { #[lua(kind = "Method", output(proxy))] fn as_f32(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", - kind = "MetaFunction", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, rhs: f64) -> bevy::math::DQuat; - -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> 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#" -/// Adds two quaternions. -/// The sum is not guaranteed to be normalized. -/// Note that addition is not the same as combining the rotations represented by the -/// two quaternions! That corresponds to multiplication. - - #[lua( - as_trait = "std::ops::Add", - kind = "MetaFunction", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(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#" -/// 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#" -/// 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#" -/// 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", - kind = "MetaFunction", - output(proxy), - composite = "mul", - metamethod = "Mul", - )] - fn mul(self, #[proxy] rhs: bevy::math::DQuat) -> bevy::math::DQuat; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -20584,7 +20584,7 @@ fn index(&self) -> String { } "#] )] -pub struct DQuat { +struct DQuat { x: f64, y: f64, z: f64, @@ -20596,6 +20596,17 @@ pub struct DQuat { remote = "bevy::math::EulerRot", functions[r#" + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &glam::EulerRot) -> bool; + +"#, + r#" + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] fn assert_receiver_is_total_eq(&self) -> (); @@ -20609,17 +20620,6 @@ pub struct DQuat { )] fn clone(&self) -> bevy::math::EulerRot; -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &glam::EulerRot) -> bool; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -20628,23 +20628,12 @@ fn index(&self) -> String { } "#] )] -pub struct EulerRot {} +struct EulerRot {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::math::BVec3A", functions[r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] rhs: &glam::BVec3A) -> bool; - -"#, - r#" /// Creates a new vector mask. #[lua(kind = "Function", output(proxy))] @@ -20706,6 +20695,17 @@ pub struct EulerRot {} )] fn clone(&self) -> bevy::math::BVec3A; +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] rhs: &glam::BVec3A) -> bool; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -20714,22 +20714,12 @@ fn index(&self) -> String { } "#] )] -pub struct BVec3A(); +struct BVec3A(); #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::math::BVec4A", - functions[r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::BVec4A; - -"#, - r#" +#[proxy( + derive(clone), + remote = "bevy::math::BVec4A", + functions[r#" #[lua( as_trait = "std::cmp::PartialEq", @@ -20792,6 +20782,16 @@ pub struct BVec3A(); #[lua(kind = "MutatingMethod")] fn set(&mut self, index: usize, value: bool) -> (); +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::BVec4A; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -20800,21 +20800,20 @@ fn index(&self) -> String { } "#] )] -pub struct BVec4A(); +struct BVec4A(); #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::math::primitives::Direction2d", functions[r#" -/// Create a [`Direction2d`] from a [`Vec2`] that is already normalized. -/// # Warning -/// `value` must be normalized, i.e it's length must be `1.0`. - #[lua(kind = "Function", output(proxy))] - fn new_unchecked( - #[proxy] - value: bevy::math::Vec2, - ) -> bevy::math::primitives::Direction2d; + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &bevy_math::primitives::Direction2d) -> bool; "#, r#" @@ -20840,14 +20839,15 @@ pub struct BVec4A(); "#, r#" +/// Create a [`Direction2d`] from a [`Vec2`] that is already normalized. +/// # Warning +/// `value` must be normalized, i.e it's length must be `1.0`. - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &bevy_math::primitives::Direction2d) -> bool; + #[lua(kind = "Function", output(proxy))] + fn new_unchecked( + #[proxy] + value: bevy::math::Vec2, + ) -> bevy::math::primitives::Direction2d; "#, r#" @@ -20857,7 +20857,7 @@ fn index(&self) -> String { } "#] )] -pub struct Direction2d(); +struct Direction2d(); #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -20865,22 +20865,22 @@ pub struct Direction2d(); 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::primitives::Circle; + fn eq(&self, #[proxy] other: &bevy_math::primitives::Circle) -> bool; "#, 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: &bevy_math::primitives::Circle) -> bool; + fn clone(&self) -> bevy::math::primitives::Circle; "#, r#" @@ -20927,7 +20927,7 @@ fn index(&self) -> String { } "#] )] -pub struct Circle { +struct Circle { radius: f32, } #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] @@ -20935,27 +20935,6 @@ pub struct Circle { 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: &bevy_math::primitives::Ellipse) -> bool; - -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::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. @@ -20991,6 +20970,27 @@ pub struct Circle { #[lua(kind = "Method")] fn area(&self) -> f32; +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::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: &bevy_math::primitives::Ellipse) -> bool; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -20999,7 +20999,7 @@ fn index(&self) -> String { } "#] )] -pub struct Ellipse { +struct Ellipse { #[lua(output(proxy))] half_size: bevy::math::Vec2, } @@ -21016,15 +21016,6 @@ pub struct Ellipse { )] fn clone(&self) -> bevy::math::primitives::Plane2d; -"#, - r#" -/// Create a new `Plane2d` from a normal -/// # Panics -/// Panics if the given `normal` is zero (or very close to zero), or non-finite. - - #[lua(kind = "Function", output(proxy))] - fn new(#[proxy] normal: bevy::math::Vec2) -> bevy::math::primitives::Plane2d; - "#, r#" @@ -21036,6 +21027,15 @@ pub struct Ellipse { )] fn eq(&self, #[proxy] other: &bevy_math::primitives::Plane2d) -> bool; +"#, + r#" +/// Create a new `Plane2d` from a normal +/// # Panics +/// Panics if the given `normal` is zero (or very close to zero), or non-finite. + + #[lua(kind = "Function", output(proxy))] + fn new(#[proxy] normal: bevy::math::Vec2) -> bevy::math::primitives::Plane2d; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -21044,7 +21044,7 @@ fn index(&self) -> String { } "#] )] -pub struct Plane2d { +struct Plane2d { #[lua(output(proxy))] normal: bevy::math::primitives::Direction2d, } @@ -21055,22 +21055,22 @@ pub struct Plane2d { functions[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: &bevy_math::primitives::Line2d) -> bool; + fn clone(&self) -> bevy::math::primitives::Line2d; "#, 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::primitives::Line2d; + fn eq(&self, #[proxy] other: &bevy_math::primitives::Line2d) -> bool; "#, r#" @@ -21080,7 +21080,7 @@ fn index(&self) -> String { } "#] )] -pub struct Line2d { +struct Line2d { #[lua(output(proxy))] direction: bevy::math::primitives::Direction2d, } @@ -21098,6 +21098,16 @@ pub struct Line2d { )] fn eq(&self, #[proxy] other: &bevy_math::primitives::Segment2d) -> bool; +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::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 @@ -21123,16 +21133,6 @@ pub struct Line2d { #[lua(kind = "Method", output(proxy))] fn point2(&self) -> bevy::math::Vec2; -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::primitives::Segment2d; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -21141,7 +21141,7 @@ fn index(&self) -> String { } "#] )] -pub struct Segment2d { +struct Segment2d { #[lua(output(proxy))] direction: bevy::math::primitives::Direction2d, half_length: f32, @@ -21153,12 +21153,11 @@ pub struct Segment2d { functions[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: &bevy_math::primitives::Triangle2d) -> bool; + fn clone(&self) -> bevy::math::primitives::Triangle2d; "#, r#" @@ -21200,11 +21199,12 @@ pub struct Segment2d { 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::primitives::Triangle2d; + fn eq(&self, #[proxy] other: &bevy_math::primitives::Triangle2d) -> bool; "#, r#" @@ -21214,7 +21214,7 @@ fn index(&self) -> String { } "#] )] -pub struct Triangle2d { +struct Triangle2d { vertices: ReflectedValue, } #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] @@ -21222,6 +21222,16 @@ pub struct Triangle2d { derive(clone), remote = "bevy::math::primitives::Rectangle", functions[r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::primitives::Rectangle; + +"#, + r#" /// Create a new `Rectangle` from a full width and height #[lua(kind = "Function", output(proxy))] @@ -21276,16 +21286,6 @@ pub struct Triangle2d { #[lua(kind = "Method", output(proxy))] fn closest_point(&self, #[proxy] point: bevy::math::Vec2) -> bevy::math::Vec2; -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::primitives::Rectangle; - "#, r#" @@ -21305,7 +21305,7 @@ fn index(&self) -> String { } "#] )] -pub struct Rectangle { +struct Rectangle { #[lua(output(proxy))] half_size: bevy::math::Vec2, } @@ -21426,7 +21426,7 @@ fn index(&self) -> String { } "#] )] -pub struct RegularPolygon { +struct RegularPolygon { #[lua(output(proxy))] circumcircle: bevy::math::primitives::Circle, sides: usize, @@ -21436,6 +21436,13 @@ pub struct RegularPolygon { derive(clone), remote = "bevy::math::primitives::Capsule2d", functions[r#" +/// Create a new `Capsule2d` from a radius and length + + #[lua(kind = "Function", output(proxy))] + fn new(radius: f32, length: f32) -> bevy::math::primitives::Capsule2d; + +"#, + r#" #[lua( as_trait = "std::cmp::PartialEq", @@ -21445,13 +21452,6 @@ pub struct RegularPolygon { )] fn eq(&self, #[proxy] other: &bevy_math::primitives::Capsule2d) -> bool; -"#, - r#" -/// Create a new `Capsule2d` from a radius and length - - #[lua(kind = "Function", output(proxy))] - fn new(radius: f32, length: f32) -> bevy::math::primitives::Capsule2d; - "#, r#" @@ -21470,7 +21470,7 @@ fn index(&self) -> String { } "#] )] -pub struct Capsule2d { +struct Capsule2d { radius: f32, half_length: f32, } @@ -21481,13 +21481,13 @@ pub struct Capsule2d { functions[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::Vec3; + fn neg(self) -> bevy::math::primitives::Direction3d; "#, r#" @@ -21510,18 +21510,6 @@ pub struct Capsule2d { )] fn eq(&self, #[proxy] other: &bevy_math::primitives::Direction3d) -> bool; -"#, - r#" - - #[lua( - as_trait = "std::ops::Neg", - kind = "MetaFunction", - output(proxy), - composite = "neg", - metamethod = "Unm", - )] - fn neg(self) -> bevy::math::primitives::Direction3d; - "#, r#" /// Create a [`Direction3d`] from a [`Vec3`] that is already normalized. @@ -21534,6 +21522,18 @@ pub struct Capsule2d { value: bevy::math::Vec3, ) -> bevy::math::primitives::Direction3d; +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul(self, rhs: f32) -> bevy::math::Vec3; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -21542,7 +21542,7 @@ fn index(&self) -> String { } "#] )] -pub struct Direction3d(); +struct Direction3d(); #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -21554,18 +21554,7 @@ pub struct Direction3d(); kind = "Method", output(proxy), )] - fn clone(&self) -> bevy::math::primitives::Sphere; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &bevy_math::primitives::Sphere) -> bool; + fn clone(&self) -> bevy::math::primitives::Sphere; "#, r#" @@ -21604,6 +21593,17 @@ pub struct Direction3d(); #[lua(kind = "Method", output(proxy))] fn closest_point(&self, #[proxy] point: bevy::math::Vec3) -> bevy::math::Vec3; +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &bevy_math::primitives::Sphere) -> bool; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -21612,7 +21612,7 @@ fn index(&self) -> String { } "#] )] -pub struct Sphere { +struct Sphere { radius: f32, } #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] @@ -21620,6 +21620,15 @@ pub struct Sphere { derive(clone), remote = "bevy::math::primitives::Plane3d", functions[r#" +/// Create a new `Plane3d` from a normal +/// # Panics +/// Panics if the given `normal` is zero (or very close to zero), or non-finite. + + #[lua(kind = "Function", output(proxy))] + fn new(#[proxy] normal: bevy::math::Vec3) -> bevy::math::primitives::Plane3d; + +"#, + r#" #[lua( as_trait = "std::cmp::PartialEq", @@ -21639,15 +21648,6 @@ pub struct Sphere { )] fn clone(&self) -> bevy::math::primitives::Plane3d; -"#, - r#" -/// Create a new `Plane3d` from a normal -/// # Panics -/// Panics if the given `normal` is zero (or very close to zero), or non-finite. - - #[lua(kind = "Function", output(proxy))] - fn new(#[proxy] normal: bevy::math::Vec3) -> bevy::math::primitives::Plane3d; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -21656,7 +21656,7 @@ fn index(&self) -> String { } "#] )] -pub struct Plane3d { +struct Plane3d { #[lua(output(proxy))] normal: bevy::math::primitives::Direction3d, } @@ -21692,7 +21692,7 @@ fn index(&self) -> String { } "#] )] -pub struct Line3d { +struct Line3d { #[lua(output(proxy))] direction: bevy::math::primitives::Direction3d, } @@ -21702,17 +21702,6 @@ pub 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: &bevy_math::primitives::Segment3d) -> bool; - -"#, - r#" - #[lua( as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", kind = "Method", @@ -21745,6 +21734,17 @@ pub struct Line3d { #[lua(kind = "Method", output(proxy))] fn point2(&self) -> bevy::math::Vec3; +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &bevy_math::primitives::Segment3d) -> bool; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -21753,7 +21753,7 @@ fn index(&self) -> String { } "#] )] -pub struct Segment3d { +struct Segment3d { #[lua(output(proxy))] direction: bevy::math::primitives::Direction3d, half_length: f32, @@ -21765,11 +21765,12 @@ pub struct Segment3d { 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::primitives::Cuboid; + fn eq(&self, #[proxy] other: &bevy_math::primitives::Cuboid) -> bool; "#, r#" @@ -21835,12 +21836,11 @@ pub struct Segment3d { 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: &bevy_math::primitives::Cuboid) -> bool; + fn clone(&self) -> bevy::math::primitives::Cuboid; "#, r#" @@ -21850,7 +21850,7 @@ fn index(&self) -> String { } "#] )] -pub struct Cuboid { +struct Cuboid { #[lua(output(proxy))] half_size: bevy::math::Vec3, } @@ -21867,6 +21867,17 @@ pub struct Cuboid { )] fn clone(&self) -> bevy::math::primitives::Cylinder; +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &bevy_math::primitives::Cylinder) -> bool; + "#, r#" /// Create a new `Cylinder` from a radius and full height @@ -21910,17 +21921,6 @@ pub struct Cuboid { #[lua(kind = "Method")] fn volume(&self) -> f32; -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &bevy_math::primitives::Cylinder) -> bool; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -21929,7 +21929,7 @@ fn index(&self) -> String { } "#] )] -pub struct Cylinder { +struct Cylinder { radius: f32, half_height: f32, } @@ -21940,22 +21940,22 @@ pub struct Cylinder { 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::primitives::Capsule3d; + fn eq(&self, #[proxy] other: &bevy_math::primitives::Capsule3d) -> bool; "#, 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: &bevy_math::primitives::Capsule3d) -> bool; + fn clone(&self) -> bevy::math::primitives::Capsule3d; "#, r#" @@ -21994,7 +21994,7 @@ fn index(&self) -> String { } "#] )] -pub struct Capsule3d { +struct Capsule3d { radius: f32, half_length: f32, } @@ -22074,7 +22074,7 @@ fn index(&self) -> String { } "#] )] -pub struct Cone { +struct Cone { radius: f32, height: f32, } @@ -22085,22 +22085,22 @@ pub struct Cone { functions[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: &bevy_math::primitives::ConicalFrustum) -> bool; + fn clone(&self) -> bevy::math::primitives::ConicalFrustum; "#, 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::primitives::ConicalFrustum; + fn eq(&self, #[proxy] other: &bevy_math::primitives::ConicalFrustum) -> bool; "#, r#" @@ -22110,7 +22110,7 @@ fn index(&self) -> String { } "#] )] -pub struct ConicalFrustum { +struct ConicalFrustum { radius_top: f32, radius_bottom: f32, height: f32, @@ -22120,17 +22120,6 @@ pub struct ConicalFrustum { 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: &bevy_math::primitives::Torus) -> bool; - -"#, - 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 @@ -22182,6 +22171,17 @@ pub struct ConicalFrustum { )] fn clone(&self) -> bevy::math::primitives::Torus; +"#, + r#" + + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &bevy_math::primitives::Torus) -> bool; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -22190,7 +22190,7 @@ fn index(&self) -> String { } "#] )] -pub struct Torus { +struct Torus { minor_radius: f32, major_radius: f32, } @@ -22200,23 +22200,18 @@ pub struct Torus { remote = "bevy::math::IRect", functions[r#" - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::IRect; + #[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: &bevy_math::IRect) -> bool; + fn clone(&self) -> bevy::math::IRect; "#, r#" @@ -22488,8 +22483,13 @@ pub struct Torus { "#, 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: &bevy_math::IRect) -> bool; "#, r#" @@ -22499,7 +22499,7 @@ fn index(&self) -> String { } "#] )] -pub struct IRect { +struct IRect { #[lua(output(proxy))] min: bevy::math::IVec2, #[lua(output(proxy))] @@ -22792,22 +22792,22 @@ pub struct IRect { 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::Rect; + fn eq(&self, #[proxy] other: &bevy_math::Rect) -> bool; "#, 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: &bevy_math::Rect) -> bool; + fn clone(&self) -> bevy::math::Rect; "#, r#" @@ -22817,7 +22817,7 @@ fn index(&self) -> String { } "#] )] -pub struct Rect { +struct Rect { #[lua(output(proxy))] min: bevy::math::Vec2, #[lua(output(proxy))] @@ -22829,19 +22829,12 @@ pub struct Rect { remote = "bevy::math::URect", 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", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), )] - fn eq(&self, #[proxy] other: &bevy_math::URect) -> bool; + fn clone(&self) -> bevy::math::URect; "#, r#" @@ -23114,11 +23107,18 @@ pub struct Rect { 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::URect; + fn eq(&self, #[proxy] other: &bevy_math::URect) -> bool; + +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -23128,7 +23128,7 @@ fn index(&self) -> String { } "#] )] -pub struct URect { +struct URect { #[lua(output(proxy))] min: bevy::math::UVec2, #[lua(output(proxy))] @@ -23190,7 +23190,7 @@ fn index(&self) -> String { } "#] )] -pub struct SmolStr(); +struct SmolStr(); #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -23517,12 +23517,28 @@ fn index(&self) -> String { } "#] )] -pub struct NonZeroIsize(); +struct NonZeroIsize(); #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::utils::Uuid", functions[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::utils::Uuid; + +"#, + r#" /// Returns the version number of the UUID. /// This represents the algorithm used to generate the value. /// This method is the future-proof alternative to [`Uuid::get_version`]. @@ -23848,22 +23864,6 @@ pub struct NonZeroIsize(); #[lua(kind = "Function", output(proxy))] fn from_bytes_le(b: [u8; 16]) -> bevy::utils::Uuid; -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::utils::Uuid; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" /// Creates a random UUID. @@ -23909,7 +23909,7 @@ fn index(&self) -> String { } "#] )] -pub struct Uuid(); +struct Uuid(); #[derive(Default)] pub(crate) struct Globals; impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { diff --git a/crates/bevy_script_api/src/providers/bevy_time.rs b/crates/bevy_script_api/src/providers/bevy_time.rs index 34c0cff2..c0dee6c0 100644 --- a/crates/bevy_script_api/src/providers/bevy_time.rs +++ b/crates/bevy_script_api/src/providers/bevy_time.rs @@ -25,7 +25,7 @@ fn index(&self) -> String { } "#] )] -pub struct Fixed {} +struct Fixed {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -43,19 +43,13 @@ fn index(&self) -> String { } "#] )] -pub struct Real {} +struct Real {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::time::prelude::Timer", functions[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", @@ -391,6 +385,12 @@ pub struct Real {} #[lua(kind = "Method")] fn times_finished_this_tick(&self) -> u32; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::time::prelude::Timer; + "#, r#" @@ -405,13 +405,19 @@ fn index(&self) -> String { } "#] )] -pub struct Timer {} +struct Timer {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), 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", @@ -420,12 +426,6 @@ pub 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#" @@ -440,7 +440,7 @@ fn index(&self) -> String { } "#] )] -pub struct TimerMode {} +struct TimerMode {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -458,15 +458,15 @@ fn index(&self) -> String { } "#] )] -pub struct Virtual {} +struct Virtual {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::time::Stopwatch", 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::Stopwatch; "#, r#" @@ -616,12 +616,6 @@ pub struct Virtual {} #[lua(kind = "MutatingMethod")] fn reset(&mut self) -> (); -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::time::Stopwatch; - "#, r#" @@ -633,6 +627,12 @@ pub struct Virtual {} )] fn eq(&self, #[proxy] other: &stopwatch::Stopwatch) -> bool; +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -641,7 +641,7 @@ fn index(&self) -> String { } "#] )] -pub struct Stopwatch {} +struct Stopwatch {} #[derive(Default)] pub(crate) struct Globals; impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { diff --git a/crates/bevy_script_api/src/providers/bevy_transform.rs b/crates/bevy_script_api/src/providers/bevy_transform.rs index c9e46db5..6f79491b 100644 --- a/crates/bevy_script_api/src/providers/bevy_transform.rs +++ b/crates/bevy_script_api/src/providers/bevy_transform.rs @@ -26,26 +26,9 @@ use bevy_script_api::{ fn mul( self, #[proxy] - global_transform: bevy::transform::components::GlobalTransform, + 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; - -"#, - r#" - - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &components::global_transform::GlobalTransform) -> bool; - "#, r#" @@ -56,23 +39,18 @@ use bevy_script_api::{ composite = "mul", metamethod = "Mul", )] - fn mul( - self, - #[proxy] - transform: bevy::transform::components::Transform, - ) -> bevy::transform::components::GlobalTransform; + fn mul(self, #[proxy] value: bevy::math::Vec3) -> bevy::math::Vec3; "#, 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] value: bevy::math::Vec3) -> bevy::math::Vec3; + fn eq(&self, #[proxy] other: &components::global_transform::GlobalTransform) -> bool; "#, r#" @@ -255,21 +233,9 @@ use bevy_script_api::{ "#, r#" -#[lua(kind="MetaMethod", metamethod="ToString")] -fn index(&self) -> String { - format!("{:?}", _self) -} -"#] -)] -pub struct GlobalTransform(); -#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] -#[proxy( - derive(clone), - remote = "bevy::transform::components::Transform", - functions[r#" #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::transform::components::Transform; + fn clone(&self) -> bevy::transform::components::GlobalTransform; "#, r#" @@ -284,11 +250,23 @@ pub struct GlobalTransform(); fn mul( self, #[proxy] - transform: bevy::transform::components::Transform, - ) -> bevy::transform::components::Transform; + global_transform: bevy::transform::components::GlobalTransform, + ) -> bevy::transform::components::GlobalTransform; "#, r#" +#[lua(kind="MetaMethod", metamethod="ToString")] +fn index(&self) -> String { + format!("{:?}", _self) +} +"#] +)] +struct GlobalTransform(); +#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] +#[proxy( + derive(clone), + remote = "bevy::transform::components::Transform", + functions[r#" #[lua( as_trait = "std::cmp::PartialEq", @@ -298,22 +276,6 @@ pub struct GlobalTransform(); )] fn eq(&self, #[proxy] other: &components::transform::Transform) -> bool; -"#, - 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#" /// Creates a new [`Transform`] at the position `(x, y, z)`. In 2d, the `z` component @@ -629,6 +591,38 @@ pub struct GlobalTransform(); #[lua(kind = "Method")] fn is_finite(&self) -> bool; +"#, + r#" + + #[lua( + as_trait = "std::ops::Mul", + kind = "MetaFunction", + output(proxy), + composite = "mul", + metamethod = "Mul", + )] + fn mul( + self, + #[proxy] + transform: bevy::transform::components::Transform, + ) -> bevy::transform::components::Transform; + +"#, + 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#" @@ -641,6 +635,12 @@ pub struct GlobalTransform(); )] fn mul(self, #[proxy] value: bevy::math::Vec3) -> bevy::math::Vec3; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::transform::components::Transform; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -649,7 +649,7 @@ fn index(&self) -> String { } "#] )] -pub struct Transform { +struct Transform { #[lua(output(proxy))] translation: bevy::math::Vec3, #[lua(output(proxy))] diff --git a/crates/bevy_script_api/src/providers/bevy_window.rs b/crates/bevy_script_api/src/providers/bevy_window.rs index 5815cca5..fd2f7e14 100644 --- a/crates/bevy_script_api/src/providers/bevy_window.rs +++ b/crates/bevy_script_api/src/providers/bevy_window.rs @@ -15,6 +15,12 @@ use bevy_script_api::{ remote = "bevy::window::prelude::CursorEntered", 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::CursorEntered; @@ -29,12 +35,6 @@ use bevy_script_api::{ )] fn eq(&self, #[proxy] other: &event::CursorEntered) -> bool; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -43,7 +43,7 @@ fn index(&self) -> String { } "#] )] -pub struct CursorEntered { +struct CursorEntered { #[lua(output(proxy))] window: bevy::ecs::entity::Entity, } @@ -81,21 +81,21 @@ fn index(&self) -> String { } "#] )] -pub struct CursorIcon {} +struct CursorIcon {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::window::prelude::CursorLeft", 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::window::prelude::CursorLeft; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::prelude::CursorLeft; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -116,7 +116,7 @@ fn index(&self) -> String { } "#] )] -pub struct CursorLeft { +struct CursorLeft { #[lua(output(proxy))] window: bevy::ecs::entity::Entity, } @@ -148,7 +148,7 @@ fn index(&self) -> String { } "#] )] -pub struct CursorMoved { +struct CursorMoved { #[lua(output(proxy))] window: bevy::ecs::entity::Entity, #[lua(output(proxy))] @@ -161,6 +161,12 @@ pub struct CursorMoved { remote = "bevy::window::prelude::FileDragAndDrop", functions[r#" + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::window::prelude::FileDragAndDrop; + +"#, + r#" + #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -175,12 +181,6 @@ pub struct CursorMoved { #[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")] @@ -189,19 +189,13 @@ fn index(&self) -> String { } "#] )] -pub struct FileDragAndDrop {} +struct FileDragAndDrop {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::window::prelude::Ime", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::prelude::Ime; - -"#, - r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] fn assert_receiver_is_total_eq(&self) -> (); @@ -216,6 +210,12 @@ pub struct FileDragAndDrop {} )] fn eq(&self, #[proxy] other: &event::Ime) -> bool; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::window::prelude::Ime; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -224,15 +224,15 @@ fn index(&self) -> String { } "#] )] -pub struct Ime {} +struct Ime {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::window::prelude::MonitorSelection", 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::window::prelude::MonitorSelection; "#, r#" @@ -248,8 +248,8 @@ pub struct Ime {} "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::prelude::MonitorSelection; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -259,7 +259,7 @@ fn index(&self) -> String { } "#] )] -pub struct MonitorSelection {} +struct MonitorSelection {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -269,6 +269,12 @@ pub struct MonitorSelection {} #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::window::prelude::ReceivedCharacter; +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#, r#" @@ -280,12 +286,6 @@ pub struct MonitorSelection {} )] fn eq(&self, #[proxy] other: &event::ReceivedCharacter) -> bool; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -294,7 +294,7 @@ fn index(&self) -> String { } "#] )] -pub struct ReceivedCharacter { +struct ReceivedCharacter { #[lua(output(proxy))] window: bevy::ecs::entity::Entity, #[lua(output(proxy))] @@ -305,6 +305,12 @@ pub struct ReceivedCharacter { derive(clone), remote = "bevy::window::prelude::Window", functions[r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::window::prelude::Window; + +"#, + r#" /// Setting to true will attempt to maximize the window. /// Setting to false will attempt to un-maximize the window. @@ -359,12 +365,6 @@ pub struct ReceivedCharacter { #[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")] @@ -373,7 +373,7 @@ fn index(&self) -> String { } "#] )] -pub struct Window { +struct Window { #[lua(output(proxy))] cursor: bevy::window::Cursor, #[lua(output(proxy))] @@ -414,8 +414,13 @@ pub struct Window { remote = "bevy::window::prelude::WindowMoved", 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: &event::WindowMoved) -> bool; "#, r#" @@ -426,13 +431,8 @@ pub struct Window { "#, r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::WindowMoved) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -442,7 +442,7 @@ fn index(&self) -> String { } "#] )] -pub struct WindowMoved { +struct WindowMoved { #[lua(output(proxy))] window: bevy::ecs::entity::Entity, #[lua(output(proxy))] @@ -453,23 +453,6 @@ pub struct WindowMoved { 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))] @@ -496,6 +479,23 @@ pub struct WindowMoved { monitor: bevy::window::prelude::MonitorSelection, ) -> (); +"#, + 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#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -504,17 +504,20 @@ fn index(&self) -> String { } "#] )] -pub struct WindowPosition {} +struct WindowPosition {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::window::prelude::WindowResizeConstraints", functions[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; + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &window::WindowResizeConstraints) -> bool; "#, r#" @@ -524,14 +527,11 @@ pub struct WindowPosition {} "#, r#" +/// Checks if the constraints are valid. +/// Will output warnings if it isn't. - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &window::WindowResizeConstraints) -> bool; + #[lua(kind = "Method", output(proxy))] + fn check_constraints(&self) -> bevy::window::prelude::WindowResizeConstraints; "#, r#" @@ -541,7 +541,7 @@ fn index(&self) -> String { } "#] )] -pub struct WindowResizeConstraints { +struct WindowResizeConstraints { min_width: f32, min_height: f32, max_width: f32, @@ -553,6 +553,12 @@ pub struct WindowResizeConstraints { 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", @@ -561,12 +567,6 @@ pub struct WindowResizeConstraints { )] fn eq(&self, #[proxy] other: &event::WindowResized) -> bool; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowResized; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -575,7 +575,7 @@ fn index(&self) -> String { } "#] )] -pub struct WindowResized { +struct WindowResized { #[lua(output(proxy))] window: bevy::ecs::entity::Entity, width: f32, @@ -590,12 +590,6 @@ pub struct WindowResized { #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::window::WindowCreated; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" @@ -607,6 +601,12 @@ pub struct WindowResized { )] 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")] @@ -615,7 +615,7 @@ fn index(&self) -> String { } "#] )] -pub struct WindowCreated { +struct WindowCreated { #[lua(output(proxy))] window: bevy::ecs::entity::Entity, } @@ -625,13 +625,8 @@ pub struct WindowCreated { remote = "bevy::window::WindowClosed", functions[r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::WindowClosed) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::window::WindowClosed; "#, r#" @@ -642,8 +637,13 @@ pub struct WindowCreated { "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowClosed; + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &event::WindowClosed) -> bool; "#, r#" @@ -653,7 +653,7 @@ fn index(&self) -> String { } "#] )] -pub struct WindowClosed { +struct WindowClosed { #[lua(output(proxy))] window: bevy::ecs::entity::Entity, } @@ -663,25 +663,25 @@ pub struct WindowClosed { remote = "bevy::window::WindowCloseRequested", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowCloseRequested; + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &event::WindowCloseRequested) -> bool; "#, 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::window::WindowCloseRequested; "#, r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::WindowCloseRequested) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -691,7 +691,7 @@ fn index(&self) -> String { } "#] )] -pub struct WindowCloseRequested { +struct WindowCloseRequested { #[lua(output(proxy))] window: bevy::ecs::entity::Entity, } @@ -701,14 +701,14 @@ pub struct WindowCloseRequested { remote = "bevy::window::WindowDestroyed", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowDestroyed; + #[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::window::WindowDestroyed; "#, r#" @@ -729,7 +729,7 @@ fn index(&self) -> String { } "#] )] -pub struct WindowDestroyed { +struct WindowDestroyed { #[lua(output(proxy))] window: bevy::ecs::entity::Entity, } @@ -739,17 +739,6 @@ pub struct WindowDestroyed { remote = "bevy::window::RequestRedraw", functions[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::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::window::RequestRedraw; @@ -759,6 +748,17 @@ pub struct WindowDestroyed { #[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::RequestRedraw) -> bool; + "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -767,21 +767,21 @@ fn index(&self) -> String { } "#] )] -pub struct RequestRedraw {} +struct RequestRedraw {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::window::WindowFocused", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowFocused; + #[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::window::WindowFocused; "#, r#" @@ -802,7 +802,7 @@ fn index(&self) -> String { } "#] )] -pub struct WindowFocused { +struct WindowFocused { #[lua(output(proxy))] window: bevy::ecs::entity::Entity, focused: bool, @@ -841,7 +841,7 @@ fn index(&self) -> String { } "#] )] -pub struct WindowOccluded { +struct WindowOccluded { #[lua(output(proxy))] window: bevy::ecs::entity::Entity, occluded: bool, @@ -852,12 +852,6 @@ pub struct WindowOccluded { remote = "bevy::window::WindowScaleFactorChanged", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowScaleFactorChanged; - -"#, - r#" - #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -866,6 +860,12 @@ pub struct WindowOccluded { )] 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")] @@ -874,7 +874,7 @@ fn index(&self) -> String { } "#] )] -pub struct WindowScaleFactorChanged { +struct WindowScaleFactorChanged { #[lua(output(proxy))] window: bevy::ecs::entity::Entity, scale_factor: f64, @@ -885,6 +885,12 @@ pub struct WindowScaleFactorChanged { 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", @@ -893,12 +899,6 @@ pub struct WindowScaleFactorChanged { )] fn eq(&self, #[proxy] other: &event::WindowBackendScaleFactorChanged) -> bool; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowBackendScaleFactorChanged; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -907,7 +907,7 @@ fn index(&self) -> String { } "#] )] -pub struct WindowBackendScaleFactorChanged { +struct WindowBackendScaleFactorChanged { #[lua(output(proxy))] window: bevy::ecs::entity::Entity, scale_factor: f64, @@ -918,6 +918,12 @@ pub struct WindowBackendScaleFactorChanged { remote = "bevy::window::WindowThemeChanged", 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", @@ -932,12 +938,6 @@ pub struct WindowBackendScaleFactorChanged { #[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")] @@ -946,7 +946,7 @@ fn index(&self) -> String { } "#] )] -pub struct WindowThemeChanged { +struct WindowThemeChanged { #[lua(output(proxy))] window: bevy::ecs::entity::Entity, #[lua(output(proxy))] @@ -958,25 +958,25 @@ pub struct WindowThemeChanged { remote = "bevy::window::ApplicationLifetime", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::ApplicationLifetime; + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &event::ApplicationLifetime) -> bool; "#, 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::window::ApplicationLifetime; "#, r#" - #[lua( - as_trait = "std::cmp::PartialEq", - kind = "MetaFunction", - composite = "eq", - metamethod = "Eq", - )] - fn eq(&self, #[proxy] other: &event::ApplicationLifetime) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -986,19 +986,13 @@ fn index(&self) -> String { } "#] )] -pub struct ApplicationLifetime {} +struct ApplicationLifetime {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::window::PrimaryWindow", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::PrimaryWindow; - -"#, - r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] fn assert_receiver_is_total_eq(&self) -> (); @@ -1013,6 +1007,12 @@ pub struct ApplicationLifetime {} )] 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")] @@ -1021,7 +1021,7 @@ fn index(&self) -> String { } "#] )] -pub struct PrimaryWindow {} +struct PrimaryWindow {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -1039,7 +1039,7 @@ fn index(&self) -> String { } "#] )] -pub struct Cursor { +struct Cursor { #[lua(output(proxy))] icon: bevy::window::prelude::CursorIcon, visible: bool, @@ -1053,6 +1053,12 @@ pub struct Cursor { remote = "bevy::window::CursorGrabMode", functions[r#" + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::window::CursorGrabMode; + +"#, + r#" + #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -1067,12 +1073,6 @@ pub struct Cursor { #[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")] @@ -1081,15 +1081,15 @@ fn index(&self) -> String { } "#] )] -pub struct CursorGrabMode {} +struct CursorGrabMode {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::window::CompositeAlphaMode", 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::window::CompositeAlphaMode; "#, r#" @@ -1105,8 +1105,8 @@ pub struct CursorGrabMode {} "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::CompositeAlphaMode; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -1116,13 +1116,19 @@ fn index(&self) -> String { } "#] )] -pub struct CompositeAlphaMode {} +struct CompositeAlphaMode {} #[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#" + #[lua( as_trait = "std::cmp::PartialEq", kind = "MetaFunction", @@ -1235,12 +1241,6 @@ pub struct CompositeAlphaMode {} scale_factor_override: std::option::Option, ) -> (); -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowResolution; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -1249,20 +1249,15 @@ fn index(&self) -> String { } "#] )] -pub struct WindowResolution {} +struct WindowResolution {} #[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; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::window::WindowMode; "#, r#" @@ -1273,8 +1268,13 @@ pub struct WindowResolution {} "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowMode; + #[lua( + as_trait = "std::cmp::PartialEq", + kind = "MetaFunction", + composite = "eq", + metamethod = "Eq", + )] + fn eq(&self, #[proxy] other: &window::WindowMode) -> bool; "#, r#" @@ -1284,21 +1284,21 @@ fn index(&self) -> String { } "#] )] -pub struct WindowMode {} +struct WindowMode {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::window::WindowLevel", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowLevel; + #[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::window::WindowLevel; "#, r#" @@ -1319,7 +1319,7 @@ fn index(&self) -> String { } "#] )] -pub struct WindowLevel {} +struct WindowLevel {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -1337,14 +1337,14 @@ pub struct WindowLevel {} "#, 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::window::PresentMode; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::PresentMode; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -1354,7 +1354,7 @@ fn index(&self) -> String { } "#] )] -pub struct PresentMode {} +struct PresentMode {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -1369,6 +1369,12 @@ pub struct PresentMode {} )] fn eq(&self, #[proxy] other: &window::InternalWindowState) -> bool; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::window::InternalWindowState; + "#, r#" /// Consumes the current maximize request, if it exists. This should only be called by window backends. @@ -1383,12 +1389,6 @@ pub struct PresentMode {} #[lua(kind = "MutatingMethod")] fn take_minimize_request(&mut self) -> std::option::Option; -"#, - r#" - - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::InternalWindowState; - "#, r#" #[lua(kind="MetaMethod", metamethod="ToString")] @@ -1397,15 +1397,15 @@ fn index(&self) -> String { } "#] )] -pub struct InternalWindowState {} +struct InternalWindowState {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), remote = "bevy::window::WindowTheme", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowTheme; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -1421,8 +1421,8 @@ pub struct InternalWindowState {} "#, 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::window::WindowTheme; "#, r#" @@ -1432,7 +1432,7 @@ fn index(&self) -> String { } "#] )] -pub struct WindowTheme {} +struct WindowTheme {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -1461,7 +1461,7 @@ fn index(&self) -> String { } "#] )] -pub struct EnabledButtons { +struct EnabledButtons { minimize: bool, maximize: bool, close: bool, @@ -1483,7 +1483,7 @@ fn index(&self) -> String { } "#] )] -pub struct WindowRef {} +struct WindowRef {} #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(clone), @@ -1493,13 +1493,6 @@ pub struct WindowRef {} #[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#" @@ -1511,6 +1504,13 @@ pub struct WindowRef {} )] fn eq(&self, #[proxy] other: &window::NormalizedWindowRef) -> bool; +"#, + r#" +/// Fetch the entity of this window reference + + #[lua(kind = "Method", output(proxy))] + fn entity(&self) -> bevy::ecs::entity::Entity; + "#, r#" @@ -1525,7 +1525,7 @@ fn index(&self) -> String { } "#] )] -pub struct NormalizedWindowRef(); +struct NormalizedWindowRef(); #[derive(Default)] pub(crate) struct Globals; impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { diff --git a/crates/bevy_script_api/src/providers/mod.rs b/crates/bevy_script_api/src/providers/mod.rs index 62a19bbb..6fd8c881 100644 --- a/crates/bevy_script_api/src/providers/mod.rs +++ b/crates/bevy_script_api/src/providers/mod.rs @@ -2,14 +2,14 @@ #![allow(clippy::all)] #![allow(unused, deprecated, dead_code)] #![cfg_attr(rustfmt, rustfmt_skip)] -pub(crate) mod bevy_ecs; -pub(crate) mod bevy_transform; -pub(crate) mod bevy_input; -pub(crate) mod bevy_core; -pub(crate) mod bevy_time; -pub(crate) mod bevy_hierarchy; -pub(crate) mod bevy_window; -pub(crate) mod bevy_reflect; +pub mod bevy_ecs; +pub mod bevy_transform; +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; pub struct LuaBevyAPIProvider;