diff --git a/.gitignore b/.gitignore index f8a150654c..b8efa21749 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ assets/scripts/tlconfig.lua **.log **build/ .html +.idea/ /assets/**/*.lad.json -/docs/src/ladfiles/*.lad.json \ No newline at end of file +/docs/src/ladfiles/*.lad.json diff --git a/Cargo.toml b/Cargo.toml index 61bf0bfe3f..fbc4d3ed48 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_mod_scripting" -version = "0.12.0" +version = "0.13.0" authors = ["Maksymilian Mozolewski "] edition = "2021" license = "MIT OR Apache-2.0" @@ -76,37 +76,38 @@ profile_with_tracy = ["bevy/trace_tracy"] [dependencies] bevy = { workspace = true } bevy_mod_scripting_core = { workspace = true } -bevy_mod_scripting_lua = { path = "crates/languages/bevy_mod_scripting_lua", version = "0.12.0", optional = true } -bevy_mod_scripting_rhai = { path = "crates/languages/bevy_mod_scripting_rhai", version = "0.12.0", optional = true } +bevy_mod_scripting_lua = { path = "crates/languages/bevy_mod_scripting_lua", version = "0.13.0", optional = true } +bevy_mod_scripting_rhai = { path = "crates/languages/bevy_mod_scripting_rhai", version = "0.13.0", optional = true } # bevy_mod_scripting_rune = { path = "crates/languages/bevy_mod_scripting_rune", version = "0.9.0-alpha.2", optional = true } bevy_mod_scripting_functions = { workspace = true } bevy_mod_scripting_derive = { workspace = true } [workspace.dependencies] profiling = { version = "1.0" } -bevy = { version = "0.15.3", default-features = false } -bevy_mod_scripting_core = { path = "crates/bevy_mod_scripting_core", version = "0.12.0" } -bevy_mod_scripting_functions = { path = "crates/bevy_mod_scripting_functions", version = "0.12.0", default-features = false } -bevy_mod_scripting_derive = { path = "crates/bevy_mod_scripting_derive", version = "0.12.0" } +bevy_math = { version = "0.16.0", default-features = false } +bevy_reflect = { version = "0.16.0", default-features = false } +bevy_input = { version = "0.16.0", default-features = false } +bevy = { version = "0.16.0", default-features = false } +bevy_mod_scripting_core = { path = "crates/bevy_mod_scripting_core", version = "0.13.0" } +bevy_mod_scripting_functions = { path = "crates/bevy_mod_scripting_functions", version = "0.13.0", default-features = false } +bevy_mod_scripting_derive = { path = "crates/bevy_mod_scripting_derive", version = "0.13.0" } # test utilities script_integration_test_harness = { path = "crates/testing_crates/script_integration_test_harness" } test_utils = { path = "crates/testing_crates/test_utils" } [dev-dependencies] -bevy = { workspace = true, default-features = true } +bevy = { workspace = true, default-features = true, features = ["std"] } clap = { version = "4.1", features = ["derive"] } -rand = "0.8.5" -bevy_console = "0.13" -# rhai-rand = "0.1" +rand = "0.9.1" criterion = { version = "0.5" } -ansi-parser = "0.9" ladfile_builder = { path = "crates/ladfile_builder", version = "0.3.2" } script_integration_test_harness = { workspace = true } test_utils = { workspace = true } libtest-mimic = "0.8" tracing-tracy = "0.11" regex = "1.11" +bevy_console = "0.14" [workspace] members = [ diff --git a/assets/tests/add_system/added_systems_run_in_parallel.lua b/assets/tests/add_system/added_systems_run_in_parallel.lua index 2adf8104d0..bd7951c729 100644 --- a/assets/tests/add_system/added_systems_run_in_parallel.lua +++ b/assets/tests/add_system/added_systems_run_in_parallel.lua @@ -21,21 +21,30 @@ function on_test() local expected_dot_graph = [[ digraph { - node_0 [label="bevy_mod_scripting_core::bindings::allocator::garbage_collector"]; - node_1 [label="on_test_post_update"]; - node_2 [label="script_integration_test_harness::dummy_before_post_update_system"]; - node_3 [label="script_integration_test_harness::dummy_post_update_system"]; - node_4 [label="custom_system_a"]; - node_5 [label="custom_system_b"]; - node_6 [label="SystemSet GarbageCollection"]; - node_7 [label="SystemSet ScriptSystem(custom_system_a)"]; - node_8 [label="SystemSet ScriptSystem(custom_system_b)"]; - node_0 -> node_6 [color=red, label="child of", arrowhead=diamond]; - node_4 -> node_7 [color=red, label="child of", arrowhead=diamond]; - node_5 -> node_8 [color=red, label="child of", arrowhead=diamond]; - node_1 -> node_4 [color=blue, label="runs before", arrowhead=normal]; - node_1 -> node_5 [color=blue, label="runs before", arrowhead=normal]; - node_2 -> node_3 [color=blue, label="runs before", arrowhead=normal]; + node_0 [label="bevy_asset::assets::Assets::asset_events"]; + node_1 [label="bevy_asset::assets::Assets::asset_events"]; + node_2 [label="bevy_asset::assets::Assets<()>::asset_events"]; + node_3 [label="bevy_asset::assets::Assets::asset_events"]; + node_4 [label="bevy_mod_scripting_core::bindings::allocator::garbage_collector"]; + node_5 [label="on_test_post_update"]; + node_6 [label="script_integration_test_harness::dummy_before_post_update_system"]; + node_7 [label="script_integration_test_harness::dummy_post_update_system"]; + node_8 [label="custom_system_a"]; + node_9 [label="custom_system_b"]; + node_10 [label="SystemSet AssetEvents"]; + node_11 [label="SystemSet GarbageCollection"]; + node_12 [label="SystemSet ScriptSystem(custom_system_a)"]; + node_13 [label="SystemSet ScriptSystem(custom_system_b)"]; + node_0 -> node_10 [color=red, label="child of", arrowhead=diamond]; + node_1 -> node_10 [color=red, label="child of", arrowhead=diamond]; + node_2 -> node_10 [color=red, label="child of", arrowhead=diamond]; + node_3 -> node_10 [color=red, label="child of", arrowhead=diamond]; + node_4 -> node_11 [color=red, label="child of", arrowhead=diamond]; + node_8 -> node_12 [color=red, label="child of", arrowhead=diamond]; + node_9 -> node_13 [color=red, label="child of", arrowhead=diamond]; + node_5 -> node_8 [color=blue, label="runs before", arrowhead=normal]; + node_5 -> node_9 [color=blue, label="runs before", arrowhead=normal]; + node_6 -> node_7 [color=blue, label="runs before", arrowhead=normal]; } ]] diff --git a/assets/tests/add_system/added_systems_run_in_parallel.rhai b/assets/tests/add_system/added_systems_run_in_parallel.rhai index 4ab2ddc17a..b49d41b9b3 100644 --- a/assets/tests/add_system/added_systems_run_in_parallel.rhai +++ b/assets/tests/add_system/added_systems_run_in_parallel.rhai @@ -20,21 +20,30 @@ fn on_test() { let expected_dot_graph = ` digraph { - node_0 [label="bevy_mod_scripting_core::bindings::allocator::garbage_collector"]; - node_1 [label="on_test_post_update"]; - node_2 [label="script_integration_test_harness::dummy_before_post_update_system"]; - node_3 [label="script_integration_test_harness::dummy_post_update_system"]; - node_4 [label="custom_system_a"]; - node_5 [label="custom_system_b"]; - node_6 [label="SystemSet GarbageCollection"]; - node_7 [label="SystemSet ScriptSystem(custom_system_a)"]; - node_8 [label="SystemSet ScriptSystem(custom_system_b)"]; - node_0 -> node_6 [color=red, label="child of", arrowhead=diamond]; - node_4 -> node_7 [color=red, label="child of", arrowhead=diamond]; - node_5 -> node_8 [color=red, label="child of", arrowhead=diamond]; - node_1 -> node_4 [color=blue, label="runs before", arrowhead=normal]; - node_1 -> node_5 [color=blue, label="runs before", arrowhead=normal]; - node_2 -> node_3 [color=blue, label="runs before", arrowhead=normal]; + node_0 [label="bevy_asset::assets::Assets::asset_events"]; + node_1 [label="bevy_asset::assets::Assets::asset_events"]; + node_2 [label="bevy_asset::assets::Assets<()>::asset_events"]; + node_3 [label="bevy_asset::assets::Assets::asset_events"]; + node_4 [label="bevy_mod_scripting_core::bindings::allocator::garbage_collector"]; + node_5 [label="on_test_post_update"]; + node_6 [label="script_integration_test_harness::dummy_before_post_update_system"]; + node_7 [label="script_integration_test_harness::dummy_post_update_system"]; + node_8 [label="custom_system_a"]; + node_9 [label="custom_system_b"]; + node_10 [label="SystemSet AssetEvents"]; + node_11 [label="SystemSet GarbageCollection"]; + node_12 [label="SystemSet ScriptSystem(custom_system_a)"]; + node_13 [label="SystemSet ScriptSystem(custom_system_b)"]; + node_0 -> node_10 [color=red, label="child of", arrowhead=diamond]; + node_1 -> node_10 [color=red, label="child of", arrowhead=diamond]; + node_2 -> node_10 [color=red, label="child of", arrowhead=diamond]; + node_3 -> node_10 [color=red, label="child of", arrowhead=diamond]; + node_4 -> node_11 [color=red, label="child of", arrowhead=diamond]; + node_8 -> node_12 [color=red, label="child of", arrowhead=diamond]; + node_9 -> node_13 [color=red, label="child of", arrowhead=diamond]; + node_5 -> node_8 [color=blue, label="runs before", arrowhead=normal]; + node_5 -> node_9 [color=blue, label="runs before", arrowhead=normal]; + node_6 -> node_7 [color=blue, label="runs before", arrowhead=normal]; }`; assert_str_eq.call(dot_graph, expected_dot_graph, "Expected the schedule graph to match the expected graph"); diff --git a/benches/benchmarks.rs b/benches/benchmarks.rs index 82b3745d46..087538ae90 100644 --- a/benches/benchmarks.rs +++ b/benches/benchmarks.rs @@ -1,27 +1,28 @@ -use bevy::log::tracing_subscriber::layer::SubscriberExt; -use bevy::log::{tracing_subscriber, Level}; -use bevy::reflect::Reflect; -use bevy::utils::tracing; -use bevy::utils::tracing::span; +extern crate bevy_mod_scripting; +extern crate script_integration_test_harness; +extern crate test_utils; +use std::{collections::HashMap, path::PathBuf, sync::LazyLock, time::Duration}; + +use bevy::{ + log::{ + tracing, tracing::span, tracing_subscriber, tracing_subscriber::layer::SubscriberExt, Level, + }, + reflect::Reflect, +}; use bevy_mod_scripting_core::bindings::{ FromScript, IntoScript, Mut, Ref, ReflectReference, ScriptValue, Val, }; -use criterion::{criterion_main, measurement::Measurement, BenchmarkGroup, Criterion}; -use criterion::{BatchSize, BenchmarkFilter}; +use criterion::{ + criterion_main, measurement::Measurement, BatchSize, BenchmarkFilter, BenchmarkGroup, Criterion, +}; use regex::Regex; -use script_integration_test_harness::test_functions::rand::Rng; use script_integration_test_harness::{ make_test_lua_plugin, make_test_rhai_plugin, perform_benchmark_with_generator, run_lua_benchmark, run_plugin_script_load_benchmark, run_rhai_benchmark, + test_functions::rand::Rng, }; -use std::collections::HashMap; -use std::{path::PathBuf, sync::LazyLock, time::Duration}; use test_utils::{discover_all_tests, Test}; -extern crate bevy_mod_scripting; -extern crate script_integration_test_harness; -extern crate test_utils; - static ENABLE_PROFILING: LazyLock = LazyLock::new(|| std::env::var("ENABLE_PROFILING").is_ok()); diff --git a/codegen_bevy_features.txt b/codegen_bevy_features.txt new file mode 100644 index 0000000000..f14d74c7a3 --- /dev/null +++ b/codegen_bevy_features.txt @@ -0,0 +1 @@ +bevy_asset,bevy_animation,bevy_core_pipeline,bevy_ui,bevy_pbr,bevy_render,bevy_text,bevy_sprite,file_watcher,multi_threaded,std,async_executor \ No newline at end of file diff --git a/crates/bevy_api_gen/Cargo.bootstrap.toml b/crates/bevy_api_gen/Cargo.bootstrap.toml index d34f8c99eb..04b6cf4532 100644 --- a/crates/bevy_api_gen/Cargo.bootstrap.toml +++ b/crates/bevy_api_gen/Cargo.bootstrap.toml @@ -6,8 +6,8 @@ edition = "2021" [dependencies] bevy_mod_scripting_core = { path = "{{BMS_CORE_PATH}}" } -bevy_reflect = { version = "0.15.3", features = [ - "bevy", +bevy_reflect = { version = "0.16.0", features = [ + "smol_str", "glam", "petgraph", "smallvec", diff --git a/crates/bevy_api_gen/Cargo.toml b/crates/bevy_api_gen/Cargo.toml index 5773d66271..9b0c238847 100644 --- a/crates/bevy_api_gen/Cargo.toml +++ b/crates/bevy_api_gen/Cargo.toml @@ -30,18 +30,17 @@ codegen-units = 8 incremental = false debug = false -[rust-analyzer.rustc] -source = "discover" +# [rust-analyzer.rustc] +# source = "discover" -[package.metadata.rust-analyzer] -rustc_private = true +# [package.metadata.rust-analyzer] +# rustc_private = true [dependencies] log = "0.4" env_logger = "0.11" rustc_plugin = "0.12.0-nightly-2024-12-15" indexmap = "2" -tempdir = "0.3" cargo_metadata = "0.18" serde_json = "1" serde = "1" @@ -51,8 +50,7 @@ strum = { version = "0.26", features = ["derive"] } include_dir = "0.7" prettyplease = "0.2" convert_case = "0.6" -syn = { version = "2", features = ["parsing"], no-default-features = true } -clap-verbosity-flag = "2.2" +syn = { version = "2", features = ["parsing"], default-features = false } itertools = "0.12" chrono = "0.4" diff --git a/crates/bevy_api_gen/src/context.rs b/crates/bevy_api_gen/src/context.rs index 8ee79de8bb..27f8979fda 100644 --- a/crates/bevy_api_gen/src/context.rs +++ b/crates/bevy_api_gen/src/context.rs @@ -94,7 +94,7 @@ pub(crate) const DEF_PATHS_REFLECT: [&str; 2] = ["bevy_reflect::PartialReflect", "reflect::PartialReflect"]; pub(crate) const DEF_PATHS_GET_TYPE_REGISTRATION: [&str; 2] = [ "bevy_reflect::GetTypeRegistration", - "reflect::GetTypeRegistration", + "type_registry::GetTypeRegistration", ]; /// A collection of traits which we search for in the codebase, some are included purely for the methods they provide, @@ -132,12 +132,26 @@ pub(crate) struct CachedTraits { } impl CachedTraits { - pub(crate) fn has_all_bms_traits(&self) -> bool { - self.bms_into_script.is_some() && self.bms_from_script.is_some() + pub(crate) fn missing_bms_traits(&self) -> Vec<&'static str> { + let mut missing = Vec::new(); + if self.bms_into_script.is_none() { + missing.extend(DEF_PATHS_BMS_INTO_SCRIPT); + } + if self.bms_from_script.is_none() { + missing.extend(DEF_PATHS_BMS_FROM_SCRIPT); + } + missing } - pub(crate) fn has_all_bevy_traits(&self) -> bool { - self.bevy_reflect_reflect.is_some() && self.bevy_reflect_get_type_registration.is_some() + pub(crate) fn missing_bevy_traits(&self) -> Vec<&'static str> { + let mut missing = Vec::new(); + if self.bevy_reflect_reflect.is_none() { + missing.extend(DEF_PATHS_REFLECT); + } + if self.bevy_reflect_get_type_registration.is_none() { + missing.extend(DEF_PATHS_GET_TYPE_REGISTRATION); + } + missing } // pub(crate) fn has_all_std_source_traits(&self) -> bool { diff --git a/crates/bevy_api_gen/src/modifying_file_loader.rs b/crates/bevy_api_gen/src/modifying_file_loader.rs index c0028179e6..4a302adf68 100644 --- a/crates/bevy_api_gen/src/modifying_file_loader.rs +++ b/crates/bevy_api_gen/src/modifying_file_loader.rs @@ -27,9 +27,15 @@ impl FileLoader for ModifyingFileLoader { ); RealFileLoader.read_file(path).map(|mut f| { // we make it pub so in case we are re-exporting this crate we won't run into private re-export issues - - for crate_ in &["bevy_reflect", "bevy_mod_scripting_core"] { - if !f.contains(&format!("extern crate {crate_}")) { + for (crate_, excluded_files) in &[ + ("bevy_reflect", vec!["crates/bevy_reflect/src/lib.rs"]), + ("bevy_mod_scripting_core", vec![]), + ] { + if !f.contains(&format!("extern crate {crate_}")) + && !excluded_files + .iter() + .any(|s| path.to_str().unwrap().contains(s)) + { if f.contains(&format!("pub use {crate_}")) { f.push_str(&format!( "#[allow(unused_extern_crates)] pub extern crate {crate_};" diff --git a/crates/bevy_api_gen/src/passes/cache_traits.rs b/crates/bevy_api_gen/src/passes/cache_traits.rs index d912591165..8ae7b90ca0 100644 --- a/crates/bevy_api_gen/src/passes/cache_traits.rs +++ b/crates/bevy_api_gen/src/passes/cache_traits.rs @@ -8,7 +8,7 @@ use crate::{ DEF_PATHS_GET_TYPE_REGISTRATION, DEF_PATHS_REFLECT, STD_SOURCE_TRAITS, }; -fn dump_traits(tcx: &TyCtxt) -> String{ +fn dump_traits(tcx: &TyCtxt) -> String { let mut buffer = String::new(); for t in tcx.all_traits() { buffer.push_str(&tcx.def_path_str(t)); @@ -43,20 +43,24 @@ pub(crate) fn cache_traits(ctxt: &mut BevyCtxt<'_>, _args: &Args) -> bool { } } - if !ctxt.cached_traits.has_all_bms_traits() { + let missing_bevy_traits = ctxt.cached_traits.missing_bevy_traits(); + if !missing_bevy_traits.is_empty() { panic!( - "Could not find all bms traits in crate: {}. Available traits: {}", + "Could not find traits: [{}] in crate: {}, did bootstrapping go wrong? Available traits: {}", + missing_bevy_traits.join(", "), tcx.crate_name(LOCAL_CRATE), dump_traits(tcx) - ) + ); } - if !ctxt.cached_traits.has_all_bevy_traits() { + let missing_bms_traits = ctxt.cached_traits.missing_bms_traits(); + if !missing_bms_traits.is_empty() { panic!( - "Could not find all reflect traits in crate: {}, did bootstrapping go wrong?. Available traits: {}", + "Could not find traits: [{}] in crate: {}, did bootstrapping go wrong? Available traits: {}", + missing_bms_traits.join(", "), tcx.crate_name(LOCAL_CRATE), dump_traits(tcx) - ) + ); } // some crates specifically do not have std in scope via `#![no_std]` which means we do not care about these traits diff --git a/crates/bevy_mod_scripting_core/Cargo.toml b/crates/bevy_mod_scripting_core/Cargo.toml index b94c1a88a3..5ce556108b 100644 --- a/crates/bevy_mod_scripting_core/Cargo.toml +++ b/crates/bevy_mod_scripting_core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_mod_scripting_core" -version = "0.12.0" +version = "0.13.0" authors = ["Maksymilian Mozolewski "] edition = "2021" license = "MIT OR Apache-2.0" @@ -29,19 +29,15 @@ mlua = { version = "0.10", default-features = false, optional = true } rhai = { version = "1.21", default-features = false, features = [ "sync", ], optional = true } -bevy = { workspace = true, default-features = false, features = ["bevy_asset"] } -thiserror = "1.0.31" +bevy = { workspace = true, default-features = false, features = ["bevy_asset", "std"] } parking_lot = "0.12.1" -dashmap = "6" smallvec = "1.11" -itertools = "0.13" -derivative = "2.2" +itertools = "0.14" profiling = { workspace = true } bevy_mod_scripting_derive = { workspace = true } fixedbitset = "0.5" -petgraph = "0.6" -bevy_mod_debugdump = "0.12" bevy_system_reflection = { path = "../bevy_system_reflection", version = "0.1.1" } +variadics_please = "1.1.0" [dev-dependencies] test_utils = { workspace = true } diff --git a/crates/bevy_mod_scripting_core/src/asset.rs b/crates/bevy_mod_scripting_core/src/asset.rs index f3135f55b4..6a19209277 100644 --- a/crates/bevy_mod_scripting_core/src/asset.rs +++ b/crates/bevy_mod_scripting_core/src/asset.rs @@ -1,24 +1,24 @@ //! Systems and resources for handling script assets and events -use crate::{ - commands::{CreateOrUpdateScript, DeleteScript}, - error::ScriptError, - script::ScriptId, - IntoScriptPluginParams, ScriptingSystemSet, -}; +use std::borrow::Cow; + use bevy::{ app::{App, PreUpdate}, asset::{Asset, AssetEvent, AssetId, AssetLoader, AssetPath, Assets}, - ecs::system::Resource, log::{debug, info, trace, warn}, + platform::collections::HashMap, prelude::{ - Commands, Event, EventReader, EventWriter, IntoSystemConfigs, IntoSystemSetConfigs, Res, - ResMut, + Commands, Event, EventReader, EventWriter, IntoScheduleConfigs, Res, ResMut, Resource, }, reflect::TypePath, - utils::hashbrown::HashMap, }; -use std::borrow::Cow; + +use crate::{ + commands::{CreateOrUpdateScript, DeleteScript}, + error::ScriptError, + script::ScriptId, + IntoScriptPluginParams, ScriptingSystemSet, +}; /// Represents a scripting language. Languages which compile into another language should use the target language as their language. #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Default)] @@ -239,7 +239,7 @@ pub(crate) fn dispatch_script_asset_events( language, }; debug!("Script loaded, populating metadata: {:?}:", metadata); - script_asset_events.send(ScriptAssetEvent::Added(metadata.clone())); + script_asset_events.write(ScriptAssetEvent::Added(metadata.clone())); metadata_store.insert(*id, metadata); } else { warn!("A script was added but it's asset was not found, failed to compute metadata. This script will not be loaded. Did you forget to store `Handle` somewhere?. {}", id); @@ -249,7 +249,7 @@ pub(crate) fn dispatch_script_asset_events( AssetEvent::Removed { id } => { if let Some(metadata) = metadata_store.get(*id) { debug!("Script removed: {:?}", metadata); - script_asset_events.send(ScriptAssetEvent::Removed(metadata.clone())); + script_asset_events.write(ScriptAssetEvent::Removed(metadata.clone())); } else { warn!("Script metadata not found for removed script asset: {}. Cannot properly clean up script", id); } @@ -257,7 +257,7 @@ pub(crate) fn dispatch_script_asset_events( AssetEvent::Modified { id } => { if let Some(metadata) = metadata_store.get(*id) { debug!("Script modified: {:?}", metadata); - script_asset_events.send(ScriptAssetEvent::Modified(metadata.clone())); + script_asset_events.write(ScriptAssetEvent::Modified(metadata.clone())); } else { warn!("Script metadata not found for modified script asset: {}. Cannot properly update script", id); } @@ -580,9 +580,9 @@ mod tests { struct DummyPlugin; impl IntoScriptPluginParams for DummyPlugin { - type R = (); - type C = (); const LANGUAGE: Language = Language::Lua; + type C = (); + type R = (); fn build_runtime() -> Self::R {} } diff --git a/crates/bevy_mod_scripting_core/src/bindings/access_map.rs b/crates/bevy_mod_scripting_core/src/bindings/access_map.rs index cf91e5bced..d4a290fab0 100644 --- a/crates/bevy_mod_scripting_core/src/bindings/access_map.rs +++ b/crates/bevy_mod_scripting_core/src/bindings/access_map.rs @@ -4,8 +4,8 @@ use std::hash::{BuildHasherDefault, Hasher}; use bevy::{ ecs::{component::ComponentId, world::unsafe_world_cell::UnsafeWorldCell}, + platform::collections::{HashMap, HashSet}, prelude::Resource, - utils::hashbrown::{HashMap, HashSet}, }; use parking_lot::Mutex; use smallvec::SmallVec; diff --git a/crates/bevy_mod_scripting_core/src/bindings/allocator.rs b/crates/bevy_mod_scripting_core/src/bindings/allocator.rs index c37acdb943..9feb3c2454 100644 --- a/crates/bevy_mod_scripting_core/src/bindings/allocator.rs +++ b/crates/bevy_mod_scripting_core/src/bindings/allocator.rs @@ -1,12 +1,13 @@ //! An allocator used to control the lifetime of allocations +use bevy::prelude::Resource; use bevy::{ app::{App, Plugin, PostUpdate}, diagnostic::{Diagnostic, DiagnosticPath, Diagnostics, RegisterDiagnostic}, - ecs::system::{Res, Resource}, + ecs::system::Res, + platform::collections::HashMap, prelude::ResMut, reflect::PartialReflect, - utils::hashbrown::HashMap, }; use parking_lot::{RwLock, RwLockReadGuard, RwLockWriteGuard}; use std::{ diff --git a/crates/bevy_mod_scripting_core/src/bindings/function/from.rs b/crates/bevy_mod_scripting_core/src/bindings/function/from.rs index 0852840708..c07b25921c 100644 --- a/crates/bevy_mod_scripting_core/src/bindings/function/from.rs +++ b/crates/bevy_mod_scripting_core/src/bindings/function/from.rs @@ -585,4 +585,4 @@ macro_rules! impl_from_script_tuple { }; } -bevy::utils::all_tuples!(impl_from_script_tuple, 1, 14, T); +variadics_please::all_tuples!(impl_from_script_tuple, 1, 14, T); diff --git a/crates/bevy_mod_scripting_core/src/bindings/function/into.rs b/crates/bevy_mod_scripting_core/src/bindings/function/into.rs index fd1fb88e9b..fd48053c1e 100644 --- a/crates/bevy_mod_scripting_core/src/bindings/function/into.rs +++ b/crates/bevy_mod_scripting_core/src/bindings/function/into.rs @@ -199,4 +199,4 @@ macro_rules! impl_into_script_tuple { } } -bevy::utils::all_tuples!(impl_into_script_tuple, 1, 14, T); +variadics_please::all_tuples!(impl_into_script_tuple, 1, 14, T); diff --git a/crates/bevy_mod_scripting_core/src/bindings/function/script_function.rs b/crates/bevy_mod_scripting_core/src/bindings/function/script_function.rs index aeaaa5b081..dbcfad6640 100644 --- a/crates/bevy_mod_scripting_core/src/bindings/function/script_function.rs +++ b/crates/bevy_mod_scripting_core/src/bindings/function/script_function.rs @@ -10,8 +10,8 @@ use crate::{ error::InteropError, ScriptValue, }; +use bevy::platform::collections::HashMap; use bevy::prelude::{Reflect, Resource}; -use bevy::utils::hashbrown::HashMap; use parking_lot::{RwLock, RwLockReadGuard, RwLockWriteGuard}; use std::borrow::Cow; use std::collections::VecDeque; @@ -622,13 +622,13 @@ macro_rules! impl_script_function { }; } -bevy::utils::all_tuples!(impl_script_function, 0, 13, T); +variadics_please::all_tuples!(impl_script_function, 0, 13, T); #[cfg(test)] mod test { - use super::*; + use super::*; - fn with_local_world(f: F) { + fn with_local_world(f: F) { let mut world = bevy::prelude::World::default(); WorldGuard::with_static_guard(&mut world, |world| { ThreadWorldContainer.set_world(world).unwrap(); diff --git a/crates/bevy_mod_scripting_core/src/bindings/function/type_dependencies.rs b/crates/bevy_mod_scripting_core/src/bindings/function/type_dependencies.rs index 0bc1bf0a3f..e02dc601af 100644 --- a/crates/bevy_mod_scripting_core/src/bindings/function/type_dependencies.rs +++ b/crates/bevy_mod_scripting_core/src/bindings/function/type_dependencies.rs @@ -1,11 +1,11 @@ //! This module contains the [`GetTypeDependencies`] trait and its implementations for various types. use super::{ - from::{Mut, Ref, Union, Val}, - script_function::FunctionCallContext, DynamicScriptFunction, DynamicScriptFunctionMut, + from::{Mut, Ref, Union, Val}, + script_function::FunctionCallContext, DynamicScriptFunction, DynamicScriptFunctionMut, }; use crate::{ - bindings::{ReflectReference, ScriptValue}, error::InteropError} + bindings::{ReflectReference, ScriptValue}, error::InteropError} ; use bevy::reflect::{FromReflect, GetTypeRegistration, TypeRegistry, Typed}; use bevy_mod_scripting_derive::impl_get_type_dependencies; @@ -156,7 +156,7 @@ macro_rules! register_tuple_dependencies { } -bevy::utils::all_tuples!(register_tuple_dependencies, 1, 14, T); +variadics_please::all_tuples!(register_tuple_dependencies, 1, 14, T); /// A trait collecting type dependency information for a whole function. Used to register everything used by a function with the type registry pub trait GetFunctionTypeDependencies { @@ -184,4 +184,4 @@ macro_rules! impl_script_function_type_dependencies{ }; } -bevy::utils::all_tuples!(impl_script_function_type_dependencies, 0, 13, T); +variadics_please::all_tuples!(impl_script_function_type_dependencies, 0, 13, T); diff --git a/crates/bevy_mod_scripting_core/src/bindings/globals/mod.rs b/crates/bevy_mod_scripting_core/src/bindings/globals/mod.rs index 42f4d2de80..49e329e5ba 100644 --- a/crates/bevy_mod_scripting_core/src/bindings/globals/mod.rs +++ b/crates/bevy_mod_scripting_core/src/bindings/globals/mod.rs @@ -1,15 +1,15 @@ //! Contains abstractions for exposing "globals" to scripts, in a language-agnostic way. use super::{ - function::arg_meta::{ScriptReturn, TypedScriptReturn}, - script_value::ScriptValue, - WorldGuard, + function::arg_meta::{ScriptReturn, TypedScriptReturn}, + script_value::ScriptValue, + WorldGuard, }; use crate::{ - docgen::{into_through_type_info, typed_through::ThroughTypeInfo}, - error::InteropError, + docgen::{into_through_type_info, typed_through::ThroughTypeInfo}, + error::InteropError, }; -use bevy::{ecs::system::Resource, reflect::Typed, utils::hashbrown::HashMap}; +use bevy::{platform::collections::HashMap, prelude::Resource, reflect::Typed}; use parking_lot::{RwLock, RwLockReadGuard, RwLockWriteGuard}; use std::{any::TypeId, borrow::Cow, sync::Arc}; @@ -235,11 +235,11 @@ impl ScriptGlobalsRegistry { #[cfg(test)] mod test { - use bevy::ecs::world::World; + use bevy::ecs::world::World; - use super::*; + use super::*; - #[test] + #[test] fn test_script_globals_registry() { let mut registry = ScriptGlobalsRegistry::default(); diff --git a/crates/bevy_mod_scripting_core/src/bindings/reference.rs b/crates/bevy_mod_scripting_core/src/bindings/reference.rs index 9df1e2fbdc..ca5091a5b5 100644 --- a/crates/bevy_mod_scripting_core/src/bindings/reference.rs +++ b/crates/bevy_mod_scripting_core/src/bindings/reference.rs @@ -214,7 +214,7 @@ impl ReflectReference { self.with_reflect(world.clone(), |r| { ::from_reflect_or_clone(r, world.clone()) - }) + })? } /// The way to access the value of the reference, that is the pointed-to value. @@ -503,7 +503,7 @@ impl ReflectBase { match self { ReflectBase::Component(entity, component_id) => { // Safety: the caller ensures invariants hold - world.get_entity(entity)?.get_by_id(component_id) + world.get_entity(entity).ok()?.get_by_id(component_id) } ReflectBase::Resource(component_id) => { // Safety: the caller ensures invariants hold @@ -522,7 +522,7 @@ impl ReflectBase { match self { ReflectBase::Component(entity, component_id) => { // Safety: the caller ensures invariants hold - world.get_entity(entity)?.get_mut_by_id(component_id) + world.get_entity(entity).ok()?.get_mut_by_id(component_id) } ReflectBase::Resource(component_id) => { // Safety: the caller ensures invariants hold diff --git a/crates/bevy_mod_scripting_core/src/bindings/schedule.rs b/crates/bevy_mod_scripting_core/src/bindings/schedule.rs index 061029a46a..8feff1cc98 100644 --- a/crates/bevy_mod_scripting_core/src/bindings/schedule.rs +++ b/crates/bevy_mod_scripting_core/src/bindings/schedule.rs @@ -3,15 +3,15 @@ use super::{script_system::ScriptSystemBuilder, WorldAccessGuard}; use crate::{error::InteropError, IntoScriptPluginParams}; use bevy::{ - app::{ - First, FixedFirst, FixedLast, FixedMain, FixedPostUpdate, FixedPreUpdate, FixedUpdate, - Last, PostStartup, PostUpdate, PreStartup, PreUpdate, RunFixedMainLoop, Startup, Update, - }, - ecs::{ - schedule::{Schedule, ScheduleLabel, Schedules}, - system::Resource, - world::World, - }, + app::{ + First, FixedFirst, FixedLast, FixedMain, FixedPostUpdate, FixedPreUpdate, FixedUpdate, + Last, PostStartup, PostUpdate, PreStartup, PreUpdate, RunFixedMainLoop, Startup, Update, + }, + ecs::{ + schedule::{Schedule, ScheduleLabel, Schedules}, + world::World, + }, + prelude::Resource, }; use bevy_system_reflection::{ReflectSchedule, ReflectSystem}; use parking_lot::RwLock; @@ -191,19 +191,18 @@ impl WorldAccessGuard<'_> { reason = "tests are there but not working currently" )] mod tests { - - use bevy::{ - app::{App, Update}, - ecs::{ - schedule::{NodeId, Schedules}, - system::IntoSystem, - }, - }; - use test_utils::make_test_plugin; - - use super::*; - - #[test] + use bevy::{ + app::Update, + ecs::{ + schedule::{NodeId, Schedules}, + system::IntoSystem, + }, + }; + use test_utils::make_test_plugin; + + use super::*; + + #[test] fn test_schedule_registry() { let mut registry = ScheduleRegistry::default(); registry.register(Update); @@ -342,7 +341,7 @@ mod tests { // Collect all edges as (from, to) name pairs. let mut found_edges = Vec::new(); - for (from, to, _) in graph.dependency().graph().all_edges() { + for (from, to) in graph.dependency().graph().all_edges() { let name_from = resolve_name(from); let name_to = resolve_name(to); found_edges.push((name_from, name_to)); diff --git a/crates/bevy_mod_scripting_core/src/bindings/script_component.rs b/crates/bevy_mod_scripting_core/src/bindings/script_component.rs index 74243b29a3..b1a0c650f0 100644 --- a/crates/bevy_mod_scripting_core/src/bindings/script_component.rs +++ b/crates/bevy_mod_scripting_core/src/bindings/script_component.rs @@ -3,13 +3,11 @@ use super::{ScriptComponentRegistration, ScriptTypeRegistration, ScriptValue, WorldAccessGuard}; use crate::error::InteropError; use bevy::{ - app::{App, Plugin}, - ecs::{ - component::{Component, ComponentDescriptor, StorageType}, - system::Resource, - }, - reflect::{prelude::ReflectDefault, GetTypeRegistration, Reflect}, - utils::HashMap, + app::{App, Plugin}, + ecs::component::{Component, ComponentDescriptor, StorageType, ComponentCloneBehavior, Mutable}, + platform::collections::HashMap, + prelude::Resource, + reflect::{prelude::ReflectDefault, GetTypeRegistration, Reflect}, }; use parking_lot::RwLock; use std::{alloc::Layout, mem::needs_drop, sync::Arc}; @@ -31,6 +29,7 @@ pub struct DynamicComponentInfo { impl Component for DynamicComponent { const STORAGE_TYPE: StorageType = StorageType::Table; + type Mutability = Mutable; } /// A registry of dynamically registered script components @@ -96,6 +95,8 @@ impl WorldAccessGuard<'_> { DynamicComponent::STORAGE_TYPE, Layout::new::(), needs_drop::().then_some(|x| x.drop_as::()), + true, + ComponentCloneBehavior::Default, ) }; w.register_component_with_descriptor(descriptor) @@ -135,10 +136,10 @@ impl Plugin for DynamicScriptComponentPlugin { #[cfg(test)] mod test { - use super::*; - use bevy::ecs::world::World; + use super::*; + use bevy::ecs::world::World; - #[test] + #[test] fn test_script_component() { let mut world = World::new(); let registration = { diff --git a/crates/bevy_mod_scripting_core/src/bindings/script_system.rs b/crates/bevy_mod_scripting_core/src/bindings/script_system.rs index c523b0d231..1eed73acba 100644 --- a/crates/bevy_mod_scripting_core/src/bindings/script_system.rs +++ b/crates/bevy_mod_scripting_core/src/bindings/script_system.rs @@ -27,15 +27,19 @@ use bevy::{ entity::Entity, query::{Access, FilteredAccess, FilteredAccessSet, QueryState}, reflect::AppTypeRegistry, - schedule::{IntoSystemConfigs, SystemSet}, - system::{IntoSystem, System}, + schedule::{ + SystemSet, Infallible + }, + system::{IntoSystem, System, SystemParamValidationError}, world::{unsafe_world_cell::UnsafeWorldCell, World}, }, + platform::collections::HashSet, + prelude::{BevyError, IntoScheduleConfigs}, reflect::{OffsetAccess, ParsedPath, Reflect}, - utils::hashbrown::HashSet, }; use bevy_system_reflection::{ReflectSchedule, ReflectSystem}; use std::{any::TypeId, borrow::Cow, hash::Hash, marker::PhantomData, ops::Deref}; + #[derive(Clone, Hash, PartialEq, Eq)] /// a system set for script systems. pub struct ScriptSystemSet(Cow<'static, str>); @@ -160,7 +164,7 @@ impl ScriptSystemBuilder { // this is quite important, by default systems are placed in a set defined by their TYPE, i.e. in this case // all script systems would be the same // let set = ScriptSystemSet::next(); - let mut system_config = IntoSystemConfigs::>::into_configs(self); // apply ordering + let mut system_config = > + 'static)>, (Infallible, IsDynamicScriptSystem

)>>::into_configs(self); // apply ordering for (other, is_before) in before_systems .into_iter() .map(|b| (b, true)) @@ -170,7 +174,8 @@ impl ScriptSystemBuilder { if is_before { bevy::log::info!("before {default_set:?}"); system_config = system_config.before(*default_set); - } else { bevy::log::info!("before {default_set:?}"); + } else { + bevy::log::info!("before {default_set:?}"); bevy::log::info!("after {default_set:?}"); system_config = system_config.after(*default_set); } @@ -642,9 +647,9 @@ impl System for DynamicScriptSystem

{ unsafe fn validate_param_unsafe( &mut self, - _world: bevy::ecs::world::unsafe_world_cell::UnsafeWorldCell, - ) -> bool { - true + _world: UnsafeWorldCell, + ) -> Result<(), SystemParamValidationError> { + Ok(()) } fn default_system_sets(&self) -> Vec { @@ -655,7 +660,7 @@ impl System for DynamicScriptSystem

{ TypeId::of::() } - fn validate_param(&mut self, world: &World) -> bool { + fn validate_param(&mut self, world: &World) -> Result<(), SystemParamValidationError> { let world_cell = world.as_unsafe_world_cell_readonly(); self.update_archetype_component_access(world_cell); // SAFETY: diff --git a/crates/bevy_mod_scripting_core/src/bindings/world.rs b/crates/bevy_mod_scripting_core/src/bindings/world.rs index c88dc84f61..7c061d2d19 100644 --- a/crates/bevy_mod_scripting_core/src/bindings/world.rs +++ b/crates/bevy_mod_scripting_core/src/bindings/world.rs @@ -29,16 +29,18 @@ use crate::{ error::InteropError, reflection_extensions::PartialReflectExt, }; +use bevy::ecs::component::Mutable; +use bevy::prelude::{ChildOf, Children}; use bevy::{ app::AppExit, ecs::{ component::{Component, ComponentId}, entity::Entity, + prelude::Resource, reflect::{AppTypeRegistry, ReflectFromWorld, ReflectResource}, - system::{Commands, Resource}, + system::Commands, world::{unsafe_world_cell::UnsafeWorldCell, CommandQueue, Mut, World}, }, - hierarchy::{BuildChildren, Children, DespawnRecursiveExt, Parent}, reflect::{ std_traits::ReflectDefault, DynamicEnum, DynamicStruct, DynamicTuple, DynamicTupleStruct, DynamicVariant, ParsedPath, PartialReflect, TypeRegistryArc, @@ -446,7 +448,7 @@ impl<'w> WorldAccessGuard<'w> { format!("Could not access component: {}", std::any::type_name::()), { // Safety: we have acquired access for the duration of the closure - f(unsafe { cell.get_entity(entity).and_then(|e| e.get::()) }) + f(unsafe { cell.get_entity(entity).map(|e| e.get::()) }.ok().unwrap_or(None)) } ) } @@ -454,7 +456,7 @@ impl<'w> WorldAccessGuard<'w> { /// Safely accesses the component by claiming and releasing access to it. pub fn with_component_mut(&self, entity: Entity, f: F) -> Result where - T: Component, + T: Component, F: FnOnce(Option>) -> O, { let cell = self.as_unsafe_world_cell()?; @@ -466,7 +468,7 @@ impl<'w> WorldAccessGuard<'w> { format!("Could not access component: {}", std::any::type_name::()), { // Safety: we have acquired access for the duration of the closure - f(unsafe { cell.get_entity(entity).and_then(|e| e.get_mut::()) }) + f(unsafe { cell.get_entity(entity).map(|e| e.get_mut::()) }.ok().unwrap_or(None)) } ) } @@ -478,7 +480,7 @@ impl<'w> WorldAccessGuard<'w> { f: F, ) -> Result where - T: Component + Default, + T: Component + Default, F: FnOnce(&mut T) -> O, { self.with_global_access(|world| match world.get_mut::(entity) { @@ -536,7 +538,7 @@ impl<'w> WorldAccessGuard<'w> { /// checks if a given entity exists and is valid pub fn is_valid_entity(&self, entity: Entity) -> Result { let cell = self.as_unsafe_world_cell()?; - Ok(cell.get_entity(entity).is_some() && entity.index() != 0) + Ok(cell.get_entity(entity).is_ok() && entity.index() != 0) } /// Tries to call a fitting overload of the function with the given name and in the type id's namespace based on the arguments provided. @@ -816,10 +818,10 @@ impl WorldAccessGuard<'_> { // try to construct type from reflect // TODO: it would be nice to have a ::from_reflect_with_fallback equivalent, that does exactly that // only using this as it's already there and convenient, the clone variant hitting will be confusing to end users - Ok(::from_reflect_or_clone( + ::from_reflect_or_clone( dynamic.as_ref(), self.clone(), - )) + ) } /// Spawns a new entity in the world @@ -989,7 +991,7 @@ impl WorldAccessGuard<'_> { let cell = self.as_unsafe_world_cell()?; let entity = cell .get_entity(entity) - .ok_or_else(|| InteropError::missing_entity(entity))?; + .map_err(|_| InteropError::missing_entity(entity))?; if entity.contains_id(component_registration.component_id) { Ok(Some(ReflectReference { @@ -1016,7 +1018,7 @@ impl WorldAccessGuard<'_> { let cell = self.as_unsafe_world_cell()?; let entity = cell .get_entity(entity) - .ok_or_else(|| InteropError::missing_entity(entity))?; + .map_err(|_| InteropError::missing_entity(entity))?; Ok(entity.contains_id(component_id)) } @@ -1111,7 +1113,7 @@ impl WorldAccessGuard<'_> { return Err(InteropError::missing_entity(entity)); } - self.with_component(entity, |c: Option<&Parent>| c.map(|c| c.get())) + self.with_component(entity, |c: Option<&ChildOf>| c.map(|c| c.parent())) } /// insert children into the given entity @@ -1185,7 +1187,7 @@ impl WorldAccessGuard<'_> { self.with_global_access(|world| { let mut queue = CommandQueue::default(); let mut commands = Commands::new(&mut queue, world); - commands.entity(parent).despawn_recursive(); + commands.entity(parent).despawn(); queue.apply(world); }) } @@ -1199,7 +1201,7 @@ impl WorldAccessGuard<'_> { self.with_global_access(|world| { let mut queue = CommandQueue::default(); let mut commands = Commands::new(&mut queue, world); - commands.entity(entity).despawn(); + commands.entity(entity).remove::().despawn(); queue.apply(world); }) } @@ -1213,7 +1215,7 @@ impl WorldAccessGuard<'_> { self.with_global_access(|world| { let mut queue = CommandQueue::default(); let mut commands = Commands::new(&mut queue, world); - commands.entity(parent).despawn_descendants(); + commands.entity(parent).despawn_related::(); queue.apply(world); }) } diff --git a/crates/bevy_mod_scripting_core/src/context.rs b/crates/bevy_mod_scripting_core/src/context.rs index dec993f7be..6d8fe65f6f 100644 --- a/crates/bevy_mod_scripting_core/src/context.rs +++ b/crates/bevy_mod_scripting_core/src/context.rs @@ -6,7 +6,10 @@ use crate::{ script::ScriptId, IntoScriptPluginParams, }; -use bevy::ecs::{entity::Entity, system::Resource}; +use bevy::{ + ecs::entity::Entity, + prelude::Resource +}; /// A trait that all script contexts must implement. /// diff --git a/crates/bevy_mod_scripting_core/src/docgen/info.rs b/crates/bevy_mod_scripting_core/src/docgen/info.rs index b6a9ce5ae1..949286c0d3 100644 --- a/crates/bevy_mod_scripting_core/src/docgen/info.rs +++ b/crates/bevy_mod_scripting_core/src/docgen/info.rs @@ -191,18 +191,18 @@ macro_rules! impl_documentable { }; } -bevy::utils::all_tuples!(impl_documentable, 0, 13, T); +variadics_please::all_tuples!(impl_documentable, 0, 13, T); #[cfg(test)] mod test { - use crate::{ - bindings::function::from::{Mut, Ref, Val}, - docgen::typed_through::UntypedWrapperKind, - }; + use crate::{ + bindings::function::from::{Mut, Ref, Val}, + docgen::typed_through::UntypedWrapperKind, + }; - use super::*; + use super::*; - #[test] + #[test] fn test_get_function_info() { fn test_fn(a: i32, b: f32) -> f64 { (a as f64) + (b as f64) diff --git a/crates/bevy_mod_scripting_core/src/docgen/typed_through.rs b/crates/bevy_mod_scripting_core/src/docgen/typed_through.rs index 7e467b6180..694711af35 100644 --- a/crates/bevy_mod_scripting_core/src/docgen/typed_through.rs +++ b/crates/bevy_mod_scripting_core/src/docgen/typed_through.rs @@ -6,18 +6,18 @@ use std::{ffi::OsString, path::PathBuf}; use bevy::reflect::{TypeInfo, Typed}; use crate::{ - bindings::{ - function::{ - from::{Mut, Ref, Union, Val}, - script_function::{ - DynamicScriptFunction, DynamicScriptFunctionMut, FunctionCallContext, - }, - }, - script_value::ScriptValue, - ReflectReference, - }, - error::InteropError, - reflection_extensions::TypeInfoExtensions, + bindings::{ + function::{ + from::{Mut, Ref, Union, Val}, + script_function::{ + DynamicScriptFunction, DynamicScriptFunctionMut, FunctionCallContext, + }, + }, + script_value::ScriptValue, + ReflectReference, + }, + error::InteropError, + reflection_extensions::TypeInfoExtensions, }; /// All Through types follow one rule: @@ -265,13 +265,13 @@ macro_rules! impl_through_typed_tuple { }; } -bevy::utils::all_tuples!(impl_through_typed_tuple, 0, 13, T); +variadics_please::all_tuples!(impl_through_typed_tuple, 0, 13, T); #[cfg(test)] mod test { - use super::*; + use super::*; - fn assert_type_info_is_through() { + fn assert_type_info_is_through() { let type_info = T::type_info(); let through_type_info = T::through_type_info(); diff --git a/crates/bevy_mod_scripting_core/src/extractors.rs b/crates/bevy_mod_scripting_core/src/extractors.rs index d105cca7b5..5b1f0c9d12 100644 --- a/crates/bevy_mod_scripting_core/src/extractors.rs +++ b/crates/bevy_mod_scripting_core/src/extractors.rs @@ -4,14 +4,17 @@ #![allow(deprecated)] use std::ops::{Deref, DerefMut}; -use bevy::ecs::{ - component::ComponentId, - entity::Entity, - event::{Event, EventCursor, EventIterator, Events}, - query::{Access, AccessConflicts}, - storage::SparseSetIndex, - system::{Local, Resource, SystemParam, SystemState}, - world::World, +use bevy::{ + ecs::{ + component::ComponentId, + entity::Entity, + event::{Event, EventCursor, EventIterator, Events}, + query::{Access, AccessConflicts}, + storage::SparseSetIndex, + system::{Local, SystemParam, SystemState, SystemParamValidationError}, + world::World, + }, + prelude::Resource }; use fixedbitset::FixedBitSet; @@ -365,7 +368,7 @@ unsafe impl SystemParam for WithWorldGuard<'_, '_, T> { state: &Self::State, system_meta: &bevy::ecs::system::SystemMeta, world: bevy::ecs::world::unsafe_world_cell::UnsafeWorldCell, - ) -> bool { + ) -> Result<(), SystemParamValidationError> { T::validate_param(&state.0, system_meta, world) } } @@ -417,9 +420,10 @@ mod test { ecs::{ component::Component, event::{Event, EventReader}, - system::{Query, ResMut, Resource}, + system::{Query, ResMut}, world::FromWorld, }, + prelude::Resource, }; use test_utils::make_test_plugin; diff --git a/crates/bevy_mod_scripting_core/src/handler.rs b/crates/bevy_mod_scripting_core/src/handler.rs index 322ea6adfb..37fcef7075 100644 --- a/crates/bevy_mod_scripting_core/src/handler.rs +++ b/crates/bevy_mod_scripting_core/src/handler.rs @@ -18,11 +18,11 @@ use bevy::{ ecs::{ entity::Entity, query::QueryState, - system::{Local, Resource, SystemState}, + system::{Local, SystemState}, world::{Mut, World}, }, log::trace_once, - prelude::{Events, Ref}, + prelude::{Events, Ref, Resource}, }; /// A function that handles a callback event diff --git a/crates/bevy_mod_scripting_core/src/reflection_extensions.rs b/crates/bevy_mod_scripting_core/src/reflection_extensions.rs index e923c33b3f..1ff32fb425 100644 --- a/crates/bevy_mod_scripting_core/src/reflection_extensions.rs +++ b/crates/bevy_mod_scripting_core/src/reflection_extensions.rs @@ -4,11 +4,14 @@ use crate::{ bindings::{ReflectReference, WorldGuard}, error::InteropError, }; -use bevy::reflect::{PartialReflect, Reflect, ReflectFromReflect, ReflectMut, TypeInfo}; +use bevy::reflect::{ + PartialReflect, Reflect, ReflectFromReflect, ReflectMut, TypeInfo, +}; use std::{ any::{Any, TypeId}, cmp::max, }; + /// Extension trait for [`PartialReflect`] providing additional functionality for working with specific types. pub trait PartialReflectExt { /// Try to get a reference to the given key in an underyling map, if the type is a map. @@ -30,7 +33,7 @@ pub trait PartialReflectExt { fn from_reflect_or_clone( reflect: &dyn PartialReflect, world: WorldGuard, - ) -> Box; + ) -> Result, InteropError>; /// Allocate a new boxed reflect reference from a boxed reflect. fn allocate(boxed: Box, world: WorldGuard) -> ReflectReference; @@ -424,11 +427,19 @@ impl PartialReflectExt for T { fn from_reflect_or_clone( reflect: &dyn PartialReflect, world: WorldGuard, - ) -> Box { + ) -> Result, InteropError> { // try from reflect match ::from_reflect(reflect, world.clone()) { - Ok(v) => v.into_partial_reflect(), - Err(_) => reflect.clone_value(), + Ok(v) => Ok(v.into_partial_reflect()), + Err(_) => reflect + .reflect_clone() + .map(|v| v.into_partial_reflect()) + .map_err(|e| { + InteropError::failed_from_reflect( + reflect.get_represented_type_info().map(|ti| ti.type_id()), + e.to_string(), + ) + }), } } @@ -667,7 +678,7 @@ mod test { let mut map = std::collections::HashMap::>::default(); let value = DynamicMap::from_iter(vec![(1, 2), (2, 3), (3, 4)]); - let value_ref: Box = Box::new(value.clone_dynamic()); + let value_ref: Box = Box::new(value.to_dynamic_map()); map.insert(1, std::collections::HashMap::::default()); map.insert(2, std::collections::HashMap::::default()); map.insert(3, std::collections::HashMap::::default()); diff --git a/crates/bevy_mod_scripting_core/src/runtime.rs b/crates/bevy_mod_scripting_core/src/runtime.rs index 359a7a0c97..0f69158fed 100644 --- a/crates/bevy_mod_scripting_core/src/runtime.rs +++ b/crates/bevy_mod_scripting_core/src/runtime.rs @@ -3,8 +3,8 @@ use crate::{error::ScriptError, IntoScriptPluginParams}; use bevy::{ - ecs::system::{ResMut, Resource}, - prelude::Res, + ecs::system::{ResMut}, + prelude::{Res, Resource}, }; /// A trait that all script runtimes must implement. diff --git a/crates/bevy_mod_scripting_core/src/script.rs b/crates/bevy_mod_scripting_core/src/script.rs index d5b0fe46ae..dd29fdc22a 100644 --- a/crates/bevy_mod_scripting_core/src/script.rs +++ b/crates/bevy_mod_scripting_core/src/script.rs @@ -1,11 +1,17 @@ //! Script related types, functions and components -use crate::{asset::ScriptAsset, IntoScriptPluginParams}; -use bevy::prelude::ReflectComponent; -use bevy::{asset::Handle, ecs::system::Resource, reflect::Reflect, utils::HashSet}; -use parking_lot::Mutex; use std::{borrow::Cow, collections::HashMap, ops::Deref, sync::Arc}; +use bevy::{ + asset::Handle, + platform::collections::HashSet, + prelude::{ReflectComponent, Resource}, + reflect::Reflect, +}; +use parking_lot::Mutex; + +use crate::{asset::ScriptAsset, IntoScriptPluginParams}; + /// A unique identifier for a script, by default corresponds to the path of the asset excluding the asset source. /// /// I.e. an asset with the path `path/to/asset.ext` will have the script id `path/to/asset.ext` diff --git a/crates/bevy_mod_scripting_derive/Cargo.toml b/crates/bevy_mod_scripting_derive/Cargo.toml index 0f867cbf67..cd77066a16 100644 --- a/crates/bevy_mod_scripting_derive/Cargo.toml +++ b/crates/bevy_mod_scripting_derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_mod_scripting_derive" -version = "0.12.0" +version = "0.13.0" edition = "2021" authors = ["Maksymilian Mozolewski "] license = "MIT OR Apache-2.0" diff --git a/crates/bevy_mod_scripting_derive/src/derive/mod.rs b/crates/bevy_mod_scripting_derive/src/derive/mod.rs index b0363a2455..b2b1171376 100644 --- a/crates/bevy_mod_scripting_derive/src/derive/mod.rs +++ b/crates/bevy_mod_scripting_derive/src/derive/mod.rs @@ -9,8 +9,8 @@ use quote::{quote_spanned, ToTokens}; use syn::{Ident, ImplItemFn, ItemImpl}; pub use self::{ - get_type_dependencies::get_type_dependencies, into_script::into_script, - script_bindings::script_bindings, script_globals::script_globals, typed_through::typed_through, + get_type_dependencies::get_type_dependencies, into_script::into_script, + script_bindings::script_bindings, script_globals::script_globals, typed_through::typed_through, }; pub(crate) fn impl_fn_to_namespace_builder_registration(fun: &ImplItemFn) -> TokenStream { diff --git a/crates/bevy_mod_scripting_functions/Cargo.toml b/crates/bevy_mod_scripting_functions/Cargo.toml index e2ad1971a3..18433d6297 100644 --- a/crates/bevy_mod_scripting_functions/Cargo.toml +++ b/crates/bevy_mod_scripting_functions/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_mod_scripting_functions" -version = "0.12.0" +version = "0.13.0" edition = "2021" authors = ["Maksymilian Mozolewski "] license = "MIT OR Apache-2.0" @@ -28,13 +28,16 @@ rhai_bindings = ["bevy_mod_scripting_rhai"] [dependencies] bevy = { workspace = true } +bevy_math = { workspace = true, features = ["curve"]} +bevy_reflect = { workspace = true, features = ["smol_str"]} +bevy_input = { workspace = true, features = ["smol_str"]} profiling = { workspace = true } uuid = "1.11" smol_str = "0.2.2" bevy_mod_scripting_core = { workspace = true } bevy_mod_scripting_derive = { workspace = true } -bevy_mod_scripting_lua = { path = "../languages/bevy_mod_scripting_lua", optional = true, version = "0.12.0" } -bevy_mod_scripting_rhai = { path = "../languages/bevy_mod_scripting_rhai", optional = true, version = "0.12.0" } +bevy_mod_scripting_lua = { path = "../languages/bevy_mod_scripting_lua", optional = true, version = "0.13.0" } +bevy_mod_scripting_rhai = { path = "../languages/bevy_mod_scripting_rhai", optional = true, version = "0.13.0" } bevy_system_reflection = { path = "../bevy_system_reflection", version = "0.1.1" } [lints] diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_core.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_core.rs index 2d2e6ee754..f6466929c0 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_core.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_core.rs @@ -2,15 +2,8 @@ #![allow(clippy::all)] #![allow(unused, deprecated, dead_code)] #![cfg_attr(rustfmt, rustfmt_skip)] -use bevy_mod_scripting_core::bindings::{ - ReflectReference, - function::{ - from::{Ref, Mut, Val}, - namespace::NamespaceBuilder, - }, -}; +use bevy_mod_scripting_core::bindings::function::from::{Ref, Val}; use bevy_mod_scripting_derive::script_bindings; -use crate::*; pub struct BevyCoreScriptingPlugin; #[script_bindings( remote, @@ -18,20 +11,20 @@ pub struct BevyCoreScriptingPlugin; bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::core::prelude::Name { - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( +impl bevy::prelude::Name { + fn clone(_self: Ref) -> Val { + let output: Val = ::clone( &_self, ) .into(); output } fn eq( - _self: Ref, - other: Ref, + _self: Ref, + other: Ref, ) -> bool { - let output: bool = >::eq(&_self, &other) .into(); output diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_ecs.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_ecs.rs index aabe3ae722..c752fdbf71 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_ecs.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_ecs.rs @@ -19,23 +19,6 @@ pub struct BevyEcsScriptingPlugin; generated )] impl bevy::ecs::entity::Entity { - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Reconstruct an `Entity` previously destructured with [`Entity::to_bits`]. /// Only useful when applied to results from `to_bits` in the same instance of an application. /// # Panics @@ -88,6 +71,61 @@ impl bevy::ecs::entity::Entity { output } } +#[script_bindings( + remote, + name = "child_of_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::ecs::hierarchy::ChildOf { + /// The parent entity of this child entity. + fn get(_self: Ref) -> Val { + let output: Val = bevy::ecs::hierarchy::ChildOf::get( + &_self, + ) + .into(); + output + } + /// The parent entity of this child entity. + fn parent( + _self: Ref, + ) -> Val { + let output: Val = bevy::ecs::hierarchy::ChildOf::parent( + &_self, + ) + .into(); + output + } +} +#[script_bindings( + remote, + name = "children_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::ecs::hierarchy::Children { + /// Swaps the child at `a_index` with the child at `b_index`. + fn swap( + mut _self: Mut, + a_index: usize, + b_index: usize, + ) -> () { + let output: () = bevy::ecs::hierarchy::Children::swap( + &mut _self, + a_index, + b_index, + ) + .into(); + output + } +} +#[script_bindings( + remote, + name = "name_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::ecs::name::Name {} #[script_bindings( remote, name = "on_add_functions", @@ -123,32 +161,6 @@ impl bevy::ecs::world::OnReplace {} generated )] impl bevy::ecs::component::ComponentId { - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Returns the index of the current component. fn index(_self: Val) -> usize { let output: usize = bevy::ecs::component::ComponentId::index(_self.into_inner()) @@ -168,35 +180,46 @@ impl bevy::ecs::component::ComponentId { } #[script_bindings( remote, - name = "tick_functions", + name = "default_query_filters_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::ecs::component::Tick { - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) +impl bevy::ecs::entity_disabling::DefaultQueryFilters { + /// Creates a new, completely empty [`DefaultQueryFilters`]. + /// This is provided as an escape hatch; in most cases you should initialize this using [`FromWorld`], + /// which is automatically called when creating a new [`World`]. + fn empty() -> Val { + let output: Val = bevy::ecs::entity_disabling::DefaultQueryFilters::empty() .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, + /// Adds this [`ComponentId`] to the set of [`DefaultQueryFilters`], + /// causing entities with this component to be excluded from queries. + /// This method is idempotent, and will not add the same component multiple times. + /// # Warning + /// This method should only be called before the app starts, as it will not affect queries + /// initialized before it is called. + /// As discussed in the [module docs](crate::entity_disabling), this can have performance implications, + /// as well as create interoperability issues, and should be used with caution. + fn register_disabling_component( + mut _self: Mut, + component_id: Val, + ) -> () { + let output: () = bevy::ecs::entity_disabling::DefaultQueryFilters::register_disabling_component( + &mut _self, + component_id.into_inner(), ) .into(); output } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } +} +#[script_bindings( + remote, + name = "tick_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::ecs::component::Tick { /// Gets the value of this change tick. fn get(_self: Val) -> u32 { let output: u32 = bevy::ecs::component::Tick::get(_self.into_inner()).into(); @@ -238,15 +261,6 @@ impl bevy::ecs::component::Tick { generated )] impl bevy::ecs::component::ComponentTicks { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns `true` if the component or resource was added after the system last ran /// (or the system is running for the first time). fn is_added( @@ -288,7 +302,7 @@ impl bevy::ecs::component::ComponentTicks { output } /// Manually sets the change tick. - /// This is normally done automatically via the [`DerefMut`](std::ops::DerefMut) implementation + /// This is normally done automatically via the [`DerefMut`] implementation /// on [`Mut`](crate::change_detection::Mut), [`ResMut`](crate::change_detection::ResMut), etc. /// However, components and resources that make use of interior mutability might require manual updates. /// # Example @@ -312,30 +326,49 @@ impl bevy::ecs::component::ComponentTicks { } #[script_bindings( remote, - name = "identifier_functions", + name = "entity_hash_set_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::ecs::identifier::Identifier { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) +impl bevy::ecs::entity::hash_set::EntityHashSet { + /// Returns `true` if the set contains no elements. + fn is_empty(_self: Ref) -> bool { + let output: bool = bevy::ecs::entity::hash_set::EntityHashSet::is_empty(&_self) .into(); output } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) + /// Returns the number of elements in the set. + fn len(_self: Ref) -> usize { + let output: usize = bevy::ecs::entity::hash_set::EntityHashSet::len(&_self) + .into(); + output + } + /// Creates an empty `EntityHashSet`. + /// Equivalent to [`HashSet::with_hasher(EntityHash)`]. + /// [`HashSet::with_hasher(EntityHash)`]: HashSet::with_hasher + fn new() -> Val { + let output: Val = bevy::ecs::entity::hash_set::EntityHashSet::new() + .into(); + output + } + /// Creates an empty `EntityHashSet` with the specified capacity. + /// Equivalent to [`HashSet::with_capacity_and_hasher(n, EntityHash)`]. + /// [`HashSet::with_capacity_and_hasher(n, EntityHash)`]: HashSet::with_capacity_and_hasher + fn with_capacity(n: usize) -> Val { + let output: Val = bevy::ecs::entity::hash_set::EntityHashSet::with_capacity( + n, + ) .into(); output } +} +#[script_bindings( + remote, + name = "identifier_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::ecs::identifier::Identifier { /// Convert a `u64` into an [`Identifier`]. /// # Panics /// This method will likely panic if given `u64` values that did not come from [`Identifier::to_bits`]. @@ -374,34 +407,21 @@ impl bevy::ecs::identifier::Identifier { bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::ecs::entity::EntityHash { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } -} +impl bevy::ecs::entity::EntityHash {} +#[script_bindings( + remote, + name = "disabled_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::ecs::entity_disabling::Disabled {} #[script_bindings( remote, name = "removed_component_entity_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::ecs::removal_detection::RemovedComponentEntity { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } -} +impl bevy::ecs::removal_detection::RemovedComponentEntity {} #[script_bindings( remote, name = "system_id_marker_functions", @@ -409,20 +429,34 @@ impl bevy::ecs::removal_detection::RemovedComponentEntity { generated )] impl bevy::ecs::system::SystemIdMarker {} +#[script_bindings( + remote, + name = "on_despawn_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::ecs::world::OnDespawn {} impl ::bevy::app::Plugin for BevyEcsScriptingPlugin { fn build(&self, app: &mut ::bevy::prelude::App) { let mut world = app.world_mut(); register_entity_functions(&mut world); + register_child_of_functions(&mut world); + register_children_functions(&mut world); + register_name_functions(&mut world); register_on_add_functions(&mut world); register_on_insert_functions(&mut world); register_on_remove_functions(&mut world); register_on_replace_functions(&mut world); register_component_id_functions(&mut world); + register_default_query_filters_functions(&mut world); register_tick_functions(&mut world); register_component_ticks_functions(&mut world); + register_entity_hash_set_functions(&mut world); register_identifier_functions(&mut world); register_entity_hash_functions(&mut world); + register_disabled_functions(&mut world); register_removed_component_entity_functions(&mut world); register_system_id_marker_functions(&mut world); + register_on_despawn_functions(&mut world); } } diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_hierarchy.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_hierarchy.rs index 529c8c7f5d..373bff58bc 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_hierarchy.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_hierarchy.rs @@ -18,14 +18,14 @@ pub struct BevyHierarchyScriptingPlugin; bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::hierarchy::prelude::Children { +impl bevy::prelude::Children { /// Swaps the child at `a_index` with the child at `b_index`. fn swap( - mut _self: Mut, + mut _self: Mut, a_index: usize, b_index: usize, ) -> () { - let output: () = bevy::hierarchy::prelude::Children::swap( + let output: () = bevy::prelude::Children::swap( &mut _self, a_index, b_index, @@ -40,74 +40,39 @@ impl bevy::hierarchy::prelude::Children { bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::hierarchy::prelude::Parent { - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( +impl bevy::prelude::ChildOf { + fn assert_receiver_is_total_eq(_self: Ref) -> () { + let output: () = ::assert_receiver_is_total_eq( &_self, ) .into(); output } fn eq( - _self: Ref, - other: Ref, + _self: Ref, + other: Ref, ) -> bool { - let output: bool = >::eq(&_self, &other) .into(); output } /// Gets the [`Entity`] ID of the parent. fn get( - _self: Ref, + _self: Ref, ) -> Val { - let output: Val = bevy::hierarchy::prelude::Parent::get( + let output: Val = bevy::prelude::ChildOf::get( &_self, ) .into(); output } } -#[script_bindings( - remote, - name = "hierarchy_event_functions", - bms_core_path = "bevy_mod_scripting_core", - generated -)] -impl bevy::hierarchy::HierarchyEvent { - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} impl ::bevy::app::Plugin for BevyHierarchyScriptingPlugin { fn build(&self, app: &mut ::bevy::prelude::App) { let mut world = app.world_mut(); register_children_functions(&mut world); register_parent_functions(&mut world); - register_hierarchy_event_functions(&mut world); } } diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_input.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_input.rs index 712fa729dc..20bc13c6a6 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_input.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_input.rs @@ -19,7 +19,7 @@ pub struct BevyInputScriptingPlugin; generated )] impl bevy::input::gamepad::Gamepad { - /// Returns the directional pad as a [`Vec2`] + /// Returns the directional pad as a [`Vec2`]. fn dpad(_self: Ref) -> Val { let output: Val = bevy::input::gamepad::Gamepad::dpad(&_self) .into(); @@ -51,7 +51,7 @@ impl bevy::input::gamepad::Gamepad { .into(); output } - /// Returns the left stick as a [`Vec2`] + /// Returns the left stick as a [`Vec2`]. fn left_stick(_self: Ref) -> Val { let output: Val = bevy::input::gamepad::Gamepad::left_stick( &_self, @@ -75,14 +75,14 @@ impl bevy::input::gamepad::Gamepad { /// [vendor]: Self::vendor_id fn product_id( _self: Ref, - ) -> std::option::Option { - let output: std::option::Option = bevy::input::gamepad::Gamepad::product_id( + ) -> core::option::Option { + let output: core::option::Option = bevy::input::gamepad::Gamepad::product_id( &_self, ) .into(); output } - /// Returns the right stick as a [`Vec2`] + /// Returns the right stick as a [`Vec2`]. fn right_stick(_self: Ref) -> Val { let output: Val = bevy::input::gamepad::Gamepad::right_stick( &_self, @@ -91,8 +91,10 @@ impl bevy::input::gamepad::Gamepad { output } /// Returns the USB vendor ID as assigned by the USB-IF, if available. - fn vendor_id(_self: Ref) -> std::option::Option { - let output: std::option::Option = bevy::input::gamepad::Gamepad::vendor_id( + fn vendor_id( + _self: Ref, + ) -> core::option::Option { + let output: core::option::Option = bevy::input::gamepad::Gamepad::vendor_id( &_self, ) .into(); @@ -105,398 +107,91 @@ impl bevy::input::gamepad::Gamepad { bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::gamepad::GamepadAxis { - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::gamepad::GamepadAxis {} #[script_bindings( remote, name = "gamepad_button_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::gamepad::GamepadButton { - fn assert_receiver_is_total_eq( - _self: Ref, - ) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::gamepad::GamepadButton {} #[script_bindings( remote, name = "gamepad_settings_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::gamepad::GamepadSettings { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } -} +impl bevy::input::gamepad::GamepadSettings {} #[script_bindings( remote, name = "key_code_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::keyboard::KeyCode { - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::keyboard::KeyCode {} #[script_bindings( remote, name = "mouse_button_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::mouse::MouseButton { - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::mouse::MouseButton {} #[script_bindings( remote, name = "touch_input_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::touch::TouchInput { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::touch::TouchInput {} #[script_bindings( remote, name = "keyboard_focus_lost_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::keyboard::KeyboardFocusLost { - fn assert_receiver_is_total_eq( - _self: Ref, - ) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::keyboard::KeyboardFocusLost {} #[script_bindings( remote, name = "keyboard_input_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::keyboard::KeyboardInput { - fn assert_receiver_is_total_eq( - _self: Ref, - ) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::keyboard::KeyboardInput {} #[script_bindings( remote, name = "accumulated_mouse_motion_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::mouse::AccumulatedMouseMotion { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::mouse::AccumulatedMouseMotion {} #[script_bindings( remote, name = "accumulated_mouse_scroll_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::mouse::AccumulatedMouseScroll { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::mouse::AccumulatedMouseScroll {} #[script_bindings( remote, name = "mouse_button_input_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::mouse::MouseButtonInput { - fn assert_receiver_is_total_eq( - _self: Ref, - ) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::mouse::MouseButtonInput {} #[script_bindings( remote, name = "mouse_motion_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::mouse::MouseMotion { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::mouse::MouseMotion {} #[script_bindings( remote, name = "mouse_wheel_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::mouse::MouseWheel { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::mouse::MouseWheel {} #[script_bindings( remote, name = "gamepad_axis_changed_event_functions", @@ -504,26 +199,7 @@ impl bevy::input::mouse::MouseWheel { generated )] impl bevy::input::gamepad::GamepadAxisChangedEvent { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } - /// Creates a new [`GamepadAxisChangedEvent`] + /// Creates a new [`GamepadAxisChangedEvent`]. fn new( entity: Val, axis: Val, @@ -545,26 +221,7 @@ impl bevy::input::gamepad::GamepadAxisChangedEvent { generated )] impl bevy::input::gamepad::GamepadButtonChangedEvent { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } - /// Creates a new [`GamepadButtonChangedEvent`] + /// Creates a new [`GamepadButtonChangedEvent`]. fn new( entity: Val, button: Val, @@ -588,35 +245,7 @@ impl bevy::input::gamepad::GamepadButtonChangedEvent { generated )] impl bevy::input::gamepad::GamepadButtonStateChangedEvent { - fn assert_receiver_is_total_eq( - _self: Ref, - ) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } - /// Creates a new [`GamepadButtonStateChangedEvent`] + /// Creates a new [`GamepadButtonStateChangedEvent`]. fn new( entity: Val, button: Val, @@ -637,27 +266,7 @@ impl bevy::input::gamepad::GamepadButtonStateChangedEvent { bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::gamepad::GamepadConnection { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::gamepad::GamepadConnection {} #[script_bindings( remote, name = "gamepad_connection_event_functions", @@ -665,16 +274,7 @@ impl bevy::input::gamepad::GamepadConnection { generated )] impl bevy::input::gamepad::GamepadConnectionEvent { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - /// Is the gamepad connected? + /// Whether the gamepad is connected. fn connected(_self: Ref) -> bool { let output: bool = bevy::input::gamepad::GamepadConnectionEvent::connected( &_self, @@ -682,7 +282,7 @@ impl bevy::input::gamepad::GamepadConnectionEvent { .into(); output } - /// Is the gamepad disconnected? + /// Whether the gamepad is disconnected. fn disconnected(_self: Ref) -> bool { let output: bool = bevy::input::gamepad::GamepadConnectionEvent::disconnected( &_self, @@ -690,16 +290,6 @@ impl bevy::input::gamepad::GamepadConnectionEvent { .into(); output } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Creates a [`GamepadConnectionEvent`]. fn new( gamepad: Val, @@ -719,63 +309,14 @@ impl bevy::input::gamepad::GamepadConnectionEvent { bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::gamepad::GamepadEvent { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::gamepad::GamepadEvent {} #[script_bindings( remote, name = "gamepad_input_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::gamepad::GamepadInput { - fn assert_receiver_is_total_eq( - _self: Ref, - ) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::gamepad::GamepadInput {} #[script_bindings( remote, name = "gamepad_rumble_request_functions", @@ -783,15 +324,6 @@ impl bevy::input::gamepad::GamepadInput { generated )] impl bevy::input::gamepad::GamepadRumbleRequest { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Get the [`Entity`] associated with this request. fn gamepad( _self: Ref, @@ -810,25 +342,6 @@ impl bevy::input::gamepad::GamepadRumbleRequest { generated )] impl bevy::input::gamepad::RawGamepadAxisChangedEvent { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Creates a [`RawGamepadAxisChangedEvent`]. fn new( gamepad: Val, @@ -851,25 +364,6 @@ impl bevy::input::gamepad::RawGamepadAxisChangedEvent { generated )] impl bevy::input::gamepad::RawGamepadButtonChangedEvent { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Creates a [`RawGamepadButtonChangedEvent`]. fn new( gamepad: Val, @@ -891,135 +385,35 @@ impl bevy::input::gamepad::RawGamepadButtonChangedEvent { bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::gamepad::RawGamepadEvent { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::gamepad::RawGamepadEvent {} #[script_bindings( remote, name = "pinch_gesture_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::gestures::PinchGesture { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::gestures::PinchGesture {} #[script_bindings( remote, name = "rotation_gesture_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::gestures::RotationGesture { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::gestures::RotationGesture {} #[script_bindings( remote, name = "double_tap_gesture_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::gestures::DoubleTapGesture { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::gestures::DoubleTapGesture {} #[script_bindings( remote, name = "pan_gesture_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::gestures::PanGesture { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::gestures::PanGesture {} #[script_bindings( remote, name = "button_state_functions", @@ -1027,30 +421,6 @@ impl bevy::input::gestures::PanGesture { generated )] impl bevy::input::ButtonState { - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Is this button pressed? fn is_pressed(_self: Ref) -> bool { let output: bool = bevy::input::ButtonState::is_pressed(&_self).into(); @@ -1064,25 +434,6 @@ impl bevy::input::ButtonState { generated )] impl bevy::input::gamepad::ButtonSettings { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Returns `true` if the button is pressed. /// A button is considered pressed if the `value` passed is greater than or equal to the press threshold. fn is_pressed(_self: Ref, value: f32) -> bool { @@ -1155,17 +506,8 @@ impl bevy::input::gamepad::ButtonSettings { )] impl bevy::input::gamepad::AxisSettings { /// Clamps the `raw_value` according to the `AxisSettings`. - fn clamp(_self: Ref, new_value: f32) -> f32 { - let output: f32 = bevy::input::gamepad::AxisSettings::clamp(&_self, new_value) - .into(); - output - } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) + fn clamp(_self: Ref, raw_value: f32) -> f32 { + let output: f32 = bevy::input::gamepad::AxisSettings::clamp(&_self, raw_value) .into(); output } @@ -1181,32 +523,6 @@ impl bevy::input::gamepad::AxisSettings { .into(); output } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } - /// Filters the `new_value` based on the `old_value`, according to the [`AxisSettings`]. - /// Returns the clamped `new_value` if the change exceeds the settings threshold, - /// and `None` otherwise. - fn filter( - _self: Ref, - new_value: f32, - old_value: std::option::Option, - ) -> std::option::Option { - let output: std::option::Option = bevy::input::gamepad::AxisSettings::filter( - &_self, - new_value, - old_value, - ) - .into(); - output - } /// Get the value below which negative inputs will be rounded down to -1.0. fn livezone_lowerbound(_self: Ref) -> f32 { let output: f32 = bevy::input::gamepad::AxisSettings::livezone_lowerbound(&_self) @@ -1305,33 +621,7 @@ impl bevy::input::gamepad::AxisSettings { bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::gamepad::ButtonAxisSettings { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - /// Filters the `new_value` based on the `old_value`, according to the [`ButtonAxisSettings`]. - /// Returns the clamped `new_value`, according to the [`ButtonAxisSettings`], if the change - /// exceeds the settings threshold, and `None` otherwise. - fn filter( - _self: Ref, - new_value: f32, - old_value: std::option::Option, - ) -> std::option::Option { - let output: std::option::Option = bevy::input::gamepad::ButtonAxisSettings::filter( - &_self, - new_value, - old_value, - ) - .into(); - output - } -} +impl bevy::input::gamepad::ButtonAxisSettings {} #[script_bindings( remote, name = "gamepad_rumble_intensity_functions", @@ -1339,25 +629,6 @@ impl bevy::input::gamepad::ButtonAxisSettings { generated )] impl bevy::input::gamepad::GamepadRumbleIntensity { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Creates a new rumble intensity with strong motor intensity set to the given value. /// Clamped within the `0.0` to `1.0` range. fn strong_motor( @@ -1385,199 +656,42 @@ impl bevy::input::gamepad::GamepadRumbleIntensity { bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::keyboard::Key { - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::keyboard::Key {} #[script_bindings( remote, name = "native_key_code_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::keyboard::NativeKeyCode { - fn assert_receiver_is_total_eq( - _self: Ref, - ) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::keyboard::NativeKeyCode {} #[script_bindings( remote, name = "native_key_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::keyboard::NativeKey { - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::keyboard::NativeKey {} #[script_bindings( remote, name = "mouse_scroll_unit_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::mouse::MouseScrollUnit { - fn assert_receiver_is_total_eq( - _self: Ref, - ) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::mouse::MouseScrollUnit {} #[script_bindings( remote, name = "touch_phase_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::touch::TouchPhase { - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::touch::TouchPhase {} #[script_bindings( remote, name = "force_touch_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::input::touch::ForceTouch { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::input::touch::ForceTouch {} impl ::bevy::app::Plugin for BevyInputScriptingPlugin { fn build(&self, app: &mut ::bevy::prelude::App) { let mut world = app.world_mut(); diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_math.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_math.rs index 6a65dc0527..c23785c23b 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_math.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_math.rs @@ -19,23 +19,6 @@ pub struct BevyMathScriptingPlugin; generated )] impl bevy::math::AspectRatio { - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Returns the inverse of this aspect ratio (height/width). fn inverse(_self: Ref) -> Val { let output: Val = bevy::math::AspectRatio::inverse( @@ -72,27 +55,21 @@ impl bevy::math::AspectRatio { generated )] impl bevy::math::CompassOctant { - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( + /// Returns the opposite [`CompassOctant`], located 180 degrees from `self`. + /// This can also be accessed via the `-` operator, using the [`Neg`] trait. + fn opposite( + _self: Ref, + ) -> Val { + let output: Val = bevy::math::CompassOctant::opposite( &_self, ) .into(); output } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) + /// Converts a [`CompassOctant`] to a standard index. + /// Starts at 0 for [`CompassOctant::North`] and increments clockwise. + fn to_index(_self: Val) -> usize { + let output: usize = bevy::math::CompassOctant::to_index(_self.into_inner()) .into(); output } @@ -104,29 +81,21 @@ impl bevy::math::CompassOctant { generated )] impl bevy::math::CompassQuadrant { - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone( + /// Returns the opposite [`CompassQuadrant`], located 180 degrees from `self`. + /// This can also be accessed via the `-` operator, using the [`Neg`] trait. + fn opposite( _self: Ref, ) -> Val { - let output: Val = ::clone( + let output: Val = bevy::math::CompassQuadrant::opposite( &_self, ) .into(); output } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) + /// Converts a [`CompassQuadrant`] to a standard index. + /// Starts at 0 for [`CompassQuadrant::North`] and increments clockwise. + fn to_index(_self: Val) -> usize { + let output: usize = bevy::math::CompassQuadrant::to_index(_self.into_inner()) .into(); output } @@ -138,23 +107,6 @@ impl bevy::math::CompassQuadrant { generated )] impl bevy::math::Isometry2d { - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Create a two-dimensional isometry from a rotation. fn from_rotation(rotation: Val) -> Val { let output: Val = bevy::math::Isometry2d::from_rotation( @@ -214,36 +166,6 @@ impl bevy::math::Isometry2d { .into(); output } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Create a two-dimensional isometry from a rotation and a translation. fn new( translation: Val, @@ -276,23 +198,6 @@ impl bevy::math::Isometry2d { generated )] impl bevy::math::Isometry3d { - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Create a three-dimensional isometry from a rotation. fn from_rotation( rotation: Val, @@ -333,46 +238,6 @@ impl bevy::math::Isometry3d { .into(); output } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } } #[script_bindings( remote, @@ -381,20 +246,6 @@ impl bevy::math::Isometry3d { generated )] impl bevy::math::Ray2d { - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Get a point at a given distance along the ray fn get_point( _self: Ref, @@ -412,8 +263,8 @@ impl bevy::math::Ray2d { _self: Ref, plane_origin: Val, plane: Val, - ) -> std::option::Option { - let output: std::option::Option = bevy::math::Ray2d::intersect_plane( + ) -> core::option::Option { + let output: core::option::Option = bevy::math::Ray2d::intersect_plane( &_self, plane_origin.into_inner(), plane.into_inner(), @@ -441,20 +292,6 @@ impl bevy::math::Ray2d { generated )] impl bevy::math::Ray3d { - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Get a point at a given distance along the ray fn get_point( _self: Ref, @@ -472,8 +309,8 @@ impl bevy::math::Ray3d { _self: Ref, plane_origin: Val, plane: Val, - ) -> std::option::Option { - let output: std::option::Option = bevy::math::Ray3d::intersect_plane( + ) -> core::option::Option { + let output: core::option::Option = bevy::math::Ray3d::intersect_plane( &_self, plane_origin.into_inner(), plane.into_inner(), @@ -501,15 +338,6 @@ impl bevy::math::Ray3d { generated )] impl bevy::math::Rot2 { - /// Returns the angle in radians needed to make `self` and `other` coincide. - fn angle_between(_self: Val, other: Val) -> f32 { - let output: f32 = bevy::math::Rot2::angle_between( - _self.into_inner(), - other.into_inner(), - ) - .into(); - output - } /// Returns the angle in radians needed to make `self` and `other` coincide. fn angle_to(_self: Val, other: Val) -> f32 { let output: f32 = bevy::math::Rot2::angle_to( @@ -534,13 +362,6 @@ impl bevy::math::Rot2 { let output: f32 = bevy::math::Rot2::as_turn_fraction(_self.into_inner()).into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Creates a [`Rot2`] from a counterclockwise angle in degrees. /// # Note /// The input rotation will always be clamped to the range `(-180°, 180°]` by design. @@ -550,21 +371,16 @@ impl bevy::math::Rot2 { /// # use approx::assert_relative_eq; /// let rot1 = Rot2::degrees(270.0); /// let rot2 = Rot2::degrees(-90.0); + /// #[cfg(feature = "approx")] /// assert_relative_eq!(rot1, rot2); /// let rot3 = Rot2::degrees(180.0); + /// #[cfg(feature = "approx")] /// assert_relative_eq!(rot1 * rot1, rot3); /// ``` fn degrees(degrees: f32) -> Val { let output: Val = bevy::math::Rot2::degrees(degrees).into(); output } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Returns `self` after an approximate normalization, assuming the value is already nearly normalized. /// Useful for preventing numerical error accumulation. /// See [`Dir3::fast_renormalize`](crate::Dir3::fast_renormalize) for an example of when such error accumulation might occur. @@ -636,38 +452,6 @@ impl bevy::math::Rot2 { let output: f32 = bevy::math::Rot2::length_squared(_self.into_inner()).into(); output } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - /// Rotates the [`Dir2`] using a [`Rot2`]. - fn mul( - _self: Val, - direction: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), direction.into_inner()) - .into(); - output - } - /// Rotates a [`Vec2`] by a [`Rot2`]. - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Performs a linear interpolation between `self` and `rhs` based on /// the value `s`, and normalizes the rotation afterwards. /// When `s == 0.0`, the result will be equal to `self`. @@ -732,8 +516,10 @@ impl bevy::math::Rot2 { /// # use std::f32::consts::{FRAC_PI_2, PI}; /// let rot1 = Rot2::radians(3.0 * FRAC_PI_2); /// let rot2 = Rot2::radians(-FRAC_PI_2); + /// #[cfg(feature = "approx")] /// assert_relative_eq!(rot1, rot2); /// let rot3 = Rot2::radians(PI); + /// #[cfg(feature = "approx")] /// assert_relative_eq!(rot1 * rot1, rot3); /// ``` fn radians(radians: f32) -> Val { @@ -785,8 +571,10 @@ impl bevy::math::Rot2 { /// # use approx::assert_relative_eq; /// let rot1 = Rot2::turn_fraction(0.75); /// let rot2 = Rot2::turn_fraction(-0.25); + /// #[cfg(feature = "approx")] /// assert_relative_eq!(rot1, rot2); /// let rot3 = Rot2::turn_fraction(0.5); + /// #[cfg(feature = "approx")] /// assert_relative_eq!(rot1 * rot1, rot3); /// ``` fn turn_fraction(fraction: f32) -> Val { @@ -810,23 +598,6 @@ impl bevy::math::prelude::Dir2 { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Returns `self` after an approximate normalization, assuming the value is already nearly normalized. /// Useful for preventing numerical error accumulation. /// See [`Dir3::fast_renormalize`] for an example of when such error accumulation might occur. @@ -850,23 +621,6 @@ impl bevy::math::prelude::Dir2 { .into(); output } - fn mul( - _self: Val, - rhs: f32, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - } /// Create a [`Dir2`] from a [`Vec2`] that is already normalized. /// # Warning /// `value` must be normalized, i.e its length must be `1.0`. @@ -948,8 +702,10 @@ impl bevy::math::prelude::Dir2 { /// let dir1 = Dir2::X; /// let dir2 = Dir2::Y; /// let result1 = dir1.slerp(dir2, 1.0 / 3.0); + /// #[cfg(feature = "approx")] /// assert_relative_eq!(result1, Dir2::from_xy(0.75_f32.sqrt(), 0.5).unwrap()); /// let result2 = dir1.slerp(dir2, 0.5); + /// #[cfg(feature = "approx")] /// assert_relative_eq!(result2, Dir2::from_xy(0.5_f32.sqrt(), 0.5_f32.sqrt()).unwrap()); /// ``` fn slerp( @@ -981,23 +737,6 @@ impl bevy::math::prelude::Dir3 { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Returns `self` after an approximate normalization, assuming the value is already nearly normalized. /// Useful for preventing numerical error accumulation. /// # Example @@ -1044,23 +783,6 @@ impl bevy::math::prelude::Dir3 { .into(); output } - fn mul( - _self: Val, - rhs: f32, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - } /// Create a [`Dir3`] from a [`Vec3`] that is already normalized. /// # Warning /// `value` must be normalized, i.e its length must be `1.0`. @@ -1086,12 +808,14 @@ impl bevy::math::prelude::Dir3 { /// let dir1 = Dir3::X; /// let dir2 = Dir3::Y; /// let result1 = dir1.slerp(dir2, 1.0 / 3.0); + /// #[cfg(feature = "approx")] /// assert_relative_eq!( /// result1, /// Dir3::from_xyz(0.75_f32.sqrt(), 0.5, 0.0).unwrap(), /// epsilon = 0.000001 /// ); /// let result2 = dir1.slerp(dir2, 0.5); + /// #[cfg(feature = "approx")] /// assert_relative_eq!(result2, Dir3::from_xyz(0.5_f32.sqrt(), 0.5_f32.sqrt(), 0.0).unwrap()); /// ``` fn slerp( @@ -1116,28 +840,15 @@ impl bevy::math::prelude::Dir3 { )] impl bevy::math::prelude::Dir3A { /// Returns the inner [`Vec3A`] - fn as_vec3a(_self: Ref) -> Val { - let output: Val = bevy::math::prelude::Dir3A::as_vec3a(&_self) - .into(); - output - } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( + fn as_vec3a( + _self: Ref, + ) -> Val { + let output: Val = bevy::math::prelude::Dir3A::as_vec3a( &_self, ) .into(); output } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Returns `self` after an approximate normalization, assuming the value is already nearly normalized. /// Useful for preventing numerical error accumulation. /// See [`Dir3::fast_renormalize`] for an example of when such error accumulation might occur. @@ -1162,24 +873,12 @@ impl bevy::math::prelude::Dir3A { .into(); output } - fn mul(_self: Val, rhs: f32) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - } /// Create a [`Dir3A`] from a [`Vec3A`] that is already normalized. /// # Warning /// `value` must be normalized, i.e its length must be `1.0`. - fn new_unchecked(value: Val) -> Val { + fn new_unchecked( + value: Val, + ) -> Val { let output: Val = bevy::math::prelude::Dir3A::new_unchecked( value.into_inner(), ) @@ -1199,12 +898,14 @@ impl bevy::math::prelude::Dir3A { /// let dir1 = Dir3A::X; /// let dir2 = Dir3A::Y; /// let result1 = dir1.slerp(dir2, 1.0 / 3.0); + /// #[cfg(feature = "approx")] /// assert_relative_eq!( /// result1, /// Dir3A::from_xyz(0.75_f32.sqrt(), 0.5, 0.0).unwrap(), /// epsilon = 0.000001 /// ); /// let result2 = dir1.slerp(dir2, 0.5); + /// #[cfg(feature = "approx")] /// assert_relative_eq!(result2, Dir3A::from_xyz(0.5_f32.sqrt(), 0.5_f32.sqrt(), 0.0).unwrap()); /// ``` fn slerp( @@ -1248,13 +949,6 @@ impl bevy::math::prelude::IRect { .into(); output } - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } /// The center point of the rectangle. /// # Rounding Behavior /// If the (min + max) contains odd numbers they will be rounded down to the nearest whole number when calculating the center. @@ -1273,13 +967,6 @@ impl bevy::math::prelude::IRect { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Check if a point lies within this rectangle, inclusive of its edges. /// # Examples /// ``` @@ -1300,16 +987,6 @@ impl bevy::math::prelude::IRect { .into(); output } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Create a new rectangle from its center and half-size. /// # Panics /// This method panics if any of the components of the half-size is negative. @@ -1597,13 +1274,6 @@ impl bevy::math::prelude::Rect { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Check if a point lies within this rectangle, inclusive of its edges. /// # Examples /// ``` @@ -1624,16 +1294,6 @@ impl bevy::math::prelude::Rect { .into(); output } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Create a new rectangle from its center and half-size. /// # Panics /// This method panics if any of the components of the half-size is negative. @@ -1927,13 +1587,6 @@ impl bevy::math::prelude::URect { .into(); output } - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } /// The center point of the rectangle. /// # Rounding Behavior /// If the (min + max) contains odd numbers they will be rounded down to the nearest whole number when calculating the center. @@ -1952,13 +1605,6 @@ impl bevy::math::prelude::URect { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Check if a point lies within this rectangle, inclusive of its edges. /// # Examples /// ``` @@ -1979,16 +1625,6 @@ impl bevy::math::prelude::URect { .into(); output } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Create a new rectangle from its center and half-size. /// # Panics /// This method panics if any of the components of the half-size is negative or if `origin - half_size` results in any negatives. @@ -2259,15 +1895,6 @@ impl bevy::math::bounding::Aabb2d { .into(); output } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Finds the point on the AABB that is closest to the given `point`. /// If the point is outside the AABB, the returned point will be on the perimeter of the AABB. /// Otherwise, it will be inside the AABB and returned as is. @@ -2312,15 +1939,6 @@ impl bevy::math::bounding::BoundingCircle { .into(); output } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Finds the point on the bounding circle that is closest to the given `point`. /// If the point is outside the circle, the returned point will be on the perimeter of the circle. /// Otherwise, it will be inside the circle and returned as is. @@ -2360,15 +1978,6 @@ impl bevy::math::bounding::BoundingCircle { generated )] impl bevy::math::primitives::Circle { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Finds the point on the circle that is closest to the given `point`. /// If the point is outside the circle, the returned point will be on the perimeter of the circle. /// Otherwise, it will be inside the circle and returned as is. @@ -2388,16 +1997,6 @@ impl bevy::math::primitives::Circle { let output: f32 = bevy::math::primitives::Circle::diameter(&_self).into(); output } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Create a new [`Circle`] from a `radius` fn new(radius: f32) -> Val { let output: Val = bevy::math::primitives::Circle::new( @@ -2414,15 +2013,6 @@ impl bevy::math::primitives::Circle { generated )] impl bevy::math::primitives::Annulus { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Finds the point on the annulus that is closest to the given `point`: /// - If the point is outside of the annulus completely, the returned point will be on the outer perimeter. /// - If the point is inside of the inner circle (hole) of the annulus, the returned point will be on the inner perimeter. @@ -2443,16 +2033,6 @@ impl bevy::math::primitives::Annulus { let output: f32 = bevy::math::primitives::Annulus::diameter(&_self).into(); output } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Create a new [`Annulus`] from the radii of the inner and outer circle fn new( inner_radius: f32, @@ -2506,25 +2086,6 @@ impl bevy::math::primitives::Arc2d { .into(); output } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Create a new [`Arc2d`] from a `radius` and an `angle` in degrees. fn from_degrees(radius: f32, angle: f32) -> Val { let output: Val = bevy::math::primitives::Arc2d::from_degrees( @@ -2631,25 +2192,6 @@ impl bevy::math::primitives::Arc2d { generated )] impl bevy::math::primitives::Capsule2d { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Create a new `Capsule2d` from a radius and length fn new(radius: f32, length: f32) -> Val { let output: Val = bevy::math::primitives::Capsule2d::new( @@ -2712,25 +2254,6 @@ impl bevy::math::primitives::CircularSector { .into(); output } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Create a new [`CircularSector`] from a `radius` and an `angle` in degrees. fn from_degrees( radius: f32, @@ -2846,25 +2369,6 @@ impl bevy::math::primitives::CircularSegment { .into(); output } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Create a new [`CircularSegment`] from a `radius` and an `angle` in degrees. fn from_degrees( radius: f32, @@ -2945,15 +2449,6 @@ impl bevy::math::primitives::CircularSegment { generated )] impl bevy::math::primitives::Ellipse { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns the [eccentricity](https://en.wikipedia.org/wiki/Eccentricity_(mathematics)) of the ellipse. /// It can be thought of as a measure of how "stretched" or elongated the ellipse is. /// The value should be in the range [0, 1), where 0 represents a circle, and 1 represents a parabola. @@ -2961,16 +2456,6 @@ impl bevy::math::primitives::Ellipse { let output: f32 = bevy::math::primitives::Ellipse::eccentricity(&_self).into(); output } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Get the focal length of the ellipse. This corresponds to the distance between one of the foci and the center of the ellipse. /// The focal length of an ellipse is related to its eccentricity by `eccentricity = focal_length / semi_major` fn focal_length(_self: Ref) -> f32 { @@ -3015,27 +2500,7 @@ impl bevy::math::primitives::Ellipse { bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::math::primitives::Line2d { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::math::primitives::Line2d {} #[script_bindings( remote, name = "plane_2_d_functions", @@ -3043,25 +2508,6 @@ impl bevy::math::primitives::Line2d { generated )] impl bevy::math::primitives::Plane2d { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Create a new `Plane2d` from a normal /// # Panics /// Panics if the given `normal` is zero (or very close to zero), or non-finite. @@ -3082,15 +2528,6 @@ impl bevy::math::primitives::Plane2d { generated )] impl bevy::math::primitives::Rectangle { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Finds the point on the rectangle that is closest to the given `point`. /// If the point is outside the rectangle, the returned point will be on the perimeter of the rectangle. /// Otherwise, it will be inside the rectangle and returned as is. @@ -3105,16 +2542,6 @@ impl bevy::math::primitives::Rectangle { .into(); output } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Create a new `Rectangle` from two corner points fn from_corners( point1: Val, @@ -3180,25 +2607,6 @@ impl bevy::math::primitives::RegularPolygon { .into(); output } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Get the external angle of the regular polygon in degrees. /// This is the angle formed by two adjacent sides with points /// within the angle being in the exterior of the polygon @@ -3290,15 +2698,6 @@ impl bevy::math::primitives::Rhombus { let output: f32 = bevy::math::primitives::Rhombus::circumradius(&_self).into(); output } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Finds the point on the rhombus that is closest to the given `point`. /// If the point is outside the rhombus, the returned point will be on the perimeter of the rhombus. /// Otherwise, it will be inside the rhombus and returned as is. @@ -3313,16 +2712,6 @@ impl bevy::math::primitives::Rhombus { .into(); output } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Create a new `Rhombus` from a given inradius with all inner angles equal. fn from_inradius(inradius: f32) -> Val { let output: Val = bevy::math::primitives::Rhombus::from_inradius( @@ -3370,208 +2759,361 @@ impl bevy::math::primitives::Rhombus { generated )] impl bevy::math::primitives::Segment2d { - fn clone( + /// Compute the midpoint between the two endpoints of the line segment. + fn center( + _self: Ref, + ) -> Val { + let output: Val = bevy::math::primitives::Segment2d::center( + &_self, + ) + .into(); + output + } + /// Compute the segment with its center at the origin, keeping the same direction and length. + fn centered( _self: Ref, ) -> Val { - let output: Val = ::clone( + let output: Val = bevy::math::primitives::Segment2d::centered( &_self, ) .into(); output } - fn eq( + /// Compute the normalized direction pointing from the first endpoint to the second endpoint. + /// For the non-panicking version, see [`Segment2d::try_direction`]. + /// # Panics + /// Panics if a valid direction could not be computed, for example when the endpoints are coincident, NaN, or infinite. + fn direction( _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) + ) -> Val { + let output: Val = bevy::math::primitives::Segment2d::direction( + &_self, + ) .into(); output } - /// Create a new `Segment2d` from a direction and full length of the segment - fn new( + /// Create a new `Segment2d` centered at the origin with the given direction and length. + /// The endpoints will be at `-direction * length / 2.0` and `direction * length / 2.0`. + fn from_direction_and_length( direction: Val, length: f32, ) -> Val { - let output: Val = bevy::math::primitives::Segment2d::new( + let output: Val = bevy::math::primitives::Segment2d::from_direction_and_length( direction.into_inner(), length, ) .into(); output } - /// Get the position of the first point on the line segment - fn point1( - _self: Ref, - ) -> Val { - let output: Val = bevy::math::primitives::Segment2d::point1( - &_self, + /// Create a new `Segment2d` starting from the origin of the given `ray`, + /// going in the direction of the ray for the given `length`. + /// The endpoints will be at `ray.origin` and `ray.origin + length * ray.direction`. + fn from_ray_and_length( + ray: Val, + length: f32, + ) -> Val { + let output: Val = bevy::math::primitives::Segment2d::from_ray_and_length( + ray.into_inner(), + length, ) .into(); output } - /// Get the position of the second point on the line segment - fn point2( - _self: Ref, - ) -> Val { - let output: Val = bevy::math::primitives::Segment2d::point2( - &_self, + /// Create a new `Segment2d` centered at the origin from a vector representing + /// the direction and length of the line segment. + /// The endpoints will be at `-scaled_direction / 2.0` and `scaled_direction / 2.0`. + fn from_scaled_direction( + scaled_direction: Val, + ) -> Val { + let output: Val = bevy::math::primitives::Segment2d::from_scaled_direction( + scaled_direction.into_inner(), ) .into(); output } -} -#[script_bindings( - remote, - name = "triangle_2_d_functions", - bms_core_path = "bevy_mod_scripting_core", - generated -)] -impl bevy::math::primitives::Triangle2d { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( + /// Compute the normalized counterclockwise normal on the left-hand side of the line segment. + /// For the non-panicking version, see [`Segment2d::try_left_normal`]. + /// # Panics + /// Panics if a valid normal could not be computed, for example when the endpoints are coincident, NaN, or infinite. + fn left_normal( + _self: Ref, + ) -> Val { + let output: Val = bevy::math::primitives::Segment2d::left_normal( &_self, ) .into(); output } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } - /// Checks if the triangle is acute, meaning all angles are less than 90 degrees - fn is_acute(_self: Ref) -> bool { - let output: bool = bevy::math::primitives::Triangle2d::is_acute(&_self).into(); + /// Compute the length of the line segment. + fn length(_self: Ref) -> f32 { + let output: f32 = bevy::math::primitives::Segment2d::length(&_self).into(); output } - /// Checks if the triangle is degenerate, meaning it has zero area. - /// A triangle is degenerate if the cross product of the vectors `ab` and `ac` has a length less than `10e-7`. - /// This indicates that the three vertices are collinear or nearly collinear. - fn is_degenerate(_self: Ref) -> bool { - let output: bool = bevy::math::primitives::Triangle2d::is_degenerate(&_self) + /// Compute the squared length of the line segment. + fn length_squared(_self: Ref) -> f32 { + let output: f32 = bevy::math::primitives::Segment2d::length_squared(&_self) .into(); output } - /// Checks if the triangle is obtuse, meaning one angle is greater than 90 degrees - fn is_obtuse(_self: Ref) -> bool { - let output: bool = bevy::math::primitives::Triangle2d::is_obtuse(&_self).into(); - output - } - /// Create a new `Triangle2d` from points `a`, `b`, and `c` + /// Create a new `Segment2d` from its endpoints. fn new( - a: Val, - b: Val, - c: Val, - ) -> Val { - let output: Val = bevy::math::primitives::Triangle2d::new( - a.into_inner(), - b.into_inner(), - c.into_inner(), + point1: Val, + point2: Val, + ) -> Val { + let output: Val = bevy::math::primitives::Segment2d::new( + point1.into_inner(), + point2.into_inner(), ) .into(); output } - /// Reverse the [`WindingOrder`] of the triangle - /// by swapping the first and last vertices. - fn reverse(mut _self: Mut) -> () { - let output: () = bevy::math::primitives::Triangle2d::reverse(&mut _self).into(); - output - } - /// This triangle but reversed. - fn reversed( - _self: Val, - ) -> Val { - let output: Val = bevy::math::primitives::Triangle2d::reversed( - _self.into_inner(), + /// Get the position of the first endpoint of the line segment. + fn point1( + _self: Ref, + ) -> Val { + let output: Val = bevy::math::primitives::Segment2d::point1( + &_self, ) .into(); output } -} -#[script_bindings( - remote, - name = "aabb_3_d_functions", - bms_core_path = "bevy_mod_scripting_core", - generated -)] -impl bevy::math::bounding::Aabb3d { - /// Computes the smallest [`BoundingSphere`] containing this [`Aabb3d`]. - fn bounding_sphere( - _self: Ref, - ) -> Val { - let output: Val = bevy::math::bounding::Aabb3d::bounding_sphere( + /// Get the position of the second endpoint of the line segment. + fn point2( + _self: Ref, + ) -> Val { + let output: Val = bevy::math::primitives::Segment2d::point2( &_self, ) .into(); output } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( + /// Compute the segment with a new length, keeping the same direction and center. + fn resized( + _self: Ref, + length: f32, + ) -> Val { + let output: Val = bevy::math::primitives::Segment2d::resized( &_self, + length, ) .into(); output } -} -#[script_bindings( - remote, - name = "bounding_sphere_functions", - bms_core_path = "bevy_mod_scripting_core", - generated -)] -impl bevy::math::bounding::BoundingSphere { - /// Computes the smallest [`Aabb3d`] containing this [`BoundingSphere`]. - fn aabb_3d( - _self: Ref, - ) -> Val { - let output: Val = bevy::math::bounding::BoundingSphere::aabb_3d( - &_self, + /// Reverses the direction of the line segment by swapping the endpoints. + fn reverse(mut _self: Mut) -> () { + let output: () = bevy::math::primitives::Segment2d::reverse(&mut _self).into(); + output + } + /// Returns the line segment with its direction reversed by swapping the endpoints. + fn reversed( + _self: Val, + ) -> Val { + let output: Val = bevy::math::primitives::Segment2d::reversed( + _self.into_inner(), ) .into(); output } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( + /// Compute the normalized clockwise normal on the right-hand side of the line segment. + /// For the non-panicking version, see [`Segment2d::try_right_normal`]. + /// # Panics + /// Panics if a valid normal could not be computed, for example when the endpoints are coincident, NaN, or infinite. + fn right_normal( + _self: Ref, + ) -> Val { + let output: Val = bevy::math::primitives::Segment2d::right_normal( &_self, ) .into(); output } - /// Get the radius of the bounding sphere - fn radius(_self: Ref) -> f32 { - let output: f32 = bevy::math::bounding::BoundingSphere::radius(&_self).into(); - output + /// Compute the segment rotated around the origin by the given rotation. + fn rotated( + _self: Ref, + rotation: Val, + ) -> Val { + let output: Val = bevy::math::primitives::Segment2d::rotated( + &_self, + rotation.into_inner(), + ) + .into(); + output + } + /// Compute the segment rotated around the given point by the given rotation. + fn rotated_around( + _self: Ref, + rotation: Val, + point: Val, + ) -> Val { + let output: Val = bevy::math::primitives::Segment2d::rotated_around( + &_self, + rotation.into_inner(), + point.into_inner(), + ) + .into(); + output + } + /// Compute the segment rotated around its own center. + fn rotated_around_center( + _self: Ref, + rotation: Val, + ) -> Val { + let output: Val = bevy::math::primitives::Segment2d::rotated_around_center( + &_self, + rotation.into_inner(), + ) + .into(); + output + } + /// Compute the vector from the first endpoint to the second endpoint. + fn scaled_direction( + _self: Ref, + ) -> Val { + let output: Val = bevy::math::primitives::Segment2d::scaled_direction( + &_self, + ) + .into(); + output + } + /// Compute the non-normalized counterclockwise normal on the left-hand side of the line segment. + /// The length of the normal is the distance between the endpoints. + fn scaled_left_normal( + _self: Ref, + ) -> Val { + let output: Val = bevy::math::primitives::Segment2d::scaled_left_normal( + &_self, + ) + .into(); + output + } + /// Compute the non-normalized clockwise normal on the right-hand side of the line segment. + /// The length of the normal is the distance between the endpoints. + fn scaled_right_normal( + _self: Ref, + ) -> Val { + let output: Val = bevy::math::primitives::Segment2d::scaled_right_normal( + &_self, + ) + .into(); + output + } + /// Compute the segment translated by the given vector. + fn translated( + _self: Ref, + translation: Val, + ) -> Val { + let output: Val = bevy::math::primitives::Segment2d::translated( + &_self, + translation.into_inner(), + ) + .into(); + output } } #[script_bindings( remote, - name = "sphere_functions", + name = "triangle_2_d_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::math::primitives::Sphere { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( +impl bevy::math::primitives::Triangle2d { + /// Checks if the triangle is acute, meaning all angles are less than 90 degrees + fn is_acute(_self: Ref) -> bool { + let output: bool = bevy::math::primitives::Triangle2d::is_acute(&_self).into(); + output + } + /// Checks if the triangle is degenerate, meaning it has zero area. + /// A triangle is degenerate if the cross product of the vectors `ab` and `ac` has a length less than `10e-7`. + /// This indicates that the three vertices are collinear or nearly collinear. + fn is_degenerate(_self: Ref) -> bool { + let output: bool = bevy::math::primitives::Triangle2d::is_degenerate(&_self) + .into(); + output + } + /// Checks if the triangle is obtuse, meaning one angle is greater than 90 degrees + fn is_obtuse(_self: Ref) -> bool { + let output: bool = bevy::math::primitives::Triangle2d::is_obtuse(&_self).into(); + output + } + /// Create a new `Triangle2d` from points `a`, `b`, and `c` + fn new( + a: Val, + b: Val, + c: Val, + ) -> Val { + let output: Val = bevy::math::primitives::Triangle2d::new( + a.into_inner(), + b.into_inner(), + c.into_inner(), + ) + .into(); + output + } + /// Reverse the [`WindingOrder`] of the triangle + /// by swapping the first and last vertices. + fn reverse(mut _self: Mut) -> () { + let output: () = bevy::math::primitives::Triangle2d::reverse(&mut _self).into(); + output + } + /// This triangle but reversed. + fn reversed( + _self: Val, + ) -> Val { + let output: Val = bevy::math::primitives::Triangle2d::reversed( + _self.into_inner(), + ) + .into(); + output + } +} +#[script_bindings( + remote, + name = "aabb_3_d_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::math::bounding::Aabb3d { + /// Computes the smallest [`BoundingSphere`] containing this [`Aabb3d`]. + fn bounding_sphere( + _self: Ref, + ) -> Val { + let output: Val = bevy::math::bounding::Aabb3d::bounding_sphere( + &_self, + ) + .into(); + output + } +} +#[script_bindings( + remote, + name = "bounding_sphere_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::math::bounding::BoundingSphere { + /// Computes the smallest [`Aabb3d`] containing this [`BoundingSphere`]. + fn aabb_3d( + _self: Ref, + ) -> Val { + let output: Val = bevy::math::bounding::BoundingSphere::aabb_3d( &_self, ) .into(); output } + /// Get the radius of the bounding sphere + fn radius(_self: Ref) -> f32 { + let output: f32 = bevy::math::bounding::BoundingSphere::radius(&_self).into(); + output + } +} +#[script_bindings( + remote, + name = "sphere_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::math::primitives::Sphere { /// Finds the point on the sphere that is closest to the given `point`. /// If the point is outside the sphere, the returned point will be on the surface of the sphere. /// Otherwise, it will be inside the sphere and returned as is. @@ -3591,16 +3133,6 @@ impl bevy::math::primitives::Sphere { let output: f32 = bevy::math::primitives::Sphere::diameter(&_self).into(); output } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Create a new [`Sphere`] from a `radius` fn new(radius: f32) -> Val { let output: Val = bevy::math::primitives::Sphere::new( @@ -3617,15 +3149,6 @@ impl bevy::math::primitives::Sphere { generated )] impl bevy::math::primitives::Cuboid { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Finds the point on the cuboid that is closest to the given `point`. /// If the point is outside the cuboid, the returned point will be on the surface of the cuboid. /// Otherwise, it will be inside the cuboid and returned as is. @@ -3640,16 +3163,6 @@ impl bevy::math::primitives::Cuboid { .into(); output } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Create a new `Cuboid` from two corner points fn from_corners( point1: Val, @@ -3728,25 +3241,6 @@ impl bevy::math::primitives::Cylinder { let output: f32 = bevy::math::primitives::Cylinder::base_area(&_self).into(); output } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Get the surface area of the side of the cylinder, /// also known as the lateral area fn lateral_area(_self: Ref) -> f32 { @@ -3770,25 +3264,6 @@ impl bevy::math::primitives::Cylinder { generated )] impl bevy::math::primitives::Capsule3d { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Create a new `Capsule3d` from a radius and length fn new(radius: f32, length: f32) -> Val { let output: Val = bevy::math::primitives::Capsule3d::new( @@ -3832,25 +3307,6 @@ impl bevy::math::primitives::Cone { let output: f32 = bevy::math::primitives::Cone::base_area(&_self).into(); output } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Get the surface area of the side of the cone, /// also known as the lateral area fn lateral_area(_self: Ref) -> f32 { @@ -3879,27 +3335,7 @@ impl bevy::math::primitives::Cone { bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::math::primitives::ConicalFrustum { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::math::primitives::ConicalFrustum {} #[script_bindings( remote, name = "infinite_plane_3_d_functions", @@ -3907,25 +3343,6 @@ impl bevy::math::primitives::ConicalFrustum { generated )] impl bevy::math::primitives::InfinitePlane3d { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Computes an [`Isometry3d`] which transforms points from the XY-plane to this plane with the /// given `origin`. /// ## Guarantees @@ -3991,27 +3408,7 @@ impl bevy::math::primitives::InfinitePlane3d { bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::math::primitives::Line3d { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::math::primitives::Line3d {} #[script_bindings( remote, name = "segment_3_d_functions", @@ -4019,38 +3416,102 @@ impl bevy::math::primitives::Line3d { generated )] impl bevy::math::primitives::Segment3d { - fn clone( + /// Compute the midpoint between the two endpoints of the line segment. + fn center( + _self: Ref, + ) -> Val { + let output: Val = bevy::math::primitives::Segment3d::center( + &_self, + ) + .into(); + output + } + /// Compute the segment with its center at the origin, keeping the same direction and length. + fn centered( _self: Ref, ) -> Val { - let output: Val = ::clone( + let output: Val = bevy::math::primitives::Segment3d::centered( &_self, ) .into(); output } - fn eq( + /// Compute the normalized direction pointing from the first endpoint to the second endpoint. + /// For the non-panicking version, see [`Segment3d::try_direction`]. + /// # Panics + /// Panics if a valid direction could not be computed, for example when the endpoints are coincident, NaN, or infinite. + fn direction( _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) + ) -> Val { + let output: Val = bevy::math::primitives::Segment3d::direction( + &_self, + ) .into(); output } - /// Create a new `Segment3d` from a direction and full length of the segment - fn new( + /// Create a new `Segment3d` centered at the origin with the given direction and length. + /// The endpoints will be at `-direction * length / 2.0` and `direction * length / 2.0`. + fn from_direction_and_length( direction: Val, length: f32, ) -> Val { - let output: Val = bevy::math::primitives::Segment3d::new( + let output: Val = bevy::math::primitives::Segment3d::from_direction_and_length( direction.into_inner(), length, ) .into(); output } - /// Get the position of the first point on the line segment + /// Create a new `Segment3d` starting from the origin of the given `ray`, + /// going in the direction of the ray for the given `length`. + /// The endpoints will be at `ray.origin` and `ray.origin + length * ray.direction`. + fn from_ray_and_length( + ray: Val, + length: f32, + ) -> Val { + let output: Val = bevy::math::primitives::Segment3d::from_ray_and_length( + ray.into_inner(), + length, + ) + .into(); + output + } + /// Create a new `Segment3d` centered at the origin from a vector representing + /// the direction and length of the line segment. + /// The endpoints will be at `-scaled_direction / 2.0` and `scaled_direction / 2.0`. + fn from_scaled_direction( + scaled_direction: Val, + ) -> Val { + let output: Val = bevy::math::primitives::Segment3d::from_scaled_direction( + scaled_direction.into_inner(), + ) + .into(); + output + } + /// Compute the length of the line segment. + fn length(_self: Ref) -> f32 { + let output: f32 = bevy::math::primitives::Segment3d::length(&_self).into(); + output + } + /// Compute the squared length of the line segment. + fn length_squared(_self: Ref) -> f32 { + let output: f32 = bevy::math::primitives::Segment3d::length_squared(&_self) + .into(); + output + } + /// Create a new `Segment3d` from its endpoints. + fn new( + point1: Val, + point2: Val, + ) -> Val { + let output: Val = bevy::math::primitives::Segment3d::new( + point1.into_inner(), + point2.into_inner(), + ) + .into(); + output + } + /// Get the position of the first endpoint of the line segment. fn point1( _self: Ref, ) -> Val { @@ -4060,7 +3521,7 @@ impl bevy::math::primitives::Segment3d { .into(); output } - /// Get the position of the second point on the line segment + /// Get the position of the second endpoint of the line segment. fn point2( _self: Ref, ) -> Val { @@ -4070,33 +3531,101 @@ impl bevy::math::primitives::Segment3d { .into(); output } -} -#[script_bindings( - remote, - name = "torus_functions", - bms_core_path = "bevy_mod_scripting_core", - generated -)] -impl bevy::math::primitives::Torus { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( + /// Compute the segment with a new length, keeping the same direction and center. + fn resized( + _self: Ref, + length: f32, + ) -> Val { + let output: Val = bevy::math::primitives::Segment3d::resized( &_self, + length, ) .into(); output } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) + /// Reverses the direction of the line segment by swapping the endpoints. + fn reverse(mut _self: Mut) -> () { + let output: () = bevy::math::primitives::Segment3d::reverse(&mut _self).into(); + output + } + /// Returns the line segment with its direction reversed by swapping the endpoints. + fn reversed( + _self: Val, + ) -> Val { + let output: Val = bevy::math::primitives::Segment3d::reversed( + _self.into_inner(), + ) + .into(); + output + } + /// Compute the segment rotated around the origin by the given rotation. + fn rotated( + _self: Ref, + rotation: Val, + ) -> Val { + let output: Val = bevy::math::primitives::Segment3d::rotated( + &_self, + rotation.into_inner(), + ) + .into(); + output + } + /// Compute the segment rotated around the given point by the given rotation. + fn rotated_around( + _self: Ref, + rotation: Val, + point: Val, + ) -> Val { + let output: Val = bevy::math::primitives::Segment3d::rotated_around( + &_self, + rotation.into_inner(), + point.into_inner(), + ) + .into(); + output + } + /// Compute the segment rotated around its own center. + fn rotated_around_center( + _self: Ref, + rotation: Val, + ) -> Val { + let output: Val = bevy::math::primitives::Segment3d::rotated_around_center( + &_self, + rotation.into_inner(), + ) .into(); output } + /// Compute the vector from the first endpoint to the second endpoint. + fn scaled_direction( + _self: Ref, + ) -> Val { + let output: Val = bevy::math::primitives::Segment3d::scaled_direction( + &_self, + ) + .into(); + output + } + /// Compute the segment translated by the given vector. + fn translated( + _self: Ref, + translation: Val, + ) -> Val { + let output: Val = bevy::math::primitives::Segment3d::translated( + &_self, + translation.into_inner(), + ) + .into(); + output + } +} +#[script_bindings( + remote, + name = "torus_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::math::primitives::Torus { /// Get the inner radius of the torus. /// For a ring torus, this corresponds to the radius of the hole, /// or `major_radius - minor_radius` @@ -4152,25 +3681,6 @@ impl bevy::math::primitives::Triangle3d { .into(); output } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Checks if the triangle is acute, meaning all angles are less than 90 degrees fn is_acute(_self: Ref) -> bool { let output: bool = bevy::math::primitives::Triangle3d::is_acute(&_self).into(); @@ -4230,8 +3740,8 @@ impl bevy::math::bounding::RayCast2d { fn aabb_intersection_at( _self: Ref, aabb: Ref, - ) -> std::option::Option { - let output: std::option::Option = bevy::math::bounding::RayCast2d::aabb_intersection_at( + ) -> core::option::Option { + let output: core::option::Option = bevy::math::bounding::RayCast2d::aabb_intersection_at( &_self, &aabb, ) @@ -4242,23 +3752,14 @@ impl bevy::math::bounding::RayCast2d { fn circle_intersection_at( _self: Ref, circle: Ref, - ) -> std::option::Option { - let output: std::option::Option = bevy::math::bounding::RayCast2d::circle_intersection_at( + ) -> core::option::Option { + let output: core::option::Option = bevy::math::bounding::RayCast2d::circle_intersection_at( &_self, &circle, ) .into(); output } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Get the cached multiplicative inverse of the direction of the ray. fn direction_recip( _self: Ref, @@ -4307,23 +3808,14 @@ impl bevy::math::bounding::AabbCast2d { fn aabb_collision_at( _self: Ref, aabb: Val, - ) -> std::option::Option { - let output: std::option::Option = bevy::math::bounding::AabbCast2d::aabb_collision_at( + ) -> core::option::Option { + let output: core::option::Option = bevy::math::bounding::AabbCast2d::aabb_collision_at( &_self, aabb.into_inner(), ) .into(); output } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Construct an [`AabbCast2d`] from an [`Aabb2d`], [`Ray2d`], and max distance. fn from_ray( aabb: Val, @@ -4366,23 +3858,14 @@ impl bevy::math::bounding::BoundingCircleCast { fn circle_collision_at( _self: Ref, circle: Val, - ) -> std::option::Option { - let output: std::option::Option = bevy::math::bounding::BoundingCircleCast::circle_collision_at( + ) -> core::option::Option { + let output: core::option::Option = bevy::math::bounding::BoundingCircleCast::circle_collision_at( &_self, circle.into_inner(), ) .into(); output } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Construct a [`BoundingCircleCast`] from a [`BoundingCircle`], [`Ray2d`], and max distance. fn from_ray( circle: Val, @@ -4425,28 +3908,19 @@ impl bevy::math::bounding::RayCast3d { fn aabb_intersection_at( _self: Ref, aabb: Ref, - ) -> std::option::Option { - let output: std::option::Option = bevy::math::bounding::RayCast3d::aabb_intersection_at( + ) -> core::option::Option { + let output: core::option::Option = bevy::math::bounding::RayCast3d::aabb_intersection_at( &_self, &aabb, ) .into(); output } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Get the cached multiplicative inverse of the direction of the ray. fn direction_recip( _self: Ref, - ) -> Val { - let output: Val = bevy::math::bounding::RayCast3d::direction_recip( + ) -> Val { + let output: Val = bevy::math::bounding::RayCast3d::direction_recip( &_self, ) .into(); @@ -4468,8 +3942,8 @@ impl bevy::math::bounding::RayCast3d { fn sphere_intersection_at( _self: Ref, sphere: Ref, - ) -> std::option::Option { - let output: std::option::Option = bevy::math::bounding::RayCast3d::sphere_intersection_at( + ) -> core::option::Option { + let output: core::option::Option = bevy::math::bounding::RayCast3d::sphere_intersection_at( &_self, &sphere, ) @@ -4488,23 +3962,14 @@ impl bevy::math::bounding::AabbCast3d { fn aabb_collision_at( _self: Ref, aabb: Val, - ) -> std::option::Option { - let output: std::option::Option = bevy::math::bounding::AabbCast3d::aabb_collision_at( + ) -> core::option::Option { + let output: core::option::Option = bevy::math::bounding::AabbCast3d::aabb_collision_at( &_self, aabb.into_inner(), ) .into(); output } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Construct an [`AabbCast3d`] from an [`Aabb3d`], [`Ray3d`], and max distance. fn from_ray( aabb: Val, @@ -4527,15 +3992,6 @@ impl bevy::math::bounding::AabbCast3d { generated )] impl bevy::math::bounding::BoundingSphereCast { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Construct a [`BoundingSphereCast`] from a [`BoundingSphere`], [`Ray3d`], and max distance. fn from_ray( sphere: Val, @@ -4554,8 +4010,8 @@ impl bevy::math::bounding::BoundingSphereCast { fn sphere_collision_at( _self: Ref, sphere: Val, - ) -> std::option::Option { - let output: std::option::Option = bevy::math::bounding::BoundingSphereCast::sphere_collision_at( + ) -> core::option::Option { + let output: core::option::Option = bevy::math::bounding::BoundingSphereCast::sphere_collision_at( &_self, sphere.into_inner(), ) @@ -4579,15 +4035,6 @@ impl bevy::math::curve::interval::Interval { .into(); output } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns `true` if `item` is contained in this interval. fn contains(_self: Val, item: f32) -> bool { let output: bool = bevy::math::curve::interval::Interval::contains( @@ -4616,16 +4063,6 @@ impl bevy::math::curve::interval::Interval { .into(); output } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Returns `true` if this interval has a finite end. fn has_finite_end(_self: Val) -> bool { let output: bool = bevy::math::curve::interval::Interval::has_finite_end( @@ -4674,57 +4111,7 @@ impl bevy::math::curve::interval::Interval { bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::math::FloatOrd { - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } - fn ge(_self: Ref, other: Ref) -> bool { - let output: bool = >::ge(&_self, &other) - .into(); - output - } - fn gt(_self: Ref, other: Ref) -> bool { - let output: bool = >::gt(&_self, &other) - .into(); - output - } - fn le(_self: Ref, other: Ref) -> bool { - let output: bool = >::le(&_self, &other) - .into(); - output - } - fn lt(_self: Ref, other: Ref) -> bool { - let output: bool = >::lt(&_self, &other) - .into(); - output - } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - } -} +impl bevy::math::FloatOrd {} #[script_bindings( remote, name = "plane_3_d_functions", @@ -4732,25 +4119,6 @@ impl bevy::math::FloatOrd { generated )] impl bevy::math::primitives::Plane3d { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Create a new `Plane3d` from a normal and a half size /// # Panics /// Panics if the given `normal` is zero (or very close to zero), or non-finite. @@ -4785,25 +4153,6 @@ impl bevy::math::primitives::Tetrahedron { .into(); output } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Create a new [`Tetrahedron`] from points `a`, `b`, `c` and `d`. fn new( a: Val, @@ -4836,27 +4185,14 @@ impl bevy::math::primitives::Tetrahedron { bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::math::curve::easing::EaseFunction { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::math::curve::easing::EaseFunction {} +#[script_bindings( + remote, + name = "jump_at_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::math::curve::easing::JumpAt {} impl ::bevy::app::Plugin for BevyMathScriptingPlugin { fn build(&self, app: &mut ::bevy::prelude::App) { let mut world = app.world_mut(); @@ -4915,5 +4251,6 @@ impl ::bevy::app::Plugin for BevyMathScriptingPlugin { register_plane_3_d_functions(&mut world); register_tetrahedron_functions(&mut world); register_ease_function_functions(&mut world); + register_jump_at_functions(&mut world); } } diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_reflect.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_reflect.rs index 303da037a7..3751560827 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_reflect.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_reflect.rs @@ -18,7 +18,7 @@ pub struct BevyReflectScriptingPlugin; bms_core_path = "bevy_mod_scripting_core", generated )] -impl std::sync::atomic::AtomicBool { +impl core::sync::atomic::AtomicBool { /// Consumes the atomic and returns the contained value. /// This is safe because passing `self` by value guarantees that no other threads are /// concurrently accessing the atomic data. @@ -28,8 +28,8 @@ impl std::sync::atomic::AtomicBool { /// let some_bool = AtomicBool::new(true); /// assert_eq!(some_bool.into_inner(), true); /// ``` - fn into_inner(_self: Val) -> bool { - let output: bool = std::sync::atomic::AtomicBool::into_inner(_self.into_inner()) + fn into_inner(_self: Val) -> bool { + let output: bool = core::sync::atomic::AtomicBool::into_inner(_self.into_inner()) .into(); output } @@ -40,8 +40,8 @@ impl std::sync::atomic::AtomicBool { /// let atomic_true = AtomicBool::new(true); /// let atomic_false = AtomicBool::new(false); /// ``` - fn new(v: bool) -> Val { - let output: Val = std::sync::atomic::AtomicBool::new( + fn new(v: bool) -> Val { + let output: Val = core::sync::atomic::AtomicBool::new( v, ) .into(); @@ -54,7 +54,7 @@ impl std::sync::atomic::AtomicBool { bms_core_path = "bevy_mod_scripting_core", generated )] -impl std::sync::atomic::AtomicI16 { +impl core::sync::atomic::AtomicI16 { /// Consumes the atomic and returns the contained value. /// This is safe because passing `self` by value guarantees that no other threads are /// concurrently accessing the atomic data. @@ -64,8 +64,8 @@ impl std::sync::atomic::AtomicI16 { /// let some_var = AtomicI16::new(5); /// assert_eq!(some_var.into_inner(), 5); /// ``` - fn into_inner(_self: Val) -> i16 { - let output: i16 = std::sync::atomic::AtomicI16::into_inner(_self.into_inner()) + fn into_inner(_self: Val) -> i16 { + let output: i16 = core::sync::atomic::AtomicI16::into_inner(_self.into_inner()) .into(); output } @@ -75,8 +75,8 @@ impl std::sync::atomic::AtomicI16 { /// use std::sync::atomic::AtomicI16; /// let atomic_forty_two = AtomicI16::new(42); /// ``` - fn new(v: i16) -> Val { - let output: Val = std::sync::atomic::AtomicI16::new( + fn new(v: i16) -> Val { + let output: Val = core::sync::atomic::AtomicI16::new( v, ) .into(); @@ -89,7 +89,7 @@ impl std::sync::atomic::AtomicI16 { bms_core_path = "bevy_mod_scripting_core", generated )] -impl std::sync::atomic::AtomicI32 { +impl core::sync::atomic::AtomicI32 { /// Consumes the atomic and returns the contained value. /// This is safe because passing `self` by value guarantees that no other threads are /// concurrently accessing the atomic data. @@ -99,8 +99,8 @@ impl std::sync::atomic::AtomicI32 { /// let some_var = AtomicI32::new(5); /// assert_eq!(some_var.into_inner(), 5); /// ``` - fn into_inner(_self: Val) -> i32 { - let output: i32 = std::sync::atomic::AtomicI32::into_inner(_self.into_inner()) + fn into_inner(_self: Val) -> i32 { + let output: i32 = core::sync::atomic::AtomicI32::into_inner(_self.into_inner()) .into(); output } @@ -110,8 +110,8 @@ impl std::sync::atomic::AtomicI32 { /// use std::sync::atomic::AtomicI32; /// let atomic_forty_two = AtomicI32::new(42); /// ``` - fn new(v: i32) -> Val { - let output: Val = std::sync::atomic::AtomicI32::new( + fn new(v: i32) -> Val { + let output: Val = core::sync::atomic::AtomicI32::new( v, ) .into(); @@ -124,7 +124,7 @@ impl std::sync::atomic::AtomicI32 { bms_core_path = "bevy_mod_scripting_core", generated )] -impl std::sync::atomic::AtomicI64 { +impl core::sync::atomic::AtomicI64 { /// Consumes the atomic and returns the contained value. /// This is safe because passing `self` by value guarantees that no other threads are /// concurrently accessing the atomic data. @@ -134,8 +134,8 @@ impl std::sync::atomic::AtomicI64 { /// let some_var = AtomicI64::new(5); /// assert_eq!(some_var.into_inner(), 5); /// ``` - fn into_inner(_self: Val) -> i64 { - let output: i64 = std::sync::atomic::AtomicI64::into_inner(_self.into_inner()) + fn into_inner(_self: Val) -> i64 { + let output: i64 = core::sync::atomic::AtomicI64::into_inner(_self.into_inner()) .into(); output } @@ -145,8 +145,8 @@ impl std::sync::atomic::AtomicI64 { /// use std::sync::atomic::AtomicI64; /// let atomic_forty_two = AtomicI64::new(42); /// ``` - fn new(v: i64) -> Val { - let output: Val = std::sync::atomic::AtomicI64::new( + fn new(v: i64) -> Val { + let output: Val = core::sync::atomic::AtomicI64::new( v, ) .into(); @@ -159,7 +159,7 @@ impl std::sync::atomic::AtomicI64 { bms_core_path = "bevy_mod_scripting_core", generated )] -impl std::sync::atomic::AtomicI8 { +impl core::sync::atomic::AtomicI8 { /// Consumes the atomic and returns the contained value. /// This is safe because passing `self` by value guarantees that no other threads are /// concurrently accessing the atomic data. @@ -169,8 +169,8 @@ impl std::sync::atomic::AtomicI8 { /// let some_var = AtomicI8::new(5); /// assert_eq!(some_var.into_inner(), 5); /// ``` - fn into_inner(_self: Val) -> i8 { - let output: i8 = std::sync::atomic::AtomicI8::into_inner(_self.into_inner()) + fn into_inner(_self: Val) -> i8 { + let output: i8 = core::sync::atomic::AtomicI8::into_inner(_self.into_inner()) .into(); output } @@ -180,8 +180,8 @@ impl std::sync::atomic::AtomicI8 { /// use std::sync::atomic::AtomicI8; /// let atomic_forty_two = AtomicI8::new(42); /// ``` - fn new(v: i8) -> Val { - let output: Val = std::sync::atomic::AtomicI8::new( + fn new(v: i8) -> Val { + let output: Val = core::sync::atomic::AtomicI8::new( v, ) .into(); @@ -194,7 +194,7 @@ impl std::sync::atomic::AtomicI8 { bms_core_path = "bevy_mod_scripting_core", generated )] -impl std::sync::atomic::AtomicIsize { +impl core::sync::atomic::AtomicIsize { /// Consumes the atomic and returns the contained value. /// This is safe because passing `self` by value guarantees that no other threads are /// concurrently accessing the atomic data. @@ -204,8 +204,8 @@ impl std::sync::atomic::AtomicIsize { /// let some_var = AtomicIsize::new(5); /// assert_eq!(some_var.into_inner(), 5); /// ``` - fn into_inner(_self: Val) -> isize { - let output: isize = std::sync::atomic::AtomicIsize::into_inner( + fn into_inner(_self: Val) -> isize { + let output: isize = core::sync::atomic::AtomicIsize::into_inner( _self.into_inner(), ) .into(); @@ -217,8 +217,8 @@ impl std::sync::atomic::AtomicIsize { /// use std::sync::atomic::AtomicIsize; /// let atomic_forty_two = AtomicIsize::new(42); /// ``` - fn new(v: isize) -> Val { - let output: Val = std::sync::atomic::AtomicIsize::new( + fn new(v: isize) -> Val { + let output: Val = core::sync::atomic::AtomicIsize::new( v, ) .into(); @@ -231,7 +231,7 @@ impl std::sync::atomic::AtomicIsize { bms_core_path = "bevy_mod_scripting_core", generated )] -impl std::sync::atomic::AtomicU16 { +impl core::sync::atomic::AtomicU16 { /// Consumes the atomic and returns the contained value. /// This is safe because passing `self` by value guarantees that no other threads are /// concurrently accessing the atomic data. @@ -241,8 +241,8 @@ impl std::sync::atomic::AtomicU16 { /// let some_var = AtomicU16::new(5); /// assert_eq!(some_var.into_inner(), 5); /// ``` - fn into_inner(_self: Val) -> u16 { - let output: u16 = std::sync::atomic::AtomicU16::into_inner(_self.into_inner()) + fn into_inner(_self: Val) -> u16 { + let output: u16 = core::sync::atomic::AtomicU16::into_inner(_self.into_inner()) .into(); output } @@ -252,8 +252,8 @@ impl std::sync::atomic::AtomicU16 { /// use std::sync::atomic::AtomicU16; /// let atomic_forty_two = AtomicU16::new(42); /// ``` - fn new(v: u16) -> Val { - let output: Val = std::sync::atomic::AtomicU16::new( + fn new(v: u16) -> Val { + let output: Val = core::sync::atomic::AtomicU16::new( v, ) .into(); @@ -266,7 +266,7 @@ impl std::sync::atomic::AtomicU16 { bms_core_path = "bevy_mod_scripting_core", generated )] -impl std::sync::atomic::AtomicU32 { +impl core::sync::atomic::AtomicU32 { /// Consumes the atomic and returns the contained value. /// This is safe because passing `self` by value guarantees that no other threads are /// concurrently accessing the atomic data. @@ -276,8 +276,8 @@ impl std::sync::atomic::AtomicU32 { /// let some_var = AtomicU32::new(5); /// assert_eq!(some_var.into_inner(), 5); /// ``` - fn into_inner(_self: Val) -> u32 { - let output: u32 = std::sync::atomic::AtomicU32::into_inner(_self.into_inner()) + fn into_inner(_self: Val) -> u32 { + let output: u32 = core::sync::atomic::AtomicU32::into_inner(_self.into_inner()) .into(); output } @@ -287,8 +287,8 @@ impl std::sync::atomic::AtomicU32 { /// use std::sync::atomic::AtomicU32; /// let atomic_forty_two = AtomicU32::new(42); /// ``` - fn new(v: u32) -> Val { - let output: Val = std::sync::atomic::AtomicU32::new( + fn new(v: u32) -> Val { + let output: Val = core::sync::atomic::AtomicU32::new( v, ) .into(); @@ -301,7 +301,7 @@ impl std::sync::atomic::AtomicU32 { bms_core_path = "bevy_mod_scripting_core", generated )] -impl std::sync::atomic::AtomicU64 { +impl core::sync::atomic::AtomicU64 { /// Consumes the atomic and returns the contained value. /// This is safe because passing `self` by value guarantees that no other threads are /// concurrently accessing the atomic data. @@ -311,8 +311,8 @@ impl std::sync::atomic::AtomicU64 { /// let some_var = AtomicU64::new(5); /// assert_eq!(some_var.into_inner(), 5); /// ``` - fn into_inner(_self: Val) -> u64 { - let output: u64 = std::sync::atomic::AtomicU64::into_inner(_self.into_inner()) + fn into_inner(_self: Val) -> u64 { + let output: u64 = core::sync::atomic::AtomicU64::into_inner(_self.into_inner()) .into(); output } @@ -322,8 +322,8 @@ impl std::sync::atomic::AtomicU64 { /// use std::sync::atomic::AtomicU64; /// let atomic_forty_two = AtomicU64::new(42); /// ``` - fn new(v: u64) -> Val { - let output: Val = std::sync::atomic::AtomicU64::new( + fn new(v: u64) -> Val { + let output: Val = core::sync::atomic::AtomicU64::new( v, ) .into(); @@ -336,7 +336,7 @@ impl std::sync::atomic::AtomicU64 { bms_core_path = "bevy_mod_scripting_core", generated )] -impl std::sync::atomic::AtomicU8 { +impl core::sync::atomic::AtomicU8 { /// Consumes the atomic and returns the contained value. /// This is safe because passing `self` by value guarantees that no other threads are /// concurrently accessing the atomic data. @@ -346,8 +346,8 @@ impl std::sync::atomic::AtomicU8 { /// let some_var = AtomicU8::new(5); /// assert_eq!(some_var.into_inner(), 5); /// ``` - fn into_inner(_self: Val) -> u8 { - let output: u8 = std::sync::atomic::AtomicU8::into_inner(_self.into_inner()) + fn into_inner(_self: Val) -> u8 { + let output: u8 = core::sync::atomic::AtomicU8::into_inner(_self.into_inner()) .into(); output } @@ -357,8 +357,8 @@ impl std::sync::atomic::AtomicU8 { /// use std::sync::atomic::AtomicU8; /// let atomic_forty_two = AtomicU8::new(42); /// ``` - fn new(v: u8) -> Val { - let output: Val = std::sync::atomic::AtomicU8::new( + fn new(v: u8) -> Val { + let output: Val = core::sync::atomic::AtomicU8::new( v, ) .into(); @@ -371,7 +371,7 @@ impl std::sync::atomic::AtomicU8 { bms_core_path = "bevy_mod_scripting_core", generated )] -impl std::sync::atomic::AtomicUsize { +impl core::sync::atomic::AtomicUsize { /// Consumes the atomic and returns the contained value. /// This is safe because passing `self` by value guarantees that no other threads are /// concurrently accessing the atomic data. @@ -381,8 +381,8 @@ impl std::sync::atomic::AtomicUsize { /// let some_var = AtomicUsize::new(5); /// assert_eq!(some_var.into_inner(), 5); /// ``` - fn into_inner(_self: Val) -> usize { - let output: usize = std::sync::atomic::AtomicUsize::into_inner( + fn into_inner(_self: Val) -> usize { + let output: usize = core::sync::atomic::AtomicUsize::into_inner( _self.into_inner(), ) .into(); @@ -394,8 +394,8 @@ impl std::sync::atomic::AtomicUsize { /// use std::sync::atomic::AtomicUsize; /// let atomic_forty_two = AtomicUsize::new(42); /// ``` - fn new(v: usize) -> Val { - let output: Val = std::sync::atomic::AtomicUsize::new( + fn new(v: usize) -> Val { + let output: Val = core::sync::atomic::AtomicUsize::new( v, ) .into(); @@ -408,7 +408,7 @@ impl std::sync::atomic::AtomicUsize { bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::utils::Duration { +impl core::time::Duration { /// Computes the absolute difference between `self` and `other`. /// # Examples /// ``` @@ -417,26 +417,16 @@ impl bevy::utils::Duration { /// assert_eq!(Duration::new(100, 400_000_000).abs_diff(Duration::new(110, 0)), Duration::new(9, 600_000_000)); /// ``` fn abs_diff( - _self: Val, - other: Val, - ) -> Val { - let output: Val = bevy::utils::Duration::abs_diff( + _self: Val, + other: Val, + ) -> Val { + let output: Val = core::time::Duration::abs_diff( _self.into_inner(), other.into_inner(), ) .into(); output } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Returns the total number of whole microseconds contained by this `Duration`. /// # Examples /// ``` @@ -444,8 +434,8 @@ impl bevy::utils::Duration { /// let duration = Duration::new(5, 730_023_852); /// assert_eq!(duration.as_micros(), 5_730_023); /// ``` - fn as_micros(_self: Ref) -> u128 { - let output: u128 = bevy::utils::Duration::as_micros(&_self).into(); + fn as_micros(_self: Ref) -> u128 { + let output: u128 = core::time::Duration::as_micros(&_self).into(); output } /// Returns the total number of whole milliseconds contained by this `Duration`. @@ -455,8 +445,8 @@ impl bevy::utils::Duration { /// let duration = Duration::new(5, 730_023_852); /// assert_eq!(duration.as_millis(), 5_730); /// ``` - fn as_millis(_self: Ref) -> u128 { - let output: u128 = bevy::utils::Duration::as_millis(&_self).into(); + fn as_millis(_self: Ref) -> u128 { + let output: u128 = core::time::Duration::as_millis(&_self).into(); output } /// Returns the total number of nanoseconds contained by this `Duration`. @@ -466,8 +456,8 @@ impl bevy::utils::Duration { /// let duration = Duration::new(5, 730_023_852); /// assert_eq!(duration.as_nanos(), 5_730_023_852); /// ``` - fn as_nanos(_self: Ref) -> u128 { - let output: u128 = bevy::utils::Duration::as_nanos(&_self).into(); + fn as_nanos(_self: Ref) -> u128 { + let output: u128 = core::time::Duration::as_nanos(&_self).into(); output } /// Returns the number of _whole_ seconds contained by this `Duration`. @@ -484,8 +474,8 @@ impl bevy::utils::Duration { /// [`as_secs_f64`]: Duration::as_secs_f64 /// [`as_secs_f32`]: Duration::as_secs_f32 /// [`subsec_nanos`]: Duration::subsec_nanos - fn as_secs(_self: Ref) -> u64 { - let output: u64 = bevy::utils::Duration::as_secs(&_self).into(); + fn as_secs(_self: Ref) -> u64 { + let output: u64 = core::time::Duration::as_secs(&_self).into(); output } /// Returns the number of seconds contained by this `Duration` as `f32`. @@ -496,8 +486,8 @@ impl bevy::utils::Duration { /// let dur = Duration::new(2, 700_000_000); /// assert_eq!(dur.as_secs_f32(), 2.7); /// ``` - fn as_secs_f32(_self: Ref) -> f32 { - let output: f32 = bevy::utils::Duration::as_secs_f32(&_self).into(); + fn as_secs_f32(_self: Ref) -> f32 { + let output: f32 = core::time::Duration::as_secs_f32(&_self).into(); output } /// Returns the number of seconds contained by this `Duration` as `f64`. @@ -508,29 +498,8 @@ impl bevy::utils::Duration { /// let dur = Duration::new(2, 700_000_000); /// assert_eq!(dur.as_secs_f64(), 2.7); /// ``` - fn as_secs_f64(_self: Ref) -> f64 { - let output: f64 = bevy::utils::Duration::as_secs_f64(&_self).into(); - output - } - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn div(_self: Val, rhs: u32) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); + fn as_secs_f64(_self: Ref) -> f64 { + let output: f64 = core::time::Duration::as_secs_f64(&_self).into(); output } /// Divides `Duration` by `Duration` and returns `f32`. @@ -542,10 +511,10 @@ impl bevy::utils::Duration { /// assert_eq!(dur1.div_duration_f32(dur2), 0.5); /// ``` fn div_duration_f32( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> f32 { - let output: f32 = bevy::utils::Duration::div_duration_f32( + let output: f32 = core::time::Duration::div_duration_f32( _self.into_inner(), rhs.into_inner(), ) @@ -561,10 +530,10 @@ impl bevy::utils::Duration { /// assert_eq!(dur1.div_duration_f64(dur2), 0.5); /// ``` fn div_duration_f64( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> f64 { - let output: f64 = bevy::utils::Duration::div_duration_f64( + let output: f64 = core::time::Duration::div_duration_f64( _self.into_inner(), rhs.into_inner(), ) @@ -583,11 +552,8 @@ impl bevy::utils::Duration { /// assert_eq!(dur.div_f32(3.14), Duration::new(0, 859_872_580)); /// assert_eq!(dur.div_f32(3.14e5), Duration::new(0, 8_599)); /// ``` - fn div_f32( - _self: Val, - rhs: f32, - ) -> Val { - let output: Val = bevy::utils::Duration::div_f32( + fn div_f32(_self: Val, rhs: f32) -> Val { + let output: Val = core::time::Duration::div_f32( _self.into_inner(), rhs, ) @@ -604,24 +570,14 @@ impl bevy::utils::Duration { /// assert_eq!(dur.div_f64(3.14), Duration::new(0, 859_872_611)); /// assert_eq!(dur.div_f64(3.14e5), Duration::new(0, 8_599)); /// ``` - fn div_f64( - _self: Val, - rhs: f64, - ) -> Val { - let output: Val = bevy::utils::Duration::div_f64( + fn div_f64(_self: Val, rhs: f64) -> Val { + let output: Val = core::time::Duration::div_f64( _self.into_inner(), rhs, ) .into(); output } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Creates a new `Duration` from the specified number of microseconds. /// # Examples /// ``` @@ -630,10 +586,8 @@ impl bevy::utils::Duration { /// assert_eq!(1, duration.as_secs()); /// assert_eq!(2_000, duration.subsec_nanos()); /// ``` - fn from_micros(micros: u64) -> Val { - let output: Val = bevy::utils::Duration::from_micros( - micros, - ) + fn from_micros(micros: u64) -> Val { + let output: Val = core::time::Duration::from_micros(micros) .into(); output } @@ -645,10 +599,8 @@ impl bevy::utils::Duration { /// assert_eq!(2, duration.as_secs()); /// assert_eq!(569_000_000, duration.subsec_nanos()); /// ``` - fn from_millis(millis: u64) -> Val { - let output: Val = bevy::utils::Duration::from_millis( - millis, - ) + fn from_millis(millis: u64) -> Val { + let output: Val = core::time::Duration::from_millis(millis) .into(); output } @@ -664,8 +616,8 @@ impl bevy::utils::Duration { /// assert_eq!(1, duration.as_secs()); /// assert_eq!(123, duration.subsec_nanos()); /// ``` - fn from_nanos(nanos: u64) -> Val { - let output: Val = bevy::utils::Duration::from_nanos(nanos) + fn from_nanos(nanos: u64) -> Val { + let output: Val = core::time::Duration::from_nanos(nanos) .into(); output } @@ -677,8 +629,8 @@ impl bevy::utils::Duration { /// assert_eq!(5, duration.as_secs()); /// assert_eq!(0, duration.subsec_nanos()); /// ``` - fn from_secs(secs: u64) -> Val { - let output: Val = bevy::utils::Duration::from_secs(secs) + fn from_secs(secs: u64) -> Val { + let output: Val = core::time::Duration::from_secs(secs) .into(); output } @@ -706,10 +658,8 @@ impl bevy::utils::Duration { /// let res = Duration::from_secs_f32(0.999e-9); /// assert_eq!(res, Duration::new(0, 1)); /// ``` - fn from_secs_f32(secs: f32) -> Val { - let output: Val = bevy::utils::Duration::from_secs_f32( - secs, - ) + fn from_secs_f32(secs: f32) -> Val { + let output: Val = core::time::Duration::from_secs_f32(secs) .into(); output } @@ -737,10 +687,8 @@ impl bevy::utils::Duration { /// let res = Duration::from_secs_f64(0.999e-9); /// assert_eq!(res, Duration::new(0, 1)); /// ``` - fn from_secs_f64(secs: f64) -> Val { - let output: Val = bevy::utils::Duration::from_secs_f64( - secs, - ) + fn from_secs_f64(secs: f64) -> Val { + let output: Val = core::time::Duration::from_secs_f64(secs) .into(); output } @@ -756,15 +704,8 @@ impl bevy::utils::Duration { /// assert!(!Duration::from_nanos(1).is_zero()); /// assert!(!Duration::from_secs(1).is_zero()); /// ``` - fn is_zero(_self: Ref) -> bool { - let output: bool = bevy::utils::Duration::is_zero(&_self).into(); - output - } - fn mul(_self: Val, rhs: u32) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); + fn is_zero(_self: Ref) -> bool { + let output: bool = core::time::Duration::is_zero(&_self).into(); output } /// Multiplies `Duration` by `f32`. @@ -777,11 +718,8 @@ impl bevy::utils::Duration { /// assert_eq!(dur.mul_f32(3.14), Duration::new(8, 478_000_641)); /// assert_eq!(dur.mul_f32(3.14e5), Duration::new(847_800, 0)); /// ``` - fn mul_f32( - _self: Val, - rhs: f32, - ) -> Val { - let output: Val = bevy::utils::Duration::mul_f32( + fn mul_f32(_self: Val, rhs: f32) -> Val { + let output: Val = core::time::Duration::mul_f32( _self.into_inner(), rhs, ) @@ -798,11 +736,8 @@ impl bevy::utils::Duration { /// assert_eq!(dur.mul_f64(3.14), Duration::new(8, 478_000_000)); /// assert_eq!(dur.mul_f64(3.14e5), Duration::new(847_800, 0)); /// ``` - fn mul_f64( - _self: Val, - rhs: f64, - ) -> Val { - let output: Val = bevy::utils::Duration::mul_f64( + fn mul_f64(_self: Val, rhs: f64) -> Val { + let output: Val = core::time::Duration::mul_f64( _self.into_inner(), rhs, ) @@ -821,8 +756,8 @@ impl bevy::utils::Duration { /// use std::time::Duration; /// let five_seconds = Duration::new(5, 0); /// ``` - fn new(secs: u64, nanos: u32) -> Val { - let output: Val = bevy::utils::Duration::new(secs, nanos) + fn new(secs: u64, nanos: u32) -> Val { + let output: Val = core::time::Duration::new(secs, nanos) .into(); output } @@ -836,10 +771,10 @@ impl bevy::utils::Duration { /// assert_eq!(Duration::new(1, 0).saturating_add(Duration::new(u64::MAX, 0)), Duration::MAX); /// ``` fn saturating_add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::utils::Duration::saturating_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = core::time::Duration::saturating_add( _self.into_inner(), rhs.into_inner(), ) @@ -856,10 +791,10 @@ impl bevy::utils::Duration { /// assert_eq!(Duration::new(u64::MAX - 1, 0).saturating_mul(2), Duration::MAX); /// ``` fn saturating_mul( - _self: Val, + _self: Val, rhs: u32, - ) -> Val { - let output: Val = bevy::utils::Duration::saturating_mul( + ) -> Val { + let output: Val = core::time::Duration::saturating_mul( _self.into_inner(), rhs, ) @@ -875,26 +810,16 @@ impl bevy::utils::Duration { /// assert_eq!(Duration::new(0, 0).saturating_sub(Duration::new(0, 1)), Duration::ZERO); /// ``` fn saturating_sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::utils::Duration::saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = core::time::Duration::saturating_sub( _self.into_inner(), rhs.into_inner(), ) .into(); output } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Returns the fractional part of this `Duration`, in whole microseconds. /// This method does **not** return the length of the duration when /// represented by microseconds. The returned number always represents a @@ -906,8 +831,8 @@ impl bevy::utils::Duration { /// assert_eq!(duration.as_secs(), 1); /// assert_eq!(duration.subsec_micros(), 234_567); /// ``` - fn subsec_micros(_self: Ref) -> u32 { - let output: u32 = bevy::utils::Duration::subsec_micros(&_self).into(); + fn subsec_micros(_self: Ref) -> u32 { + let output: u32 = core::time::Duration::subsec_micros(&_self).into(); output } /// Returns the fractional part of this `Duration`, in whole milliseconds. @@ -921,8 +846,8 @@ impl bevy::utils::Duration { /// assert_eq!(duration.as_secs(), 5); /// assert_eq!(duration.subsec_millis(), 432); /// ``` - fn subsec_millis(_self: Ref) -> u32 { - let output: u32 = bevy::utils::Duration::subsec_millis(&_self).into(); + fn subsec_millis(_self: Ref) -> u32 { + let output: u32 = core::time::Duration::subsec_millis(&_self).into(); output } /// Returns the fractional part of this `Duration`, in nanoseconds. @@ -936,8 +861,8 @@ impl bevy::utils::Duration { /// assert_eq!(duration.as_secs(), 5); /// assert_eq!(duration.subsec_nanos(), 10_000_000); /// ``` - fn subsec_nanos(_self: Ref) -> u32 { - let output: u32 = bevy::utils::Duration::subsec_nanos(&_self).into(); + fn subsec_nanos(_self: Ref) -> u32 { + let output: u32 = core::time::Duration::subsec_nanos(&_self).into(); output } } @@ -947,34 +872,7 @@ impl bevy::utils::Duration { bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::utils::Instant { - /// # Panics - /// This function may panic if the resulting point in time cannot be represented by the - /// underlying data structure. See [`Instant::checked_add`] for a version without panic. - fn add( - _self: Val, - other: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), other.into_inner()) - .into(); - output - } - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } +impl std::time::Instant { /// Returns the amount of time elapsed from another instant to this one, /// or zero duration if that instant is later than this one. /// # Panics @@ -993,10 +891,10 @@ impl bevy::utils::Instant { /// println!("{:?}", now.duration_since(new_now)); // 0ns /// ``` fn duration_since( - _self: Ref, - earlier: Val, - ) -> Val { - let output: Val = bevy::utils::Instant::duration_since( + _self: Ref, + earlier: Val, + ) -> Val { + let output: Val = std::time::Instant::duration_since( &_self, earlier.into_inner(), ) @@ -1018,15 +916,8 @@ impl bevy::utils::Instant { /// sleep(three_secs); /// assert!(instant.elapsed() >= three_secs); /// ``` - fn elapsed(_self: Ref) -> Val { - let output: Val = bevy::utils::Instant::elapsed(&_self) - .into(); - output - } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) + fn elapsed(_self: Ref) -> Val { + let output: Val = std::time::Instant::elapsed(&_self) .into(); output } @@ -1036,8 +927,8 @@ impl bevy::utils::Instant { /// use std::time::Instant; /// let now = Instant::now(); /// ``` - fn now() -> Val { - let output: Val = bevy::utils::Instant::now().into(); + fn now() -> Val { + let output: Val = std::time::Instant::now().into(); output } /// Returns the amount of time elapsed from another instant to this one, @@ -1053,43 +944,16 @@ impl bevy::utils::Instant { /// println!("{:?}", now.saturating_duration_since(new_now)); // 0ns /// ``` fn saturating_duration_since( - _self: Ref, - earlier: Val, - ) -> Val { - let output: Val = bevy::utils::Instant::saturating_duration_since( + _self: Ref, + earlier: Val, + ) -> Val { + let output: Val = std::time::Instant::saturating_duration_since( &_self, earlier.into_inner(), ) .into(); output } - fn sub( - _self: Val, - other: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), other.into_inner()) - .into(); - output - } - /// Returns the amount of time elapsed from another instant to this one, - /// or zero duration if that instant is later than this one. - /// # Panics - /// Previous Rust versions panicked when `other` was later than `self`. Currently this - /// method saturates. Future versions may reintroduce the panic in some circumstances. - /// See [Monotonicity]. - /// [Monotonicity]: Instant#monotonicity - fn sub( - _self: Val, - other: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), other.into_inner()) - .into(); - output - } } #[script_bindings( remote, @@ -1097,26 +961,27 @@ impl bevy::utils::Instant { bms_core_path = "bevy_mod_scripting_core", generated )] -impl std::ops::RangeFull { - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); +impl core::ops::RangeFull {} +#[script_bindings( + remote, + name = "type_id_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl core::any::TypeId { + /// Returns the `TypeId` of the type this generic function has been + /// instantiated with. + /// # Examples + /// ``` + /// use std::any::{Any, TypeId}; + /// fn is_string(_s: &T) -> bool { + /// TypeId::of::() == TypeId::of::() + /// } + /// assert_eq!(is_string(&0), false); + /// assert_eq!(is_string(&"cookie monster".to_string()), true); + /// ``` + fn of() -> Val { + let output: Val = core::any::TypeId::of().into(); output } } @@ -1147,20 +1012,6 @@ impl bevy::math::Quat { .into(); output } - /// Adds two quaternions. - /// The sum is not guaranteed to be normalized. - /// Note that addition is not the same as combining the rotations represented by the - /// two quaternions! That corresponds to multiplication. - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Returns the angle (in radians) for the minimal rotation /// for transforming this quaternion into another. /// Both quaternions must be normalized. @@ -1181,13 +1032,6 @@ impl bevy::math::Quat { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns the quaternion conjugate of `self`. For a unit quaternion the /// conjugate is also the inverse. fn conjugate(_self: Val) -> Val { @@ -1197,15 +1041,6 @@ impl bevy::math::Quat { .into(); output } - /// Divides a quaternion by a scalar value. - /// The quotient is not guaranteed to be normalized. - fn div(_self: Val, rhs: f32) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Computes the dot product of `self` and `rhs`. The dot product is /// equal to the cosine of the angle between two quaternion rotations. fn dot(_self: Val, rhs: Val) -> f32 { @@ -1213,13 +1048,6 @@ impl bevy::math::Quat { .into(); output } - fn eq(_self: Ref, rhs: Ref) -> bool { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - } /// Creates a quaternion from a 3x3 rotation matrix inside a 3D affine transform. /// Note if the input affine matrix contain scales, shears, or other non-rotation /// transformations then the resulting quaternion will be ill-defined. @@ -1473,54 +1301,6 @@ impl bevy::math::Quat { } /// Multiplies two quaternions. If they each represent a rotation, the result will /// represent the combined rotation. - /// Note that due to floating point rounding the result may not be perfectly - /// normalized. - /// # Panics - /// Will panic if `self` or `rhs` are not normalized when `glam_assert` is enabled. - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - /// Multiplies a quaternion and a 3D vector, returning the rotated vector. - /// # Panics - /// Will panic if `self` is not normalized when `glam_assert` is enabled. - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - /// Multiplies a quaternion by a scalar value. - /// The product is not guaranteed to be normalized. - fn mul(_self: Val, rhs: f32) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } - /// 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. @@ -1561,13 +1341,6 @@ impl bevy::math::Quat { .into(); output } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - } /// Returns `self` normalized to length 1.0. /// For valid results, `self` must _not_ be of length zero. /// Panics @@ -1618,18 +1391,6 @@ impl bevy::math::Quat { .into(); output } - /// Subtracts the `rhs` quaternion from `self`. - /// The difference is not guaranteed to be normalized. - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// `[x, y, z, w]` fn to_array(_self: Ref) -> [f32; 4] { let output: [f32; 4] = bevy::math::Quat::to_array(&_self).into(); @@ -1695,33 +1456,6 @@ impl bevy::math::Vec3 { .into(); output } - fn add( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn add(_self: Val, rhs: f32) -> Val { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - } /// Returns the angle (in radians) between two vectors in the range `[0, +π]`. /// The inputs do not need to be unit vectors however they must be non-zero. fn angle_between(_self: Val, rhs: Val) -> f32 { @@ -1759,23 +1493,45 @@ impl bevy::math::Vec3 { let output: Val = bevy::math::Vec3::as_dvec3(&_self).into(); output } + /// Casts all elements of `self` to `i16`. + fn as_i16vec3(_self: Ref) -> Val { + let output: Val = bevy::math::Vec3::as_i16vec3(&_self) + .into(); + output + } /// Casts all elements of `self` to `i64`. fn as_i64vec3(_self: Ref) -> Val { let output: Val = bevy::math::Vec3::as_i64vec3(&_self) .into(); output } + /// Casts all elements of `self` to `i8`. + fn as_i8vec3(_self: Ref) -> Val { + let output: Val = bevy::math::Vec3::as_i8vec3(&_self).into(); + output + } /// Casts all elements of `self` to `i32`. fn as_ivec3(_self: Ref) -> Val { let output: Val = bevy::math::Vec3::as_ivec3(&_self).into(); output } + /// Casts all elements of `self` to `u16`. + fn as_u16vec3(_self: Ref) -> Val { + let output: Val = bevy::math::Vec3::as_u16vec3(&_self) + .into(); + output + } /// Casts all elements of `self` to `u64`. fn as_u64vec3(_self: Ref) -> Val { let output: Val = bevy::math::Vec3::as_u64vec3(&_self) .into(); output } + /// Casts all elements of `self` to `u8`. + fn as_u8vec3(_self: Ref) -> Val { + let output: Val = bevy::math::Vec3::as_u8vec3(&_self).into(); + output + } /// Casts all elements of `self` to `u32`. fn as_uvec3(_self: Ref) -> Val { let output: Val = bevy::math::Vec3::as_uvec3(&_self).into(); @@ -1849,13 +1605,6 @@ impl bevy::math::Vec3 { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns a vector mask containing the result of a `==` comparison for each element of /// `self` and `rhs`. /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all @@ -1991,33 +1740,6 @@ impl bevy::math::Vec3 { .into(); output } - fn div( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - } - fn div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn div(_self: Val, rhs: f32) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. fn div_euclid( _self: Val, @@ -2060,13 +1782,6 @@ impl bevy::math::Vec3 { let output: f32 = bevy::math::Vec3::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Returns a vector containing `e^self` (the exponential function) for each element of /// `self`. fn exp(_self: Val) -> Val { @@ -2261,33 +1976,6 @@ impl bevy::math::Vec3 { .into(); output } - fn mul( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: f32) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } /// Fused multiply-add. Computes `(self * a) + b` element-wise with only one rounding /// error, yielding a more accurate result than an unfused multiply-add. /// Using `mul_add` *may* be more performant than an unfused multiply-add if the target @@ -2307,13 +1995,6 @@ impl bevy::math::Vec3 { .into(); output } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - } /// Creates a new vector. fn new(x: f32, y: f32, z: f32) -> Val { let output: Val = bevy::math::Vec3::new(x, y, z).into(); @@ -2469,33 +2150,6 @@ impl bevy::math::Vec3 { .into(); output } - fn rem( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - } - fn rem( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn rem(_self: Val, rhs: f32) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - } /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. /// [Euclidean division]: f32::rem_euclid fn rem_euclid( @@ -2547,33 +2201,6 @@ impl bevy::math::Vec3 { let output: Val = bevy::math::Vec3::splat(v).into(); output } - fn sub( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn sub(_self: Val, rhs: f32) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - } /// `[x, y, z]` fn to_array(_self: Ref) -> [f32; 3] { let output: [f32; 3] = bevy::math::Vec3::to_array(&_self).into(); @@ -2625,48 +2252,88 @@ impl bevy::math::Vec3 { } #[script_bindings( remote, - name = "i_vec_2_functions", + name = "socket_addr_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::math::IVec2 { - /// Returns a vector containing the absolute value of each element of `self`. - fn abs(_self: Val) -> Val { - let output: Val = bevy::math::IVec2::abs(_self.into_inner()) - .into(); +impl core::net::SocketAddr { + /// Returns [`true`] if the [IP address] in this `SocketAddr` is an + /// [`IPv4` address], and [`false`] otherwise. + /// [IP address]: IpAddr + /// [`IPv4` address]: IpAddr::V4 + /// # Examples + /// ``` + /// use std::net::{IpAddr, Ipv4Addr, SocketAddr}; + /// let socket = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080); + /// assert_eq!(socket.is_ipv4(), true); + /// assert_eq!(socket.is_ipv6(), false); + /// ``` + fn is_ipv4(_self: Ref) -> bool { + let output: bool = core::net::SocketAddr::is_ipv4(&_self).into(); output } - fn add( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); + /// Returns [`true`] if the [IP address] in this `SocketAddr` is an + /// [`IPv6` address], and [`false`] otherwise. + /// [IP address]: IpAddr + /// [`IPv6` address]: IpAddr::V6 + /// # Examples + /// ``` + /// use std::net::{IpAddr, Ipv6Addr, SocketAddr}; + /// let socket = SocketAddr::new(IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 65535, 0, 1)), 8080); + /// assert_eq!(socket.is_ipv4(), false); + /// assert_eq!(socket.is_ipv6(), true); + /// ``` + fn is_ipv6(_self: Ref) -> bool { + let output: bool = core::net::SocketAddr::is_ipv6(&_self).into(); output } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); + /// Returns the port number associated with this socket address. + /// # Examples + /// ``` + /// use std::net::{IpAddr, Ipv4Addr, SocketAddr}; + /// let socket = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080); + /// assert_eq!(socket.port(), 8080); + /// ``` + fn port(_self: Ref) -> u16 { + let output: u16 = core::net::SocketAddr::port(&_self).into(); output } - fn add(_self: Val, rhs: i32) -> Val { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); + /// Changes the port number associated with this socket address. + /// # Examples + /// ``` + /// use std::net::{IpAddr, Ipv4Addr, SocketAddr}; + /// let mut socket = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080); + /// socket.set_port(1025); + /// assert_eq!(socket.port(), 1025); + /// ``` + fn set_port(mut _self: Mut, new_port: u16) -> () { + let output: () = core::net::SocketAddr::set_port(&mut _self, new_port).into(); output } - /// Casts all elements of `self` to `f64`. - fn as_dvec2(_self: Ref) -> Val { - let output: Val = bevy::math::IVec2::as_dvec2(&_self).into(); - output +} +#[script_bindings( + remote, + name = "i_vec_2_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::math::IVec2 { + /// Returns a vector containing the absolute value of each element of `self`. + fn abs(_self: Val) -> Val { + let output: Val = bevy::math::IVec2::abs(_self.into_inner()) + .into(); + output + } + /// Casts all elements of `self` to `f64`. + fn as_dvec2(_self: Ref) -> Val { + let output: Val = bevy::math::IVec2::as_dvec2(&_self).into(); + output + } + /// Casts all elements of `self` to `i16`. + fn as_i16vec2(_self: Ref) -> Val { + let output: Val = bevy::math::IVec2::as_i16vec2(&_self) + .into(); + output } /// Casts all elements of `self` to `i64`. fn as_i64vec2(_self: Ref) -> Val { @@ -2674,12 +2341,30 @@ impl bevy::math::IVec2 { .into(); output } + /// Casts all elements of `self` to `i8`. + fn as_i8vec2(_self: Ref) -> Val { + let output: Val = bevy::math::IVec2::as_i8vec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u16`. + fn as_u16vec2(_self: Ref) -> Val { + let output: Val = bevy::math::IVec2::as_u16vec2(&_self) + .into(); + output + } /// Casts all elements of `self` to `u64`. fn as_u64vec2(_self: Ref) -> Val { let output: Val = bevy::math::IVec2::as_u64vec2(&_self) .into(); output } + /// Casts all elements of `self` to `u8`. + fn as_u8vec2(_self: Ref) -> Val { + let output: Val = bevy::math::IVec2::as_u8vec2(&_self) + .into(); + output + } /// Casts all elements of `self` to `u32`. fn as_uvec2(_self: Ref) -> Val { let output: Val = bevy::math::IVec2::as_uvec2(&_self).into(); @@ -2690,13 +2375,6 @@ impl bevy::math::IVec2 { let output: Val = bevy::math::IVec2::as_vec2(&_self).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } /// Component-wise clamping of values, similar to [`i32::clamp`]. /// Each element in `min` must be less-or-equal to the corresponding element in `max`. /// # Panics @@ -2714,13 +2392,6 @@ impl bevy::math::IVec2 { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns a vector mask containing the result of a `==` comparison for each element of /// `self` and `rhs`. /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all @@ -2823,33 +2494,6 @@ impl bevy::math::IVec2 { .into(); output } - fn div( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - } - fn div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn div(_self: Val, rhs: i32) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. /// # Panics /// This function will panic if any `rhs` element is 0 or the division results in overflow. @@ -2894,13 +2538,6 @@ impl bevy::math::IVec2 { let output: i32 = bevy::math::IVec2::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Creates a 3D vector from `self` and the given `z` value. fn extend(_self: Val, z: i32) -> Val { let output: Val = bevy::math::IVec2::extend( @@ -2966,40 +2603,6 @@ impl bevy::math::IVec2 { let output: i32 = bevy::math::IVec2::min_element(_self.into_inner()).into(); output } - fn mul( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: i32) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - } /// Creates a new vector. fn new(x: i32, y: i32) -> Val { let output: Val = bevy::math::IVec2::new(x, y).into(); @@ -3021,33 +2624,6 @@ impl bevy::math::IVec2 { .into(); output } - fn rem( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - } - fn rem( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn rem(_self: Val, rhs: i32) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - } /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. /// # Panics /// This function will panic if any `rhs` element is 0 or the division results in overflow. @@ -3187,33 +2763,6 @@ impl bevy::math::IVec2 { let output: Val = bevy::math::IVec2::splat(v).into(); output } - fn sub( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn sub(_self: Val, rhs: i32) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - } /// `[x, y]` fn to_array(_self: Ref) -> [i32; 2] { let output: [i32; 2] = bevy::math::IVec2::to_array(&_self).into(); @@ -3329,41 +2878,32 @@ impl bevy::math::IVec3 { .into(); output } - fn add( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); + /// Casts all elements of `self` to `f64`. + fn as_dvec3(_self: Ref) -> Val { + let output: Val = bevy::math::IVec3::as_dvec3(&_self).into(); output } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + /// Casts all elements of `self` to `i16`. + fn as_i16vec3(_self: Ref) -> Val { + let output: Val = bevy::math::IVec3::as_i16vec3(&_self) .into(); output } - fn add(_self: Val, rhs: i32) -> Val { - let output: Val = >::add(_self.into_inner(), rhs) + /// Casts all elements of `self` to `i64`. + fn as_i64vec3(_self: Ref) -> Val { + let output: Val = bevy::math::IVec3::as_i64vec3(&_self) .into(); output } - /// Casts all elements of `self` to `f64`. - fn as_dvec3(_self: Ref) -> Val { - let output: Val = bevy::math::IVec3::as_dvec3(&_self).into(); + /// Casts all elements of `self` to `i8`. + fn as_i8vec3(_self: Ref) -> Val { + let output: Val = bevy::math::IVec3::as_i8vec3(&_self) + .into(); output } - /// Casts all elements of `self` to `i64`. - fn as_i64vec3(_self: Ref) -> Val { - let output: Val = bevy::math::IVec3::as_i64vec3(&_self) + /// Casts all elements of `self` to `u16`. + fn as_u16vec3(_self: Ref) -> Val { + let output: Val = bevy::math::IVec3::as_u16vec3(&_self) .into(); output } @@ -3373,6 +2913,12 @@ impl bevy::math::IVec3 { .into(); output } + /// Casts all elements of `self` to `u8`. + fn as_u8vec3(_self: Ref) -> Val { + let output: Val = bevy::math::IVec3::as_u8vec3(&_self) + .into(); + output + } /// Casts all elements of `self` to `u32`. fn as_uvec3(_self: Ref) -> Val { let output: Val = bevy::math::IVec3::as_uvec3(&_self).into(); @@ -3388,13 +2934,6 @@ impl bevy::math::IVec3 { let output: Val = bevy::math::IVec3::as_vec3a(&_self).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } /// Component-wise clamping of values, similar to [`i32::clamp`]. /// Each element in `min` must be less-or-equal to the corresponding element in `max`. /// # Panics @@ -3412,13 +2951,6 @@ impl bevy::math::IVec3 { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns a vector mask containing the result of a `==` comparison for each element of /// `self` and `rhs`. /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all @@ -3533,33 +3065,6 @@ impl bevy::math::IVec3 { .into(); output } - fn div( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - } - fn div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn div(_self: Val, rhs: i32) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. /// # Panics /// This function will panic if any `rhs` element is 0 or the division results in overflow. @@ -3604,13 +3109,6 @@ impl bevy::math::IVec3 { let output: i32 = bevy::math::IVec3::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Creates a 4D vector from `self` and the given `w` value. fn extend(_self: Val, w: i32) -> Val { let output: Val = bevy::math::IVec3::extend( @@ -3676,72 +3174,11 @@ impl bevy::math::IVec3 { let output: i32 = bevy::math::IVec3::min_element(_self.into_inner()).into(); output } - fn mul( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: i32) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - } /// Creates a new vector. fn new(x: i32, y: i32, z: i32) -> Val { let output: Val = bevy::math::IVec3::new(x, y, z).into(); output } - fn rem( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - } - fn rem( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn rem(_self: Val, rhs: i32) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - } /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. /// # Panics /// This function will panic if any `rhs` element is 0 or the division results in overflow. @@ -3867,33 +3304,6 @@ impl bevy::math::IVec3 { let output: Val = bevy::math::IVec3::splat(v).into(); output } - fn sub( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn sub(_self: Val, rhs: i32) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - } /// `[x, y, z]` fn to_array(_self: Ref) -> [i32; 3] { let output: [i32; 3] = bevy::math::IVec3::to_array(&_self).into(); @@ -4027,41 +3437,32 @@ impl bevy::math::IVec4 { .into(); output } - fn add( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); + /// Casts all elements of `self` to `f64`. + fn as_dvec4(_self: Ref) -> Val { + let output: Val = bevy::math::IVec4::as_dvec4(&_self).into(); output } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + /// Casts all elements of `self` to `i16`. + fn as_i16vec4(_self: Ref) -> Val { + let output: Val = bevy::math::IVec4::as_i16vec4(&_self) .into(); output } - fn add(_self: Val, rhs: i32) -> Val { - let output: Val = >::add(_self.into_inner(), rhs) + /// Casts all elements of `self` to `i64`. + fn as_i64vec4(_self: Ref) -> Val { + let output: Val = bevy::math::IVec4::as_i64vec4(&_self) .into(); output } - /// Casts all elements of `self` to `f64`. - fn as_dvec4(_self: Ref) -> Val { - let output: Val = bevy::math::IVec4::as_dvec4(&_self).into(); + /// Casts all elements of `self` to `i8`. + fn as_i8vec4(_self: Ref) -> Val { + let output: Val = bevy::math::IVec4::as_i8vec4(&_self) + .into(); output } - /// Casts all elements of `self` to `i64`. - fn as_i64vec4(_self: Ref) -> Val { - let output: Val = bevy::math::IVec4::as_i64vec4(&_self) + /// Casts all elements of `self` to `u16`. + fn as_u16vec4(_self: Ref) -> Val { + let output: Val = bevy::math::IVec4::as_u16vec4(&_self) .into(); output } @@ -4071,6 +3472,12 @@ impl bevy::math::IVec4 { .into(); output } + /// Casts all elements of `self` to `u8`. + fn as_u8vec4(_self: Ref) -> Val { + let output: Val = bevy::math::IVec4::as_u8vec4(&_self) + .into(); + output + } /// Casts all elements of `self` to `u32`. fn as_uvec4(_self: Ref) -> Val { let output: Val = bevy::math::IVec4::as_uvec4(&_self).into(); @@ -4081,13 +3488,6 @@ impl bevy::math::IVec4 { let output: Val = bevy::math::IVec4::as_vec4(&_self).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } /// Component-wise clamping of values, similar to [`i32::clamp`]. /// Each element in `min` must be less-or-equal to the corresponding element in `max`. /// # Panics @@ -4105,13 +3505,6 @@ impl bevy::math::IVec4 { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns a vector mask containing the result of a `==` comparison for each element of /// `self` and `rhs`. /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all @@ -4214,33 +3607,6 @@ impl bevy::math::IVec4 { .into(); output } - fn div( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - } - fn div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn div(_self: Val, rhs: i32) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. /// # Panics /// This function will panic if any `rhs` element is 0 or the division results in overflow. @@ -4285,13 +3651,6 @@ impl bevy::math::IVec4 { let output: i32 = bevy::math::IVec4::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Creates a new vector from an array. fn from_array(a: [i32; 4]) -> Val { let output: Val = bevy::math::IVec4::from_array(a).into(); @@ -4348,70 +3707,9 @@ impl bevy::math::IVec4 { let output: i32 = bevy::math::IVec4::min_element(_self.into_inner()).into(); output } - fn mul( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: i32) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - } - /// Creates a new vector. - fn new(x: i32, y: i32, z: i32, w: i32) -> Val { - let output: Val = bevy::math::IVec4::new(x, y, z, w).into(); - output - } - fn rem( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - } - fn rem( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn rem(_self: Val, rhs: i32) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); + /// Creates a new vector. + fn new(x: i32, y: i32, z: i32, w: i32) -> Val { + let output: Val = bevy::math::IVec4::new(x, y, z, w).into(); output } /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. @@ -4539,33 +3837,6 @@ impl bevy::math::IVec4 { let output: Val = bevy::math::IVec4::splat(v).into(); output } - fn sub( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn sub(_self: Val, rhs: i32) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - } /// `[x, y, z, w]` fn to_array(_self: Ref) -> [i32; 4] { let output: [i32; 4] = bevy::math::IVec4::to_array(&_self).into(); @@ -4697,92 +3968,77 @@ impl bevy::math::IVec4 { } #[script_bindings( remote, - name = "i_64_vec_2_functions", + name = "i_8_vec_2_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::math::I64Vec2 { +impl bevy::math::I8Vec2 { /// Returns a vector containing the absolute value of each element of `self`. - fn abs(_self: Val) -> Val { - let output: Val = bevy::math::I64Vec2::abs( - _self.into_inner(), - ) + fn abs(_self: Val) -> Val { + let output: Val = bevy::math::I8Vec2::abs(_self.into_inner()) .into(); output } - fn add( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); + /// Casts all elements of `self` to `f64`. + fn as_dvec2(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec2::as_dvec2(&_self).into(); output } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + /// Casts all elements of `self` to `i16`. + fn as_i16vec2(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec2::as_i16vec2(&_self) .into(); output } - fn add(_self: Val, rhs: i64) -> Val { - let output: Val = >::add(_self.into_inner(), rhs) + /// Casts all elements of `self` to `i64`. + fn as_i64vec2(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec2::as_i64vec2(&_self) .into(); output } - /// Casts all elements of `self` to `f64`. - fn as_dvec2(_self: Ref) -> Val { - let output: Val = bevy::math::I64Vec2::as_dvec2(&_self) - .into(); + /// Casts all elements of `self` to `i32`. + fn as_ivec2(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec2::as_ivec2(&_self).into(); output } - /// Casts all elements of `self` to `i32`. - fn as_ivec2(_self: Ref) -> Val { - let output: Val = bevy::math::I64Vec2::as_ivec2(&_self) + /// Casts all elements of `self` to `u16`. + fn as_u16vec2(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec2::as_u16vec2(&_self) .into(); output } /// Casts all elements of `self` to `u64`. - fn as_u64vec2(_self: Ref) -> Val { - let output: Val = bevy::math::I64Vec2::as_u64vec2(&_self) + fn as_u64vec2(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec2::as_u64vec2(&_self) .into(); output } - /// Casts all elements of `self` to `u32`. - fn as_uvec2(_self: Ref) -> Val { - let output: Val = bevy::math::I64Vec2::as_uvec2(&_self) + /// Casts all elements of `self` to `u8`. + fn as_u8vec2(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec2::as_u8vec2(&_self) .into(); output } - /// Casts all elements of `self` to `f32`. - fn as_vec2(_self: Ref) -> Val { - let output: Val = bevy::math::I64Vec2::as_vec2(&_self).into(); + /// Casts all elements of `self` to `u32`. + fn as_uvec2(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec2::as_uvec2(&_self).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); + /// Casts all elements of `self` to `f32`. + fn as_vec2(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec2::as_vec2(&_self).into(); output } - /// Component-wise clamping of values, similar to [`i64::clamp`]. + /// Component-wise clamping of values, similar to [`i8::clamp`]. /// Each element in `min` must be less-or-equal to the corresponding element in `max`. /// # Panics /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( - _self: Val, - min: Val, - max: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec2::clamp( + _self: Val, + min: Val, + max: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec2::clamp( _self.into_inner(), min.into_inner(), max.into_inner(), @@ -4790,22 +4046,15 @@ impl bevy::math::I64Vec2 { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns a vector mask containing the result of a `==` comparison for each element of /// `self` and `rhs`. /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all /// elements. fn cmpeq( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::I64Vec2::cmpeq( + let output: Val = bevy::math::I8Vec2::cmpeq( _self.into_inner(), rhs.into_inner(), ) @@ -4817,10 +4066,10 @@ impl bevy::math::I64Vec2 { /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all /// elements. fn cmpge( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::I64Vec2::cmpge( + let output: Val = bevy::math::I8Vec2::cmpge( _self.into_inner(), rhs.into_inner(), ) @@ -4832,10 +4081,10 @@ impl bevy::math::I64Vec2 { /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all /// elements. fn cmpgt( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::I64Vec2::cmpgt( + let output: Val = bevy::math::I8Vec2::cmpgt( _self.into_inner(), rhs.into_inner(), ) @@ -4847,10 +4096,10 @@ impl bevy::math::I64Vec2 { /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all /// elements. fn cmple( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::I64Vec2::cmple( + let output: Val = bevy::math::I8Vec2::cmple( _self.into_inner(), rhs.into_inner(), ) @@ -4862,10 +4111,10 @@ impl bevy::math::I64Vec2 { /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all /// elements. fn cmplt( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::I64Vec2::cmplt( + let output: Val = bevy::math::I8Vec2::cmplt( _self.into_inner(), rhs.into_inner(), ) @@ -4877,10 +4126,10 @@ impl bevy::math::I64Vec2 { /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all /// elements. fn cmpne( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::I64Vec2::cmpne( + let output: Val = bevy::math::I8Vec2::cmpne( _self.into_inner(), rhs.into_inner(), ) @@ -4889,51 +4138,24 @@ impl bevy::math::I64Vec2 { } /// Compute the squared euclidean distance between two points in space. fn distance_squared( - _self: Val, - rhs: Val, - ) -> i64 { - let output: i64 = bevy::math::I64Vec2::distance_squared( + _self: Val, + rhs: Val, + ) -> i8 { + let output: i8 = bevy::math::I8Vec2::distance_squared( _self.into_inner(), rhs.into_inner(), ) .into(); output } - fn div( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - } - fn div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn div(_self: Val, rhs: i64) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. /// # Panics /// This function will panic if any `rhs` element is 0 or the division results in overflow. fn div_euclid( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec2::div_euclid( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec2::div_euclid( _self.into_inner(), rhs.into_inner(), ) @@ -4941,17 +4163,17 @@ impl bevy::math::I64Vec2 { output } /// Computes the dot product of `self` and `rhs`. - fn dot(_self: Val, rhs: Val) -> i64 { - let output: i64 = bevy::math::I64Vec2::dot(_self.into_inner(), rhs.into_inner()) + fn dot(_self: Val, rhs: Val) -> i8 { + let output: i8 = bevy::math::I8Vec2::dot(_self.into_inner(), rhs.into_inner()) .into(); output } /// Returns a vector where every component is the dot product of `self` and `rhs`. fn dot_into_vec( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec2::dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec2::dot_into_vec( _self.into_inner(), rhs.into_inner(), ) @@ -4960,27 +4182,19 @@ impl bevy::math::I64Vec2 { } /// Returns the product of all elements of `self`. /// In other words, this computes `self.x * self.y * ..`. - fn element_product(_self: Val) -> i64 { - let output: i64 = bevy::math::I64Vec2::element_product(_self.into_inner()) - .into(); + fn element_product(_self: Val) -> i8 { + let output: i8 = bevy::math::I8Vec2::element_product(_self.into_inner()).into(); output } /// Returns the sum of all elements of `self`. /// In other words, this computes `self.x + self.y + ..`. - fn element_sum(_self: Val) -> i64 { - let output: i64 = bevy::math::I64Vec2::element_sum(_self.into_inner()).into(); - output - } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); + fn element_sum(_self: Val) -> i8 { + let output: i8 = bevy::math::I8Vec2::element_sum(_self.into_inner()).into(); output } /// Creates a 3D vector from `self` and the given `z` value. - fn extend(_self: Val, z: i64) -> Val { - let output: Val = bevy::math::I64Vec2::extend( + fn extend(_self: Val, z: i8) -> Val { + let output: Val = bevy::math::I8Vec2::extend( _self.into_inner(), z, ) @@ -4988,30 +4202,30 @@ impl bevy::math::I64Vec2 { output } /// Creates a new vector from an array. - fn from_array(a: [i64; 2]) -> Val { - let output: Val = bevy::math::I64Vec2::from_array(a).into(); + fn from_array(a: [i8; 2]) -> Val { + let output: Val = bevy::math::I8Vec2::from_array(a).into(); output } /// Returns a bitmask with the lowest 2 bits set to the sign bits from the elements of `self`. /// A negative element results in a `1` bit and a positive element in a `0` bit. Element `x` goes /// into the first lowest bit, element `y` into the second, etc. - fn is_negative_bitmask(_self: Val) -> u32 { - let output: u32 = bevy::math::I64Vec2::is_negative_bitmask(_self.into_inner()) + fn is_negative_bitmask(_self: Val) -> u32 { + let output: u32 = bevy::math::I8Vec2::is_negative_bitmask(_self.into_inner()) .into(); output } /// Computes the squared length of `self`. - fn length_squared(_self: Val) -> i64 { - let output: i64 = bevy::math::I64Vec2::length_squared(_self.into_inner()).into(); + fn length_squared(_self: Val) -> i8 { + let output: i8 = bevy::math::I8Vec2::length_squared(_self.into_inner()).into(); output } /// Returns a vector containing the maximum values for each element of `self` and `rhs`. /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. fn max( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec2::max( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec2::max( _self.into_inner(), rhs.into_inner(), ) @@ -5020,17 +4234,17 @@ impl bevy::math::I64Vec2 { } /// Returns the horizontal maximum of `self`. /// In other words this computes `max(x, y, ..)`. - fn max_element(_self: Val) -> i64 { - let output: i64 = bevy::math::I64Vec2::max_element(_self.into_inner()).into(); + fn max_element(_self: Val) -> i8 { + let output: i8 = bevy::math::I8Vec2::max_element(_self.into_inner()).into(); output } /// Returns a vector containing the minimum values for each element of `self` and `rhs`. /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. fn min( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec2::min( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec2::min( _self.into_inner(), rhs.into_inner(), ) @@ -5039,52 +4253,18 @@ impl bevy::math::I64Vec2 { } /// Returns the horizontal minimum of `self`. /// In other words this computes `min(x, y, ..)`. - fn min_element(_self: Val) -> i64 { - let output: i64 = bevy::math::I64Vec2::min_element(_self.into_inner()).into(); - output - } - fn mul( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: i64) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); + fn min_element(_self: Val) -> i8 { + let output: i8 = bevy::math::I8Vec2::min_element(_self.into_inner()).into(); output } /// Creates a new vector. - fn new(x: i64, y: i64) -> Val { - let output: Val = bevy::math::I64Vec2::new(x, y).into(); + fn new(x: i8, y: i8) -> Val { + let output: Val = bevy::math::I8Vec2::new(x, y).into(); output } /// Returns a vector that is equal to `self` rotated by 90 degrees. - fn perp(_self: Val) -> Val { - let output: Val = bevy::math::I64Vec2::perp( + fn perp(_self: Val) -> Val { + let output: Val = bevy::math::I8Vec2::perp( _self.into_inner(), ) .into(); @@ -5092,50 +4272,23 @@ impl bevy::math::I64Vec2 { } /// The perpendicular dot product of `self` and `rhs`. /// Also known as the wedge product, 2D cross product, and determinant. - fn perp_dot(_self: Val, rhs: Val) -> i64 { - let output: i64 = bevy::math::I64Vec2::perp_dot( + fn perp_dot(_self: Val, rhs: Val) -> i8 { + let output: i8 = bevy::math::I8Vec2::perp_dot( _self.into_inner(), rhs.into_inner(), ) .into(); output } - fn rem( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - } - fn rem( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn rem(_self: Val, rhs: i64) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - } /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. /// # Panics /// This function will panic if any `rhs` element is 0 or the division results in overflow. - /// [Euclidean division]: i64::rem_euclid + /// [Euclidean division]: i8::rem_euclid fn rem_euclid( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec2::rem_euclid( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec2::rem_euclid( _self.into_inner(), rhs.into_inner(), ) @@ -5146,10 +4299,10 @@ impl bevy::math::I64Vec2 { /// then this just rotation. This is what you usually want. Otherwise, /// it will be like a rotation with a multiplication by `self`'s length. fn rotate( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec2::rotate( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec2::rotate( _self.into_inner(), rhs.into_inner(), ) @@ -5159,10 +4312,10 @@ impl bevy::math::I64Vec2 { /// Returns a vector containing the saturating addition of `self` and `rhs`. /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. fn saturating_add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec2::saturating_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec2::saturating_add( _self.into_inner(), rhs.into_inner(), ) @@ -5171,10 +4324,10 @@ impl bevy::math::I64Vec2 { } /// In other words this computes `[self.x.saturating_add_unsigned(rhs.x), self.y.saturating_add_unsigned(rhs.y), ..]`. fn saturating_add_unsigned( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec2::saturating_add_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec2::saturating_add_unsigned( _self.into_inner(), rhs.into_inner(), ) @@ -5184,10 +4337,10 @@ impl bevy::math::I64Vec2 { /// Returns a vector containing the saturating division of `self` and `rhs`. /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. fn saturating_div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec2::saturating_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec2::saturating_div( _self.into_inner(), rhs.into_inner(), ) @@ -5197,10 +4350,10 @@ impl bevy::math::I64Vec2 { /// Returns a vector containing the saturating multiplication of `self` and `rhs`. /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. fn saturating_mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec2::saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec2::saturating_mul( _self.into_inner(), rhs.into_inner(), ) @@ -5210,10 +4363,10 @@ impl bevy::math::I64Vec2 { /// Returns a vector containing the saturating subtraction of `self` and `rhs`. /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. fn saturating_sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec2::saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec2::saturating_sub( _self.into_inner(), rhs.into_inner(), ) @@ -5223,10 +4376,10 @@ impl bevy::math::I64Vec2 { /// Returns a vector containing the saturating subtraction of `self` and unsigned vector `rhs`. /// In other words this computes `[self.x.saturating_sub_unsigned(rhs.x), self.y.saturating_sub_unsigned(rhs.y), ..]`. fn saturating_sub_unsigned( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec2::saturating_sub_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec2::saturating_sub_unsigned( _self.into_inner(), rhs.into_inner(), ) @@ -5239,10 +4392,10 @@ impl bevy::math::I64Vec2 { /// uses the element from `if_false`. fn select( mask: Val, - if_true: Val, - if_false: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec2::select( + if_true: Val, + if_false: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec2::select( mask.into_inner(), if_true.into_inner(), if_false.into_inner(), @@ -5254,62 +4407,35 @@ impl bevy::math::I64Vec2 { /// - `0` if the number is zero /// - `1` if the number is positive /// - `-1` if the number is negative - fn signum(_self: Val) -> Val { - let output: Val = bevy::math::I64Vec2::signum( + fn signum(_self: Val) -> Val { + let output: Val = bevy::math::I8Vec2::signum( _self.into_inner(), ) .into(); output } /// Creates a vector with all elements set to `v`. - fn splat(v: i64) -> Val { - let output: Val = bevy::math::I64Vec2::splat(v).into(); + fn splat(v: i8) -> Val { + let output: Val = bevy::math::I8Vec2::splat(v).into(); output } - fn sub( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn sub(_self: Val, rhs: i64) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - } - /// `[x, y]` - fn to_array(_self: Ref) -> [i64; 2] { - let output: [i64; 2] = bevy::math::I64Vec2::to_array(&_self).into(); - output - } - /// Creates a 2D vector from `self` with the given value of `x`. - fn with_x(_self: Val, x: i64) -> Val { - let output: Val = bevy::math::I64Vec2::with_x( - _self.into_inner(), - x, - ) + /// `[x, y]` + fn to_array(_self: Ref) -> [i8; 2] { + let output: [i8; 2] = bevy::math::I8Vec2::to_array(&_self).into(); + output + } + /// Creates a 2D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: i8) -> Val { + let output: Val = bevy::math::I8Vec2::with_x( + _self.into_inner(), + x, + ) .into(); output } /// Creates a 2D vector from `self` with the given value of `y`. - fn with_y(_self: Val, y: i64) -> Val { - let output: Val = bevy::math::I64Vec2::with_y( + fn with_y(_self: Val, y: i8) -> Val { + let output: Val = bevy::math::I8Vec2::with_y( _self.into_inner(), y, ) @@ -5319,10 +4445,10 @@ impl bevy::math::I64Vec2 { /// Returns a vector containing the wrapping addition of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. fn wrapping_add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec2::wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec2::wrapping_add( _self.into_inner(), rhs.into_inner(), ) @@ -5332,10 +4458,10 @@ impl bevy::math::I64Vec2 { /// Returns a vector containing the wrapping addition of `self` and unsigned vector `rhs`. /// In other words this computes `[self.x.wrapping_add_unsigned(rhs.x), self.y.wrapping_add_unsigned(rhs.y), ..]`. fn wrapping_add_unsigned( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec2::wrapping_add_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec2::wrapping_add_unsigned( _self.into_inner(), rhs.into_inner(), ) @@ -5345,10 +4471,10 @@ impl bevy::math::I64Vec2 { /// Returns a vector containing the wrapping division of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. fn wrapping_div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec2::wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec2::wrapping_div( _self.into_inner(), rhs.into_inner(), ) @@ -5358,10 +4484,10 @@ impl bevy::math::I64Vec2 { /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. fn wrapping_mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec2::wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec2::wrapping_mul( _self.into_inner(), rhs.into_inner(), ) @@ -5371,10 +4497,10 @@ impl bevy::math::I64Vec2 { /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. fn wrapping_sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec2::wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec2::wrapping_sub( _self.into_inner(), rhs.into_inner(), ) @@ -5384,10 +4510,10 @@ impl bevy::math::I64Vec2 { /// Returns a vector containing the wrapping subtraction of `self` and unsigned vector `rhs`. /// In other words this computes `[self.x.wrapping_sub_unsigned(rhs.x), self.y.wrapping_sub_unsigned(rhs.y), ..]`. fn wrapping_sub_unsigned( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec2::wrapping_sub_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec2::wrapping_sub_unsigned( _self.into_inner(), rhs.into_inner(), ) @@ -5397,98 +4523,82 @@ impl bevy::math::I64Vec2 { } #[script_bindings( remote, - name = "i_64_vec_3_functions", + name = "i_8_vec_3_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::math::I64Vec3 { +impl bevy::math::I8Vec3 { /// Returns a vector containing the absolute value of each element of `self`. - fn abs(_self: Val) -> Val { - let output: Val = bevy::math::I64Vec3::abs( - _self.into_inner(), - ) + fn abs(_self: Val) -> Val { + let output: Val = bevy::math::I8Vec3::abs(_self.into_inner()) .into(); output } - fn add( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); + /// Casts all elements of `self` to `f64`. + fn as_dvec3(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec3::as_dvec3(&_self).into(); output } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + /// Casts all elements of `self` to `i16`. + fn as_i16vec3(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec3::as_i16vec3(&_self) .into(); output } - fn add(_self: Val, rhs: i64) -> Val { - let output: Val = >::add(_self.into_inner(), rhs) + /// Casts all elements of `self` to `i64`. + fn as_i64vec3(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec3::as_i64vec3(&_self) .into(); output } - /// Casts all elements of `self` to `f64`. - fn as_dvec3(_self: Ref) -> Val { - let output: Val = bevy::math::I64Vec3::as_dvec3(&_self) - .into(); + /// Casts all elements of `self` to `i32`. + fn as_ivec3(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec3::as_ivec3(&_self).into(); output } - /// Casts all elements of `self` to `i32`. - fn as_ivec3(_self: Ref) -> Val { - let output: Val = bevy::math::I64Vec3::as_ivec3(&_self) + /// Casts all elements of `self` to `u16`. + fn as_u16vec3(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec3::as_u16vec3(&_self) .into(); output } /// Casts all elements of `self` to `u64`. - fn as_u64vec3(_self: Ref) -> Val { - let output: Val = bevy::math::I64Vec3::as_u64vec3(&_self) + fn as_u64vec3(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec3::as_u64vec3(&_self) .into(); output } - /// Casts all elements of `self` to `u32`. - fn as_uvec3(_self: Ref) -> Val { - let output: Val = bevy::math::I64Vec3::as_uvec3(&_self) + /// Casts all elements of `self` to `u8`. + fn as_u8vec3(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec3::as_u8vec3(&_self) .into(); output } - /// Casts all elements of `self` to `f32`. - fn as_vec3(_self: Ref) -> Val { - let output: Val = bevy::math::I64Vec3::as_vec3(&_self).into(); + /// Casts all elements of `self` to `u32`. + fn as_uvec3(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec3::as_uvec3(&_self).into(); output } /// Casts all elements of `self` to `f32`. - fn as_vec3a(_self: Ref) -> Val { - let output: Val = bevy::math::I64Vec3::as_vec3a(&_self) - .into(); + fn as_vec3(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec3::as_vec3(&_self).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); + /// Casts all elements of `self` to `f32`. + fn as_vec3a(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec3::as_vec3a(&_self).into(); output } - /// Component-wise clamping of values, similar to [`i64::clamp`]. + /// Component-wise clamping of values, similar to [`i8::clamp`]. /// Each element in `min` must be less-or-equal to the corresponding element in `max`. /// # Panics /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( - _self: Val, - min: Val, - max: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec3::clamp( + _self: Val, + min: Val, + max: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec3::clamp( _self.into_inner(), min.into_inner(), max.into_inner(), @@ -5496,22 +4606,15 @@ impl bevy::math::I64Vec3 { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns a vector mask containing the result of a `==` comparison for each element of /// `self` and `rhs`. /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all /// elements. fn cmpeq( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::I64Vec3::cmpeq( + let output: Val = bevy::math::I8Vec3::cmpeq( _self.into_inner(), rhs.into_inner(), ) @@ -5523,10 +4626,10 @@ impl bevy::math::I64Vec3 { /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all /// elements. fn cmpge( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::I64Vec3::cmpge( + let output: Val = bevy::math::I8Vec3::cmpge( _self.into_inner(), rhs.into_inner(), ) @@ -5538,10 +4641,10 @@ impl bevy::math::I64Vec3 { /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all /// elements. fn cmpgt( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::I64Vec3::cmpgt( + let output: Val = bevy::math::I8Vec3::cmpgt( _self.into_inner(), rhs.into_inner(), ) @@ -5553,10 +4656,10 @@ impl bevy::math::I64Vec3 { /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all /// elements. fn cmple( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::I64Vec3::cmple( + let output: Val = bevy::math::I8Vec3::cmple( _self.into_inner(), rhs.into_inner(), ) @@ -5568,10 +4671,10 @@ impl bevy::math::I64Vec3 { /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all /// elements. fn cmplt( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::I64Vec3::cmplt( + let output: Val = bevy::math::I8Vec3::cmplt( _self.into_inner(), rhs.into_inner(), ) @@ -5583,10 +4686,10 @@ impl bevy::math::I64Vec3 { /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all /// elements. fn cmpne( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::I64Vec3::cmpne( + let output: Val = bevy::math::I8Vec3::cmpne( _self.into_inner(), rhs.into_inner(), ) @@ -5595,10 +4698,10 @@ impl bevy::math::I64Vec3 { } /// Computes the cross product of `self` and `rhs`. fn cross( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec3::cross( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec3::cross( _self.into_inner(), rhs.into_inner(), ) @@ -5607,51 +4710,24 @@ impl bevy::math::I64Vec3 { } /// Compute the squared euclidean distance between two points in space. fn distance_squared( - _self: Val, - rhs: Val, - ) -> i64 { - let output: i64 = bevy::math::I64Vec3::distance_squared( + _self: Val, + rhs: Val, + ) -> i8 { + let output: i8 = bevy::math::I8Vec3::distance_squared( _self.into_inner(), rhs.into_inner(), ) .into(); output } - fn div( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - } - fn div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn div(_self: Val, rhs: i64) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. /// # Panics /// This function will panic if any `rhs` element is 0 or the division results in overflow. fn div_euclid( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec3::div_euclid( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec3::div_euclid( _self.into_inner(), rhs.into_inner(), ) @@ -5659,17 +4735,17 @@ impl bevy::math::I64Vec3 { output } /// Computes the dot product of `self` and `rhs`. - fn dot(_self: Val, rhs: Val) -> i64 { - let output: i64 = bevy::math::I64Vec3::dot(_self.into_inner(), rhs.into_inner()) + fn dot(_self: Val, rhs: Val) -> i8 { + let output: i8 = bevy::math::I8Vec3::dot(_self.into_inner(), rhs.into_inner()) .into(); output } /// Returns a vector where every component is the dot product of `self` and `rhs`. fn dot_into_vec( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec3::dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec3::dot_into_vec( _self.into_inner(), rhs.into_inner(), ) @@ -5678,27 +4754,19 @@ impl bevy::math::I64Vec3 { } /// Returns the product of all elements of `self`. /// In other words, this computes `self.x * self.y * ..`. - fn element_product(_self: Val) -> i64 { - let output: i64 = bevy::math::I64Vec3::element_product(_self.into_inner()) - .into(); + fn element_product(_self: Val) -> i8 { + let output: i8 = bevy::math::I8Vec3::element_product(_self.into_inner()).into(); output } /// Returns the sum of all elements of `self`. /// In other words, this computes `self.x + self.y + ..`. - fn element_sum(_self: Val) -> i64 { - let output: i64 = bevy::math::I64Vec3::element_sum(_self.into_inner()).into(); - output - } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); + fn element_sum(_self: Val) -> i8 { + let output: i8 = bevy::math::I8Vec3::element_sum(_self.into_inner()).into(); output } /// Creates a 4D vector from `self` and the given `w` value. - fn extend(_self: Val, w: i64) -> Val { - let output: Val = bevy::math::I64Vec3::extend( + fn extend(_self: Val, w: i8) -> Val { + let output: Val = bevy::math::I8Vec3::extend( _self.into_inner(), w, ) @@ -5706,30 +4774,30 @@ impl bevy::math::I64Vec3 { output } /// Creates a new vector from an array. - fn from_array(a: [i64; 3]) -> Val { - let output: Val = bevy::math::I64Vec3::from_array(a).into(); + fn from_array(a: [i8; 3]) -> Val { + let output: Val = bevy::math::I8Vec3::from_array(a).into(); output } /// Returns a bitmask with the lowest 3 bits set to the sign bits from the elements of `self`. /// A negative element results in a `1` bit and a positive element in a `0` bit. Element `x` goes /// into the first lowest bit, element `y` into the second, etc. - fn is_negative_bitmask(_self: Val) -> u32 { - let output: u32 = bevy::math::I64Vec3::is_negative_bitmask(_self.into_inner()) + fn is_negative_bitmask(_self: Val) -> u32 { + let output: u32 = bevy::math::I8Vec3::is_negative_bitmask(_self.into_inner()) .into(); output } /// Computes the squared length of `self`. - fn length_squared(_self: Val) -> i64 { - let output: i64 = bevy::math::I64Vec3::length_squared(_self.into_inner()).into(); + fn length_squared(_self: Val) -> i8 { + let output: i8 = bevy::math::I8Vec3::length_squared(_self.into_inner()).into(); output } /// Returns a vector containing the maximum values for each element of `self` and `rhs`. /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. fn max( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec3::max( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec3::max( _self.into_inner(), rhs.into_inner(), ) @@ -5738,17 +4806,17 @@ impl bevy::math::I64Vec3 { } /// Returns the horizontal maximum of `self`. /// In other words this computes `max(x, y, ..)`. - fn max_element(_self: Val) -> i64 { - let output: i64 = bevy::math::I64Vec3::max_element(_self.into_inner()).into(); + fn max_element(_self: Val) -> i8 { + let output: i8 = bevy::math::I8Vec3::max_element(_self.into_inner()).into(); output } /// Returns a vector containing the minimum values for each element of `self` and `rhs`. /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. fn min( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec3::min( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec3::min( _self.into_inner(), rhs.into_inner(), ) @@ -5757,85 +4825,24 @@ impl bevy::math::I64Vec3 { } /// Returns the horizontal minimum of `self`. /// In other words this computes `min(x, y, ..)`. - fn min_element(_self: Val) -> i64 { - let output: i64 = bevy::math::I64Vec3::min_element(_self.into_inner()).into(); - output - } - fn mul( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: i64) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); + fn min_element(_self: Val) -> i8 { + let output: i8 = bevy::math::I8Vec3::min_element(_self.into_inner()).into(); output } /// Creates a new vector. - fn new(x: i64, y: i64, z: i64) -> Val { - let output: Val = bevy::math::I64Vec3::new(x, y, z).into(); - output - } - fn rem( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - } - fn rem( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn rem(_self: Val, rhs: i64) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); + fn new(x: i8, y: i8, z: i8) -> Val { + let output: Val = bevy::math::I8Vec3::new(x, y, z).into(); output } /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. /// # Panics /// This function will panic if any `rhs` element is 0 or the division results in overflow. - /// [Euclidean division]: i64::rem_euclid + /// [Euclidean division]: i8::rem_euclid fn rem_euclid( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec3::rem_euclid( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec3::rem_euclid( _self.into_inner(), rhs.into_inner(), ) @@ -5845,10 +4852,10 @@ impl bevy::math::I64Vec3 { /// Returns a vector containing the saturating addition of `self` and `rhs`. /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. fn saturating_add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec3::saturating_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec3::saturating_add( _self.into_inner(), rhs.into_inner(), ) @@ -5857,10 +4864,10 @@ impl bevy::math::I64Vec3 { } /// In other words this computes `[self.x.saturating_add_unsigned(rhs.x), self.y.saturating_add_unsigned(rhs.y), ..]`. fn saturating_add_unsigned( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec3::saturating_add_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec3::saturating_add_unsigned( _self.into_inner(), rhs.into_inner(), ) @@ -5870,10 +4877,10 @@ impl bevy::math::I64Vec3 { /// Returns a vector containing the saturating division of `self` and `rhs`. /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. fn saturating_div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec3::saturating_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec3::saturating_div( _self.into_inner(), rhs.into_inner(), ) @@ -5883,10 +4890,10 @@ impl bevy::math::I64Vec3 { /// Returns a vector containing the saturating multiplication of `self` and `rhs`. /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. fn saturating_mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec3::saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec3::saturating_mul( _self.into_inner(), rhs.into_inner(), ) @@ -5896,10 +4903,10 @@ impl bevy::math::I64Vec3 { /// Returns a vector containing the saturating subtraction of `self` and `rhs`. /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. fn saturating_sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec3::saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec3::saturating_sub( _self.into_inner(), rhs.into_inner(), ) @@ -5909,10 +4916,10 @@ impl bevy::math::I64Vec3 { /// Returns a vector containing the saturating subtraction of `self` and unsigned vector `rhs`. /// In other words this computes `[self.x.saturating_sub_unsigned(rhs.x), self.y.saturating_sub_unsigned(rhs.y), ..]`. fn saturating_sub_unsigned( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec3::saturating_sub_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec3::saturating_sub_unsigned( _self.into_inner(), rhs.into_inner(), ) @@ -5925,10 +4932,10 @@ impl bevy::math::I64Vec3 { /// uses the element from `if_false`. fn select( mask: Val, - if_true: Val, - if_false: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec3::select( + if_true: Val, + if_false: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec3::select( mask.into_inner(), if_true.into_inner(), if_false.into_inner(), @@ -5940,62 +4947,35 @@ impl bevy::math::I64Vec3 { /// - `0` if the number is zero /// - `1` if the number is positive /// - `-1` if the number is negative - fn signum(_self: Val) -> Val { - let output: Val = bevy::math::I64Vec3::signum( + fn signum(_self: Val) -> Val { + let output: Val = bevy::math::I8Vec3::signum( _self.into_inner(), ) .into(); output } /// Creates a vector with all elements set to `v`. - fn splat(v: i64) -> Val { - let output: Val = bevy::math::I64Vec3::splat(v).into(); + fn splat(v: i8) -> Val { + let output: Val = bevy::math::I8Vec3::splat(v).into(); output } - fn sub( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn sub(_self: Val, rhs: i64) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - } - /// `[x, y, z]` - fn to_array(_self: Ref) -> [i64; 3] { - let output: [i64; 3] = bevy::math::I64Vec3::to_array(&_self).into(); - output - } - /// Creates a 2D vector from the `x` and `y` elements of `self`, discarding `z`. - /// Truncation may also be performed by using [`self.xy()`][crate::swizzles::Vec3Swizzles::xy()]. - fn truncate(_self: Val) -> Val { - let output: Val = bevy::math::I64Vec3::truncate( - _self.into_inner(), - ) + /// `[x, y, z]` + fn to_array(_self: Ref) -> [i8; 3] { + let output: [i8; 3] = bevy::math::I8Vec3::to_array(&_self).into(); + output + } + /// Creates a 2D vector from the `x` and `y` elements of `self`, discarding `z`. + /// Truncation may also be performed by using [`self.xy()`][crate::swizzles::Vec3Swizzles::xy()]. + fn truncate(_self: Val) -> Val { + let output: Val = bevy::math::I8Vec3::truncate( + _self.into_inner(), + ) .into(); output } /// Creates a 3D vector from `self` with the given value of `x`. - fn with_x(_self: Val, x: i64) -> Val { - let output: Val = bevy::math::I64Vec3::with_x( + fn with_x(_self: Val, x: i8) -> Val { + let output: Val = bevy::math::I8Vec3::with_x( _self.into_inner(), x, ) @@ -6003,8 +4983,8 @@ impl bevy::math::I64Vec3 { output } /// Creates a 3D vector from `self` with the given value of `y`. - fn with_y(_self: Val, y: i64) -> Val { - let output: Val = bevy::math::I64Vec3::with_y( + fn with_y(_self: Val, y: i8) -> Val { + let output: Val = bevy::math::I8Vec3::with_y( _self.into_inner(), y, ) @@ -6012,8 +4992,8 @@ impl bevy::math::I64Vec3 { output } /// Creates a 3D vector from `self` with the given value of `z`. - fn with_z(_self: Val, z: i64) -> Val { - let output: Val = bevy::math::I64Vec3::with_z( + fn with_z(_self: Val, z: i8) -> Val { + let output: Val = bevy::math::I8Vec3::with_z( _self.into_inner(), z, ) @@ -6023,10 +5003,10 @@ impl bevy::math::I64Vec3 { /// Returns a vector containing the wrapping addition of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. fn wrapping_add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec3::wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec3::wrapping_add( _self.into_inner(), rhs.into_inner(), ) @@ -6036,10 +5016,10 @@ impl bevy::math::I64Vec3 { /// Returns a vector containing the wrapping addition of `self` and unsigned vector `rhs`. /// In other words this computes `[self.x.wrapping_add_unsigned(rhs.x), self.y.wrapping_add_unsigned(rhs.y), ..]`. fn wrapping_add_unsigned( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec3::wrapping_add_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec3::wrapping_add_unsigned( _self.into_inner(), rhs.into_inner(), ) @@ -6049,10 +5029,10 @@ impl bevy::math::I64Vec3 { /// Returns a vector containing the wrapping division of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. fn wrapping_div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec3::wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec3::wrapping_div( _self.into_inner(), rhs.into_inner(), ) @@ -6062,10 +5042,10 @@ impl bevy::math::I64Vec3 { /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. fn wrapping_mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec3::wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec3::wrapping_mul( _self.into_inner(), rhs.into_inner(), ) @@ -6075,10 +5055,10 @@ impl bevy::math::I64Vec3 { /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. fn wrapping_sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec3::wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec3::wrapping_sub( _self.into_inner(), rhs.into_inner(), ) @@ -6088,10 +5068,10 @@ impl bevy::math::I64Vec3 { /// Returns a vector containing the wrapping subtraction of `self` and unsigned vector `rhs`. /// In other words this computes `[self.x.wrapping_sub_unsigned(rhs.x), self.y.wrapping_sub_unsigned(rhs.y), ..]`. fn wrapping_sub_unsigned( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec3::wrapping_sub_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec3::wrapping_sub_unsigned( _self.into_inner(), rhs.into_inner(), ) @@ -6101,92 +5081,77 @@ impl bevy::math::I64Vec3 { } #[script_bindings( remote, - name = "i_64_vec_4_functions", + name = "i_8_vec_4_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::math::I64Vec4 { +impl bevy::math::I8Vec4 { /// Returns a vector containing the absolute value of each element of `self`. - fn abs(_self: Val) -> Val { - let output: Val = bevy::math::I64Vec4::abs( - _self.into_inner(), - ) + fn abs(_self: Val) -> Val { + let output: Val = bevy::math::I8Vec4::abs(_self.into_inner()) .into(); output } - fn add( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); + /// Casts all elements of `self` to `f64`. + fn as_dvec4(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec4::as_dvec4(&_self).into(); output } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + /// Casts all elements of `self` to `i16`. + fn as_i16vec4(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec4::as_i16vec4(&_self) .into(); output } - fn add(_self: Val, rhs: i64) -> Val { - let output: Val = >::add(_self.into_inner(), rhs) + /// Casts all elements of `self` to `i64`. + fn as_i64vec4(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec4::as_i64vec4(&_self) .into(); output } - /// Casts all elements of `self` to `f64`. - fn as_dvec4(_self: Ref) -> Val { - let output: Val = bevy::math::I64Vec4::as_dvec4(&_self) - .into(); + /// Casts all elements of `self` to `i32`. + fn as_ivec4(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec4::as_ivec4(&_self).into(); output } - /// Casts all elements of `self` to `i32`. - fn as_ivec4(_self: Ref) -> Val { - let output: Val = bevy::math::I64Vec4::as_ivec4(&_self) + /// Casts all elements of `self` to `u16`. + fn as_u16vec4(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec4::as_u16vec4(&_self) .into(); output } /// Casts all elements of `self` to `u64`. - fn as_u64vec4(_self: Ref) -> Val { - let output: Val = bevy::math::I64Vec4::as_u64vec4(&_self) + fn as_u64vec4(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec4::as_u64vec4(&_self) .into(); output } - /// Casts all elements of `self` to `u32`. - fn as_uvec4(_self: Ref) -> Val { - let output: Val = bevy::math::I64Vec4::as_uvec4(&_self) + /// Casts all elements of `self` to `u8`. + fn as_u8vec4(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec4::as_u8vec4(&_self) .into(); output } - /// Casts all elements of `self` to `f32`. - fn as_vec4(_self: Ref) -> Val { - let output: Val = bevy::math::I64Vec4::as_vec4(&_self).into(); + /// Casts all elements of `self` to `u32`. + fn as_uvec4(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec4::as_uvec4(&_self).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); + /// Casts all elements of `self` to `f32`. + fn as_vec4(_self: Ref) -> Val { + let output: Val = bevy::math::I8Vec4::as_vec4(&_self).into(); output } - /// Component-wise clamping of values, similar to [`i64::clamp`]. + /// Component-wise clamping of values, similar to [`i8::clamp`]. /// Each element in `min` must be less-or-equal to the corresponding element in `max`. /// # Panics /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( - _self: Val, - min: Val, - max: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec4::clamp( + _self: Val, + min: Val, + max: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec4::clamp( _self.into_inner(), min.into_inner(), max.into_inner(), @@ -6194,22 +5159,15 @@ impl bevy::math::I64Vec4 { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns a vector mask containing the result of a `==` comparison for each element of /// `self` and `rhs`. /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all /// elements. fn cmpeq( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::I64Vec4::cmpeq( + let output: Val = bevy::math::I8Vec4::cmpeq( _self.into_inner(), rhs.into_inner(), ) @@ -6221,10 +5179,10 @@ impl bevy::math::I64Vec4 { /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all /// elements. fn cmpge( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::I64Vec4::cmpge( + let output: Val = bevy::math::I8Vec4::cmpge( _self.into_inner(), rhs.into_inner(), ) @@ -6236,10 +5194,10 @@ impl bevy::math::I64Vec4 { /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all /// elements. fn cmpgt( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::I64Vec4::cmpgt( + let output: Val = bevy::math::I8Vec4::cmpgt( _self.into_inner(), rhs.into_inner(), ) @@ -6251,10 +5209,10 @@ impl bevy::math::I64Vec4 { /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all /// elements. fn cmple( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::I64Vec4::cmple( + let output: Val = bevy::math::I8Vec4::cmple( _self.into_inner(), rhs.into_inner(), ) @@ -6266,10 +5224,10 @@ impl bevy::math::I64Vec4 { /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all /// elements. fn cmplt( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::I64Vec4::cmplt( + let output: Val = bevy::math::I8Vec4::cmplt( _self.into_inner(), rhs.into_inner(), ) @@ -6281,10 +5239,10 @@ impl bevy::math::I64Vec4 { /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all /// elements. fn cmpne( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::I64Vec4::cmpne( + let output: Val = bevy::math::I8Vec4::cmpne( _self.into_inner(), rhs.into_inner(), ) @@ -6293,51 +5251,24 @@ impl bevy::math::I64Vec4 { } /// Compute the squared euclidean distance between two points in space. fn distance_squared( - _self: Val, - rhs: Val, - ) -> i64 { - let output: i64 = bevy::math::I64Vec4::distance_squared( + _self: Val, + rhs: Val, + ) -> i8 { + let output: i8 = bevy::math::I8Vec4::distance_squared( _self.into_inner(), rhs.into_inner(), ) .into(); output } - fn div( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - } - fn div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn div(_self: Val, rhs: i64) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. /// # Panics /// This function will panic if any `rhs` element is 0 or the division results in overflow. fn div_euclid( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec4::div_euclid( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec4::div_euclid( _self.into_inner(), rhs.into_inner(), ) @@ -6345,17 +5276,17 @@ impl bevy::math::I64Vec4 { output } /// Computes the dot product of `self` and `rhs`. - fn dot(_self: Val, rhs: Val) -> i64 { - let output: i64 = bevy::math::I64Vec4::dot(_self.into_inner(), rhs.into_inner()) + fn dot(_self: Val, rhs: Val) -> i8 { + let output: i8 = bevy::math::I8Vec4::dot(_self.into_inner(), rhs.into_inner()) .into(); output } /// Returns a vector where every component is the dot product of `self` and `rhs`. fn dot_into_vec( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec4::dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec4::dot_into_vec( _self.into_inner(), rhs.into_inner(), ) @@ -6364,49 +5295,41 @@ impl bevy::math::I64Vec4 { } /// Returns the product of all elements of `self`. /// In other words, this computes `self.x * self.y * ..`. - fn element_product(_self: Val) -> i64 { - let output: i64 = bevy::math::I64Vec4::element_product(_self.into_inner()) - .into(); + fn element_product(_self: Val) -> i8 { + let output: i8 = bevy::math::I8Vec4::element_product(_self.into_inner()).into(); output } /// Returns the sum of all elements of `self`. /// In other words, this computes `self.x + self.y + ..`. - fn element_sum(_self: Val) -> i64 { - let output: i64 = bevy::math::I64Vec4::element_sum(_self.into_inner()).into(); - output - } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); + fn element_sum(_self: Val) -> i8 { + let output: i8 = bevy::math::I8Vec4::element_sum(_self.into_inner()).into(); output } /// Creates a new vector from an array. - fn from_array(a: [i64; 4]) -> Val { - let output: Val = bevy::math::I64Vec4::from_array(a).into(); + fn from_array(a: [i8; 4]) -> Val { + let output: Val = bevy::math::I8Vec4::from_array(a).into(); output } /// Returns a bitmask with the lowest 4 bits set to the sign bits from the elements of `self`. /// A negative element results in a `1` bit and a positive element in a `0` bit. Element `x` goes /// into the first lowest bit, element `y` into the second, etc. - fn is_negative_bitmask(_self: Val) -> u32 { - let output: u32 = bevy::math::I64Vec4::is_negative_bitmask(_self.into_inner()) + fn is_negative_bitmask(_self: Val) -> u32 { + let output: u32 = bevy::math::I8Vec4::is_negative_bitmask(_self.into_inner()) .into(); output } /// Computes the squared length of `self`. - fn length_squared(_self: Val) -> i64 { - let output: i64 = bevy::math::I64Vec4::length_squared(_self.into_inner()).into(); + fn length_squared(_self: Val) -> i8 { + let output: i8 = bevy::math::I8Vec4::length_squared(_self.into_inner()).into(); output } /// Returns a vector containing the maximum values for each element of `self` and `rhs`. /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. fn max( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec4::max( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec4::max( _self.into_inner(), rhs.into_inner(), ) @@ -6415,17 +5338,17 @@ impl bevy::math::I64Vec4 { } /// Returns the horizontal maximum of `self`. /// In other words this computes `max(x, y, ..)`. - fn max_element(_self: Val) -> i64 { - let output: i64 = bevy::math::I64Vec4::max_element(_self.into_inner()).into(); + fn max_element(_self: Val) -> i8 { + let output: i8 = bevy::math::I8Vec4::max_element(_self.into_inner()).into(); output } /// Returns a vector containing the minimum values for each element of `self` and `rhs`. /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. fn min( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec4::min( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec4::min( _self.into_inner(), rhs.into_inner(), ) @@ -6434,86 +5357,24 @@ impl bevy::math::I64Vec4 { } /// Returns the horizontal minimum of `self`. /// In other words this computes `min(x, y, ..)`. - fn min_element(_self: Val) -> i64 { - let output: i64 = bevy::math::I64Vec4::min_element(_self.into_inner()).into(); - output - } - fn mul( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: i64) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); + fn min_element(_self: Val) -> i8 { + let output: i8 = bevy::math::I8Vec4::min_element(_self.into_inner()).into(); output } /// Creates a new vector. - fn new(x: i64, y: i64, z: i64, w: i64) -> Val { - let output: Val = bevy::math::I64Vec4::new(x, y, z, w) - .into(); - output - } - fn rem( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - } - fn rem( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn rem(_self: Val, rhs: i64) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); + fn new(x: i8, y: i8, z: i8, w: i8) -> Val { + let output: Val = bevy::math::I8Vec4::new(x, y, z, w).into(); output } /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. /// # Panics /// This function will panic if any `rhs` element is 0 or the division results in overflow. - /// [Euclidean division]: i64::rem_euclid + /// [Euclidean division]: i8::rem_euclid fn rem_euclid( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec4::rem_euclid( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec4::rem_euclid( _self.into_inner(), rhs.into_inner(), ) @@ -6523,10 +5384,10 @@ impl bevy::math::I64Vec4 { /// Returns a vector containing the saturating addition of `self` and `rhs`. /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. fn saturating_add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec4::saturating_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec4::saturating_add( _self.into_inner(), rhs.into_inner(), ) @@ -6535,10 +5396,10 @@ impl bevy::math::I64Vec4 { } /// In other words this computes `[self.x.saturating_add_unsigned(rhs.x), self.y.saturating_add_unsigned(rhs.y), ..]`. fn saturating_add_unsigned( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec4::saturating_add_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec4::saturating_add_unsigned( _self.into_inner(), rhs.into_inner(), ) @@ -6548,10 +5409,10 @@ impl bevy::math::I64Vec4 { /// Returns a vector containing the saturating division of `self` and `rhs`. /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. fn saturating_div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec4::saturating_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec4::saturating_div( _self.into_inner(), rhs.into_inner(), ) @@ -6561,10 +5422,10 @@ impl bevy::math::I64Vec4 { /// Returns a vector containing the saturating multiplication of `self` and `rhs`. /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. fn saturating_mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec4::saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec4::saturating_mul( _self.into_inner(), rhs.into_inner(), ) @@ -6574,10 +5435,10 @@ impl bevy::math::I64Vec4 { /// Returns a vector containing the saturating subtraction of `self` and `rhs`. /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. fn saturating_sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec4::saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec4::saturating_sub( _self.into_inner(), rhs.into_inner(), ) @@ -6587,10 +5448,10 @@ impl bevy::math::I64Vec4 { /// Returns a vector containing the saturating subtraction of `self` and unsigned vector `rhs`. /// In other words this computes `[self.x.saturating_sub_unsigned(rhs.x), self.y.saturating_sub_unsigned(rhs.y), ..]`. fn saturating_sub_unsigned( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec4::saturating_sub_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec4::saturating_sub_unsigned( _self.into_inner(), rhs.into_inner(), ) @@ -6603,10 +5464,10 @@ impl bevy::math::I64Vec4 { /// uses the element from `if_false`. fn select( mask: Val, - if_true: Val, - if_false: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec4::select( + if_true: Val, + if_false: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec4::select( mask.into_inner(), if_true.into_inner(), if_false.into_inner(), @@ -6618,62 +5479,35 @@ impl bevy::math::I64Vec4 { /// - `0` if the number is zero /// - `1` if the number is positive /// - `-1` if the number is negative - fn signum(_self: Val) -> Val { - let output: Val = bevy::math::I64Vec4::signum( + fn signum(_self: Val) -> Val { + let output: Val = bevy::math::I8Vec4::signum( _self.into_inner(), ) .into(); output } /// Creates a vector with all elements set to `v`. - fn splat(v: i64) -> Val { - let output: Val = bevy::math::I64Vec4::splat(v).into(); + fn splat(v: i8) -> Val { + let output: Val = bevy::math::I8Vec4::splat(v).into(); output } - fn sub( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); + /// `[x, y, z, w]` + fn to_array(_self: Ref) -> [i8; 4] { + let output: [i8; 4] = bevy::math::I8Vec4::to_array(&_self).into(); output } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn sub(_self: Val, rhs: i64) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - } - /// `[x, y, z, w]` - fn to_array(_self: Ref) -> [i64; 4] { - let output: [i64; 4] = bevy::math::I64Vec4::to_array(&_self).into(); - output - } - /// Creates a 3D vector from the `x`, `y` and `z` elements of `self`, discarding `w`. - /// Truncation to [`I64Vec3`] may also be performed by using [`self.xyz()`][crate::swizzles::Vec4Swizzles::xyz()]. - fn truncate(_self: Val) -> Val { - let output: Val = bevy::math::I64Vec4::truncate( - _self.into_inner(), - ) + /// Creates a 3D vector from the `x`, `y` and `z` elements of `self`, discarding `w`. + /// Truncation to [`I8Vec3`] may also be performed by using [`self.xyz()`][crate::swizzles::Vec4Swizzles::xyz()]. + fn truncate(_self: Val) -> Val { + let output: Val = bevy::math::I8Vec4::truncate( + _self.into_inner(), + ) .into(); output } /// Creates a 4D vector from `self` with the given value of `w`. - fn with_w(_self: Val, w: i64) -> Val { - let output: Val = bevy::math::I64Vec4::with_w( + fn with_w(_self: Val, w: i8) -> Val { + let output: Val = bevy::math::I8Vec4::with_w( _self.into_inner(), w, ) @@ -6681,8 +5515,8 @@ impl bevy::math::I64Vec4 { output } /// Creates a 4D vector from `self` with the given value of `x`. - fn with_x(_self: Val, x: i64) -> Val { - let output: Val = bevy::math::I64Vec4::with_x( + fn with_x(_self: Val, x: i8) -> Val { + let output: Val = bevy::math::I8Vec4::with_x( _self.into_inner(), x, ) @@ -6690,8 +5524,8 @@ impl bevy::math::I64Vec4 { output } /// Creates a 4D vector from `self` with the given value of `y`. - fn with_y(_self: Val, y: i64) -> Val { - let output: Val = bevy::math::I64Vec4::with_y( + fn with_y(_self: Val, y: i8) -> Val { + let output: Val = bevy::math::I8Vec4::with_y( _self.into_inner(), y, ) @@ -6699,8 +5533,8 @@ impl bevy::math::I64Vec4 { output } /// Creates a 4D vector from `self` with the given value of `z`. - fn with_z(_self: Val, z: i64) -> Val { - let output: Val = bevy::math::I64Vec4::with_z( + fn with_z(_self: Val, z: i8) -> Val { + let output: Val = bevy::math::I8Vec4::with_z( _self.into_inner(), z, ) @@ -6710,10 +5544,10 @@ impl bevy::math::I64Vec4 { /// Returns a vector containing the wrapping addition of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. fn wrapping_add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec4::wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec4::wrapping_add( _self.into_inner(), rhs.into_inner(), ) @@ -6723,10 +5557,10 @@ impl bevy::math::I64Vec4 { /// Returns a vector containing the wrapping addition of `self` and unsigned vector `rhs`. /// In other words this computes `[self.x.wrapping_add_unsigned(rhs.x), self.y.wrapping_add_unsigned(rhs.y), ..]`. fn wrapping_add_unsigned( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec4::wrapping_add_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec4::wrapping_add_unsigned( _self.into_inner(), rhs.into_inner(), ) @@ -6736,10 +5570,10 @@ impl bevy::math::I64Vec4 { /// Returns a vector containing the wrapping division of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. fn wrapping_div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec4::wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec4::wrapping_div( _self.into_inner(), rhs.into_inner(), ) @@ -6749,10 +5583,10 @@ impl bevy::math::I64Vec4 { /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. fn wrapping_mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec4::wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec4::wrapping_mul( _self.into_inner(), rhs.into_inner(), ) @@ -6762,10 +5596,10 @@ impl bevy::math::I64Vec4 { /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. fn wrapping_sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec4::wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec4::wrapping_sub( _self.into_inner(), rhs.into_inner(), ) @@ -6775,10 +5609,6059 @@ impl bevy::math::I64Vec4 { /// Returns a vector containing the wrapping subtraction of `self` and unsigned vector `rhs`. /// In other words this computes `[self.x.wrapping_sub_unsigned(rhs.x), self.y.wrapping_sub_unsigned(rhs.y), ..]`. fn wrapping_sub_unsigned( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::I64Vec4::wrapping_sub_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I8Vec4::wrapping_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings( + remote, + name = "i_16_vec_2_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::math::I16Vec2 { + /// Returns a vector containing the absolute value of each element of `self`. + fn abs(_self: Val) -> Val { + let output: Val = bevy::math::I16Vec2::abs( + _self.into_inner(), + ) + .into(); + output + } + /// Casts all elements of `self` to `f64`. + fn as_dvec2(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec2::as_dvec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i64`. + fn as_i64vec2(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec2::as_i64vec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i8`. + fn as_i8vec2(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec2::as_i8vec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i32`. + fn as_ivec2(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec2::as_ivec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u16`. + fn as_u16vec2(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec2::as_u16vec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u64`. + fn as_u64vec2(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec2::as_u64vec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u8`. + fn as_u8vec2(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec2::as_u8vec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u32`. + fn as_uvec2(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec2::as_uvec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `f32`. + fn as_vec2(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec2::as_vec2(&_self).into(); + output + } + /// Component-wise clamping of values, similar to [`i16::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. + fn clamp( + _self: Val, + min: Val, + max: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Compute the squared euclidean distance between two points in space. + fn distance_squared( + _self: Val, + rhs: Val, + ) -> i16 { + let output: i16 = bevy::math::I16Vec2::distance_squared( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + fn div_euclid( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::div_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> i16 { + let output: i16 = bevy::math::I16Vec2::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> i16 { + let output: i16 = bevy::math::I16Vec2::element_product(_self.into_inner()) + .into(); + output + } + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> i16 { + let output: i16 = bevy::math::I16Vec2::element_sum(_self.into_inner()).into(); + output + } + /// Creates a 3D vector from `self` and the given `z` value. + fn extend(_self: Val, z: i16) -> Val { + let output: Val = bevy::math::I16Vec2::extend( + _self.into_inner(), + z, + ) + .into(); + output + } + /// Creates a new vector from an array. + fn from_array(a: [i16; 2]) -> Val { + let output: Val = bevy::math::I16Vec2::from_array(a).into(); + output + } + /// Returns a bitmask with the lowest 2 bits set to the sign bits from the elements of `self`. + /// A negative element results in a `1` bit and a positive element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn is_negative_bitmask(_self: Val) -> u32 { + let output: u32 = bevy::math::I16Vec2::is_negative_bitmask(_self.into_inner()) + .into(); + output + } + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> i16 { + let output: i16 = bevy::math::I16Vec2::length_squared(_self.into_inner()).into(); + output + } + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> i16 { + let output: i16 = bevy::math::I16Vec2::max_element(_self.into_inner()).into(); + output + } + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> i16 { + let output: i16 = bevy::math::I16Vec2::min_element(_self.into_inner()).into(); + output + } + /// Creates a new vector. + fn new(x: i16, y: i16) -> Val { + let output: Val = bevy::math::I16Vec2::new(x, y).into(); + output + } + /// Returns a vector that is equal to `self` rotated by 90 degrees. + fn perp(_self: Val) -> Val { + let output: Val = bevy::math::I16Vec2::perp( + _self.into_inner(), + ) + .into(); + output + } + /// The perpendicular dot product of `self` and `rhs`. + /// Also known as the wedge product, 2D cross product, and determinant. + fn perp_dot(_self: Val, rhs: Val) -> i16 { + let output: i16 = bevy::math::I16Vec2::perp_dot( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + /// [Euclidean division]: i16::rem_euclid + fn rem_euclid( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::rem_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns `rhs` rotated by the angle of `self`. If `self` is normalized, + /// then this just rotation. This is what you usually want. Otherwise, + /// it will be like a rotation with a multiplication by `self`'s length. + fn rotate( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::rotate( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// In other words this computes `[self.x.saturating_add_unsigned(rhs.x), self.y.saturating_add_unsigned(rhs.y), ..]`. + fn saturating_add_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::saturating_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.saturating_sub_unsigned(rhs.x), self.y.saturating_sub_unsigned(rhs.y), ..]`. + fn saturating_sub_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::saturating_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + /// Returns a vector with elements representing the sign of `self`. + /// - `0` if the number is zero + /// - `1` if the number is positive + /// - `-1` if the number is negative + fn signum(_self: Val) -> Val { + let output: Val = bevy::math::I16Vec2::signum( + _self.into_inner(), + ) + .into(); + output + } + /// Creates a vector with all elements set to `v`. + fn splat(v: i16) -> Val { + let output: Val = bevy::math::I16Vec2::splat(v).into(); + output + } + /// `[x, y]` + fn to_array(_self: Ref) -> [i16; 2] { + let output: [i16; 2] = bevy::math::I16Vec2::to_array(&_self).into(); + output + } + /// Creates a 2D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: i16) -> Val { + let output: Val = bevy::math::I16Vec2::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + /// Creates a 2D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: i16) -> Val { + let output: Val = bevy::math::I16Vec2::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_unsigned(rhs.x), self.y.wrapping_add_unsigned(rhs.y), ..]`. + fn wrapping_add_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::wrapping_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::wrapping_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_sub_unsigned(rhs.x), self.y.wrapping_sub_unsigned(rhs.y), ..]`. + fn wrapping_sub_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec2::wrapping_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings( + remote, + name = "i_16_vec_3_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::math::I16Vec3 { + /// Returns a vector containing the absolute value of each element of `self`. + fn abs(_self: Val) -> Val { + let output: Val = bevy::math::I16Vec3::abs( + _self.into_inner(), + ) + .into(); + output + } + /// Casts all elements of `self` to `f64`. + fn as_dvec3(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec3::as_dvec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i64`. + fn as_i64vec3(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec3::as_i64vec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i8`. + fn as_i8vec3(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec3::as_i8vec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i32`. + fn as_ivec3(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec3::as_ivec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u16`. + fn as_u16vec3(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec3::as_u16vec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u64`. + fn as_u64vec3(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec3::as_u64vec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u8`. + fn as_u8vec3(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec3::as_u8vec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u32`. + fn as_uvec3(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec3::as_uvec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `f32`. + fn as_vec3(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec3::as_vec3(&_self).into(); + output + } + /// Casts all elements of `self` to `f32`. + fn as_vec3a(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec3::as_vec3a(&_self) + .into(); + output + } + /// Component-wise clamping of values, similar to [`i16::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. + fn clamp( + _self: Val, + min: Val, + max: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Computes the cross product of `self` and `rhs`. + fn cross( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::cross( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Compute the squared euclidean distance between two points in space. + fn distance_squared( + _self: Val, + rhs: Val, + ) -> i16 { + let output: i16 = bevy::math::I16Vec3::distance_squared( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + fn div_euclid( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::div_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> i16 { + let output: i16 = bevy::math::I16Vec3::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> i16 { + let output: i16 = bevy::math::I16Vec3::element_product(_self.into_inner()) + .into(); + output + } + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> i16 { + let output: i16 = bevy::math::I16Vec3::element_sum(_self.into_inner()).into(); + output + } + /// Creates a 4D vector from `self` and the given `w` value. + fn extend(_self: Val, w: i16) -> Val { + let output: Val = bevy::math::I16Vec3::extend( + _self.into_inner(), + w, + ) + .into(); + output + } + /// Creates a new vector from an array. + fn from_array(a: [i16; 3]) -> Val { + let output: Val = bevy::math::I16Vec3::from_array(a).into(); + output + } + /// Returns a bitmask with the lowest 3 bits set to the sign bits from the elements of `self`. + /// A negative element results in a `1` bit and a positive element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn is_negative_bitmask(_self: Val) -> u32 { + let output: u32 = bevy::math::I16Vec3::is_negative_bitmask(_self.into_inner()) + .into(); + output + } + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> i16 { + let output: i16 = bevy::math::I16Vec3::length_squared(_self.into_inner()).into(); + output + } + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> i16 { + let output: i16 = bevy::math::I16Vec3::max_element(_self.into_inner()).into(); + output + } + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> i16 { + let output: i16 = bevy::math::I16Vec3::min_element(_self.into_inner()).into(); + output + } + /// Creates a new vector. + fn new(x: i16, y: i16, z: i16) -> Val { + let output: Val = bevy::math::I16Vec3::new(x, y, z).into(); + output + } + /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + /// [Euclidean division]: i16::rem_euclid + fn rem_euclid( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::rem_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// In other words this computes `[self.x.saturating_add_unsigned(rhs.x), self.y.saturating_add_unsigned(rhs.y), ..]`. + fn saturating_add_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::saturating_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.saturating_sub_unsigned(rhs.x), self.y.saturating_sub_unsigned(rhs.y), ..]`. + fn saturating_sub_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::saturating_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + /// Returns a vector with elements representing the sign of `self`. + /// - `0` if the number is zero + /// - `1` if the number is positive + /// - `-1` if the number is negative + fn signum(_self: Val) -> Val { + let output: Val = bevy::math::I16Vec3::signum( + _self.into_inner(), + ) + .into(); + output + } + /// Creates a vector with all elements set to `v`. + fn splat(v: i16) -> Val { + let output: Val = bevy::math::I16Vec3::splat(v).into(); + output + } + /// `[x, y, z]` + fn to_array(_self: Ref) -> [i16; 3] { + let output: [i16; 3] = bevy::math::I16Vec3::to_array(&_self).into(); + output + } + /// Creates a 2D vector from the `x` and `y` elements of `self`, discarding `z`. + /// Truncation may also be performed by using [`self.xy()`][crate::swizzles::Vec3Swizzles::xy()]. + fn truncate(_self: Val) -> Val { + let output: Val = bevy::math::I16Vec3::truncate( + _self.into_inner(), + ) + .into(); + output + } + /// Creates a 3D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: i16) -> Val { + let output: Val = bevy::math::I16Vec3::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + /// Creates a 3D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: i16) -> Val { + let output: Val = bevy::math::I16Vec3::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + /// Creates a 3D vector from `self` with the given value of `z`. + fn with_z(_self: Val, z: i16) -> Val { + let output: Val = bevy::math::I16Vec3::with_z( + _self.into_inner(), + z, + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_unsigned(rhs.x), self.y.wrapping_add_unsigned(rhs.y), ..]`. + fn wrapping_add_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::wrapping_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::wrapping_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_sub_unsigned(rhs.x), self.y.wrapping_sub_unsigned(rhs.y), ..]`. + fn wrapping_sub_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec3::wrapping_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings( + remote, + name = "i_16_vec_4_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::math::I16Vec4 { + /// Returns a vector containing the absolute value of each element of `self`. + fn abs(_self: Val) -> Val { + let output: Val = bevy::math::I16Vec4::abs( + _self.into_inner(), + ) + .into(); + output + } + /// Casts all elements of `self` to `f64`. + fn as_dvec4(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec4::as_dvec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i64`. + fn as_i64vec4(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec4::as_i64vec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i8`. + fn as_i8vec4(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec4::as_i8vec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i32`. + fn as_ivec4(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec4::as_ivec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u16`. + fn as_u16vec4(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec4::as_u16vec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u64`. + fn as_u64vec4(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec4::as_u64vec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u8`. + fn as_u8vec4(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec4::as_u8vec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u32`. + fn as_uvec4(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec4::as_uvec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `f32`. + fn as_vec4(_self: Ref) -> Val { + let output: Val = bevy::math::I16Vec4::as_vec4(&_self).into(); + output + } + /// Component-wise clamping of values, similar to [`i16::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. + fn clamp( + _self: Val, + min: Val, + max: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Compute the squared euclidean distance between two points in space. + fn distance_squared( + _self: Val, + rhs: Val, + ) -> i16 { + let output: i16 = bevy::math::I16Vec4::distance_squared( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + fn div_euclid( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::div_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> i16 { + let output: i16 = bevy::math::I16Vec4::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> i16 { + let output: i16 = bevy::math::I16Vec4::element_product(_self.into_inner()) + .into(); + output + } + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> i16 { + let output: i16 = bevy::math::I16Vec4::element_sum(_self.into_inner()).into(); + output + } + /// Creates a new vector from an array. + fn from_array(a: [i16; 4]) -> Val { + let output: Val = bevy::math::I16Vec4::from_array(a).into(); + output + } + /// Returns a bitmask with the lowest 4 bits set to the sign bits from the elements of `self`. + /// A negative element results in a `1` bit and a positive element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn is_negative_bitmask(_self: Val) -> u32 { + let output: u32 = bevy::math::I16Vec4::is_negative_bitmask(_self.into_inner()) + .into(); + output + } + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> i16 { + let output: i16 = bevy::math::I16Vec4::length_squared(_self.into_inner()).into(); + output + } + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> i16 { + let output: i16 = bevy::math::I16Vec4::max_element(_self.into_inner()).into(); + output + } + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> i16 { + let output: i16 = bevy::math::I16Vec4::min_element(_self.into_inner()).into(); + output + } + /// Creates a new vector. + fn new(x: i16, y: i16, z: i16, w: i16) -> Val { + let output: Val = bevy::math::I16Vec4::new(x, y, z, w) + .into(); + output + } + /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + /// [Euclidean division]: i16::rem_euclid + fn rem_euclid( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::rem_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// In other words this computes `[self.x.saturating_add_unsigned(rhs.x), self.y.saturating_add_unsigned(rhs.y), ..]`. + fn saturating_add_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::saturating_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.saturating_sub_unsigned(rhs.x), self.y.saturating_sub_unsigned(rhs.y), ..]`. + fn saturating_sub_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::saturating_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + /// Returns a vector with elements representing the sign of `self`. + /// - `0` if the number is zero + /// - `1` if the number is positive + /// - `-1` if the number is negative + fn signum(_self: Val) -> Val { + let output: Val = bevy::math::I16Vec4::signum( + _self.into_inner(), + ) + .into(); + output + } + /// Creates a vector with all elements set to `v`. + fn splat(v: i16) -> Val { + let output: Val = bevy::math::I16Vec4::splat(v).into(); + output + } + /// `[x, y, z, w]` + fn to_array(_self: Ref) -> [i16; 4] { + let output: [i16; 4] = bevy::math::I16Vec4::to_array(&_self).into(); + output + } + /// Creates a 3D vector from the `x`, `y` and `z` elements of `self`, discarding `w`. + /// Truncation to [`I16Vec3`] may also be performed by using [`self.xyz()`][crate::swizzles::Vec4Swizzles::xyz()]. + fn truncate(_self: Val) -> Val { + let output: Val = bevy::math::I16Vec4::truncate( + _self.into_inner(), + ) + .into(); + output + } + /// Creates a 4D vector from `self` with the given value of `w`. + fn with_w(_self: Val, w: i16) -> Val { + let output: Val = bevy::math::I16Vec4::with_w( + _self.into_inner(), + w, + ) + .into(); + output + } + /// Creates a 4D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: i16) -> Val { + let output: Val = bevy::math::I16Vec4::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + /// Creates a 4D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: i16) -> Val { + let output: Val = bevy::math::I16Vec4::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + /// Creates a 4D vector from `self` with the given value of `z`. + fn with_z(_self: Val, z: i16) -> Val { + let output: Val = bevy::math::I16Vec4::with_z( + _self.into_inner(), + z, + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_unsigned(rhs.x), self.y.wrapping_add_unsigned(rhs.y), ..]`. + fn wrapping_add_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::wrapping_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::wrapping_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_sub_unsigned(rhs.x), self.y.wrapping_sub_unsigned(rhs.y), ..]`. + fn wrapping_sub_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I16Vec4::wrapping_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings( + remote, + name = "i_64_vec_2_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::math::I64Vec2 { + /// Returns a vector containing the absolute value of each element of `self`. + fn abs(_self: Val) -> Val { + let output: Val = bevy::math::I64Vec2::abs( + _self.into_inner(), + ) + .into(); + output + } + /// Casts all elements of `self` to `f64`. + fn as_dvec2(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec2::as_dvec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i16`. + fn as_i16vec2(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec2::as_i16vec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i8`. + fn as_i8vec2(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec2::as_i8vec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i32`. + fn as_ivec2(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec2::as_ivec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u16`. + fn as_u16vec2(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec2::as_u16vec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u64`. + fn as_u64vec2(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec2::as_u64vec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u8`. + fn as_u8vec2(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec2::as_u8vec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u32`. + fn as_uvec2(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec2::as_uvec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `f32`. + fn as_vec2(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec2::as_vec2(&_self).into(); + output + } + /// Component-wise clamping of values, similar to [`i64::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. + fn clamp( + _self: Val, + min: Val, + max: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Compute the squared euclidean distance between two points in space. + fn distance_squared( + _self: Val, + rhs: Val, + ) -> i64 { + let output: i64 = bevy::math::I64Vec2::distance_squared( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + fn div_euclid( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::div_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> i64 { + let output: i64 = bevy::math::I64Vec2::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> i64 { + let output: i64 = bevy::math::I64Vec2::element_product(_self.into_inner()) + .into(); + output + } + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> i64 { + let output: i64 = bevy::math::I64Vec2::element_sum(_self.into_inner()).into(); + output + } + /// Creates a 3D vector from `self` and the given `z` value. + fn extend(_self: Val, z: i64) -> Val { + let output: Val = bevy::math::I64Vec2::extend( + _self.into_inner(), + z, + ) + .into(); + output + } + /// Creates a new vector from an array. + fn from_array(a: [i64; 2]) -> Val { + let output: Val = bevy::math::I64Vec2::from_array(a).into(); + output + } + /// Returns a bitmask with the lowest 2 bits set to the sign bits from the elements of `self`. + /// A negative element results in a `1` bit and a positive element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn is_negative_bitmask(_self: Val) -> u32 { + let output: u32 = bevy::math::I64Vec2::is_negative_bitmask(_self.into_inner()) + .into(); + output + } + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> i64 { + let output: i64 = bevy::math::I64Vec2::length_squared(_self.into_inner()).into(); + output + } + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> i64 { + let output: i64 = bevy::math::I64Vec2::max_element(_self.into_inner()).into(); + output + } + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> i64 { + let output: i64 = bevy::math::I64Vec2::min_element(_self.into_inner()).into(); + output + } + /// Creates a new vector. + fn new(x: i64, y: i64) -> Val { + let output: Val = bevy::math::I64Vec2::new(x, y).into(); + output + } + /// Returns a vector that is equal to `self` rotated by 90 degrees. + fn perp(_self: Val) -> Val { + let output: Val = bevy::math::I64Vec2::perp( + _self.into_inner(), + ) + .into(); + output + } + /// The perpendicular dot product of `self` and `rhs`. + /// Also known as the wedge product, 2D cross product, and determinant. + fn perp_dot(_self: Val, rhs: Val) -> i64 { + let output: i64 = bevy::math::I64Vec2::perp_dot( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + /// [Euclidean division]: i64::rem_euclid + fn rem_euclid( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::rem_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns `rhs` rotated by the angle of `self`. If `self` is normalized, + /// then this just rotation. This is what you usually want. Otherwise, + /// it will be like a rotation with a multiplication by `self`'s length. + fn rotate( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::rotate( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// In other words this computes `[self.x.saturating_add_unsigned(rhs.x), self.y.saturating_add_unsigned(rhs.y), ..]`. + fn saturating_add_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::saturating_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.saturating_sub_unsigned(rhs.x), self.y.saturating_sub_unsigned(rhs.y), ..]`. + fn saturating_sub_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::saturating_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + /// Returns a vector with elements representing the sign of `self`. + /// - `0` if the number is zero + /// - `1` if the number is positive + /// - `-1` if the number is negative + fn signum(_self: Val) -> Val { + let output: Val = bevy::math::I64Vec2::signum( + _self.into_inner(), + ) + .into(); + output + } + /// Creates a vector with all elements set to `v`. + fn splat(v: i64) -> Val { + let output: Val = bevy::math::I64Vec2::splat(v).into(); + output + } + /// `[x, y]` + fn to_array(_self: Ref) -> [i64; 2] { + let output: [i64; 2] = bevy::math::I64Vec2::to_array(&_self).into(); + output + } + /// Creates a 2D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: i64) -> Val { + let output: Val = bevy::math::I64Vec2::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + /// Creates a 2D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: i64) -> Val { + let output: Val = bevy::math::I64Vec2::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_unsigned(rhs.x), self.y.wrapping_add_unsigned(rhs.y), ..]`. + fn wrapping_add_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::wrapping_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::wrapping_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_sub_unsigned(rhs.x), self.y.wrapping_sub_unsigned(rhs.y), ..]`. + fn wrapping_sub_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec2::wrapping_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings( + remote, + name = "i_64_vec_3_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::math::I64Vec3 { + /// Returns a vector containing the absolute value of each element of `self`. + fn abs(_self: Val) -> Val { + let output: Val = bevy::math::I64Vec3::abs( + _self.into_inner(), + ) + .into(); + output + } + /// Casts all elements of `self` to `f64`. + fn as_dvec3(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec3::as_dvec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i16`. + fn as_i16vec3(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec3::as_i16vec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i8`. + fn as_i8vec3(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec3::as_i8vec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i32`. + fn as_ivec3(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec3::as_ivec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u16`. + fn as_u16vec3(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec3::as_u16vec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u64`. + fn as_u64vec3(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec3::as_u64vec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u8`. + fn as_u8vec3(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec3::as_u8vec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u32`. + fn as_uvec3(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec3::as_uvec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `f32`. + fn as_vec3(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec3::as_vec3(&_self).into(); + output + } + /// Casts all elements of `self` to `f32`. + fn as_vec3a(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec3::as_vec3a(&_self) + .into(); + output + } + /// Component-wise clamping of values, similar to [`i64::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. + fn clamp( + _self: Val, + min: Val, + max: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Computes the cross product of `self` and `rhs`. + fn cross( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::cross( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Compute the squared euclidean distance between two points in space. + fn distance_squared( + _self: Val, + rhs: Val, + ) -> i64 { + let output: i64 = bevy::math::I64Vec3::distance_squared( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + fn div_euclid( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::div_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> i64 { + let output: i64 = bevy::math::I64Vec3::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> i64 { + let output: i64 = bevy::math::I64Vec3::element_product(_self.into_inner()) + .into(); + output + } + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> i64 { + let output: i64 = bevy::math::I64Vec3::element_sum(_self.into_inner()).into(); + output + } + /// Creates a 4D vector from `self` and the given `w` value. + fn extend(_self: Val, w: i64) -> Val { + let output: Val = bevy::math::I64Vec3::extend( + _self.into_inner(), + w, + ) + .into(); + output + } + /// Creates a new vector from an array. + fn from_array(a: [i64; 3]) -> Val { + let output: Val = bevy::math::I64Vec3::from_array(a).into(); + output + } + /// Returns a bitmask with the lowest 3 bits set to the sign bits from the elements of `self`. + /// A negative element results in a `1` bit and a positive element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn is_negative_bitmask(_self: Val) -> u32 { + let output: u32 = bevy::math::I64Vec3::is_negative_bitmask(_self.into_inner()) + .into(); + output + } + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> i64 { + let output: i64 = bevy::math::I64Vec3::length_squared(_self.into_inner()).into(); + output + } + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> i64 { + let output: i64 = bevy::math::I64Vec3::max_element(_self.into_inner()).into(); + output + } + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> i64 { + let output: i64 = bevy::math::I64Vec3::min_element(_self.into_inner()).into(); + output + } + /// Creates a new vector. + fn new(x: i64, y: i64, z: i64) -> Val { + let output: Val = bevy::math::I64Vec3::new(x, y, z).into(); + output + } + /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + /// [Euclidean division]: i64::rem_euclid + fn rem_euclid( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::rem_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// In other words this computes `[self.x.saturating_add_unsigned(rhs.x), self.y.saturating_add_unsigned(rhs.y), ..]`. + fn saturating_add_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::saturating_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.saturating_sub_unsigned(rhs.x), self.y.saturating_sub_unsigned(rhs.y), ..]`. + fn saturating_sub_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::saturating_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + /// Returns a vector with elements representing the sign of `self`. + /// - `0` if the number is zero + /// - `1` if the number is positive + /// - `-1` if the number is negative + fn signum(_self: Val) -> Val { + let output: Val = bevy::math::I64Vec3::signum( + _self.into_inner(), + ) + .into(); + output + } + /// Creates a vector with all elements set to `v`. + fn splat(v: i64) -> Val { + let output: Val = bevy::math::I64Vec3::splat(v).into(); + output + } + /// `[x, y, z]` + fn to_array(_self: Ref) -> [i64; 3] { + let output: [i64; 3] = bevy::math::I64Vec3::to_array(&_self).into(); + output + } + /// Creates a 2D vector from the `x` and `y` elements of `self`, discarding `z`. + /// Truncation may also be performed by using [`self.xy()`][crate::swizzles::Vec3Swizzles::xy()]. + fn truncate(_self: Val) -> Val { + let output: Val = bevy::math::I64Vec3::truncate( + _self.into_inner(), + ) + .into(); + output + } + /// Creates a 3D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: i64) -> Val { + let output: Val = bevy::math::I64Vec3::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + /// Creates a 3D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: i64) -> Val { + let output: Val = bevy::math::I64Vec3::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + /// Creates a 3D vector from `self` with the given value of `z`. + fn with_z(_self: Val, z: i64) -> Val { + let output: Val = bevy::math::I64Vec3::with_z( + _self.into_inner(), + z, + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_unsigned(rhs.x), self.y.wrapping_add_unsigned(rhs.y), ..]`. + fn wrapping_add_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::wrapping_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::wrapping_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_sub_unsigned(rhs.x), self.y.wrapping_sub_unsigned(rhs.y), ..]`. + fn wrapping_sub_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec3::wrapping_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings( + remote, + name = "i_64_vec_4_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::math::I64Vec4 { + /// Returns a vector containing the absolute value of each element of `self`. + fn abs(_self: Val) -> Val { + let output: Val = bevy::math::I64Vec4::abs( + _self.into_inner(), + ) + .into(); + output + } + /// Casts all elements of `self` to `f64`. + fn as_dvec4(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec4::as_dvec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i16`. + fn as_i16vec4(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec4::as_i16vec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i8`. + fn as_i8vec4(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec4::as_i8vec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i32`. + fn as_ivec4(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec4::as_ivec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u16`. + fn as_u16vec4(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec4::as_u16vec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u64`. + fn as_u64vec4(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec4::as_u64vec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u8`. + fn as_u8vec4(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec4::as_u8vec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u32`. + fn as_uvec4(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec4::as_uvec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `f32`. + fn as_vec4(_self: Ref) -> Val { + let output: Val = bevy::math::I64Vec4::as_vec4(&_self).into(); + output + } + /// Component-wise clamping of values, similar to [`i64::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. + fn clamp( + _self: Val, + min: Val, + max: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Compute the squared euclidean distance between two points in space. + fn distance_squared( + _self: Val, + rhs: Val, + ) -> i64 { + let output: i64 = bevy::math::I64Vec4::distance_squared( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + fn div_euclid( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::div_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> i64 { + let output: i64 = bevy::math::I64Vec4::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> i64 { + let output: i64 = bevy::math::I64Vec4::element_product(_self.into_inner()) + .into(); + output + } + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> i64 { + let output: i64 = bevy::math::I64Vec4::element_sum(_self.into_inner()).into(); + output + } + /// Creates a new vector from an array. + fn from_array(a: [i64; 4]) -> Val { + let output: Val = bevy::math::I64Vec4::from_array(a).into(); + output + } + /// Returns a bitmask with the lowest 4 bits set to the sign bits from the elements of `self`. + /// A negative element results in a `1` bit and a positive element in a `0` bit. Element `x` goes + /// into the first lowest bit, element `y` into the second, etc. + fn is_negative_bitmask(_self: Val) -> u32 { + let output: u32 = bevy::math::I64Vec4::is_negative_bitmask(_self.into_inner()) + .into(); + output + } + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> i64 { + let output: i64 = bevy::math::I64Vec4::length_squared(_self.into_inner()).into(); + output + } + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> i64 { + let output: i64 = bevy::math::I64Vec4::max_element(_self.into_inner()).into(); + output + } + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> i64 { + let output: i64 = bevy::math::I64Vec4::min_element(_self.into_inner()).into(); + output + } + /// Creates a new vector. + fn new(x: i64, y: i64, z: i64, w: i64) -> Val { + let output: Val = bevy::math::I64Vec4::new(x, y, z, w) + .into(); + output + } + /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. + /// # Panics + /// This function will panic if any `rhs` element is 0 or the division results in overflow. + /// [Euclidean division]: i64::rem_euclid + fn rem_euclid( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::rem_euclid( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// In other words this computes `[self.x.saturating_add_unsigned(rhs.x), self.y.saturating_add_unsigned(rhs.y), ..]`. + fn saturating_add_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::saturating_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.saturating_sub_unsigned(rhs.x), self.y.saturating_sub_unsigned(rhs.y), ..]`. + fn saturating_sub_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::saturating_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + /// Returns a vector with elements representing the sign of `self`. + /// - `0` if the number is zero + /// - `1` if the number is positive + /// - `-1` if the number is negative + fn signum(_self: Val) -> Val { + let output: Val = bevy::math::I64Vec4::signum( + _self.into_inner(), + ) + .into(); + output + } + /// Creates a vector with all elements set to `v`. + fn splat(v: i64) -> Val { + let output: Val = bevy::math::I64Vec4::splat(v).into(); + output + } + /// `[x, y, z, w]` + fn to_array(_self: Ref) -> [i64; 4] { + let output: [i64; 4] = bevy::math::I64Vec4::to_array(&_self).into(); + output + } + /// Creates a 3D vector from the `x`, `y` and `z` elements of `self`, discarding `w`. + /// Truncation to [`I64Vec3`] may also be performed by using [`self.xyz()`][crate::swizzles::Vec4Swizzles::xyz()]. + fn truncate(_self: Val) -> Val { + let output: Val = bevy::math::I64Vec4::truncate( + _self.into_inner(), + ) + .into(); + output + } + /// Creates a 4D vector from `self` with the given value of `w`. + fn with_w(_self: Val, w: i64) -> Val { + let output: Val = bevy::math::I64Vec4::with_w( + _self.into_inner(), + w, + ) + .into(); + output + } + /// Creates a 4D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: i64) -> Val { + let output: Val = bevy::math::I64Vec4::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + /// Creates a 4D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: i64) -> Val { + let output: Val = bevy::math::I64Vec4::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + /// Creates a 4D vector from `self` with the given value of `z`. + fn with_z(_self: Val, z: i64) -> Val { + let output: Val = bevy::math::I64Vec4::with_z( + _self.into_inner(), + z, + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_unsigned(rhs.x), self.y.wrapping_add_unsigned(rhs.y), ..]`. + fn wrapping_add_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::wrapping_add_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::wrapping_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping subtraction of `self` and unsigned vector `rhs`. + /// In other words this computes `[self.x.wrapping_sub_unsigned(rhs.x), self.y.wrapping_sub_unsigned(rhs.y), ..]`. + fn wrapping_sub_unsigned( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::I64Vec4::wrapping_sub_unsigned( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings( + remote, + name = "u_vec_2_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::math::UVec2 { + /// Casts all elements of `self` to `f64`. + fn as_dvec2(_self: Ref) -> Val { + let output: Val = bevy::math::UVec2::as_dvec2(&_self).into(); + output + } + /// Casts all elements of `self` to `i16`. + fn as_i16vec2(_self: Ref) -> Val { + let output: Val = bevy::math::UVec2::as_i16vec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i64`. + fn as_i64vec2(_self: Ref) -> Val { + let output: Val = bevy::math::UVec2::as_i64vec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i8`. + fn as_i8vec2(_self: Ref) -> Val { + let output: Val = bevy::math::UVec2::as_i8vec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i32`. + fn as_ivec2(_self: Ref) -> Val { + let output: Val = bevy::math::UVec2::as_ivec2(&_self).into(); + output + } + /// Casts all elements of `self` to `u16`. + fn as_u16vec2(_self: Ref) -> Val { + let output: Val = bevy::math::UVec2::as_u16vec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u64`. + fn as_u64vec2(_self: Ref) -> Val { + let output: Val = bevy::math::UVec2::as_u64vec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u8`. + fn as_u8vec2(_self: Ref) -> Val { + let output: Val = bevy::math::UVec2::as_u8vec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `f32`. + fn as_vec2(_self: Ref) -> Val { + let output: Val = bevy::math::UVec2::as_vec2(&_self).into(); + output + } + /// Component-wise clamping of values, similar to [`u32::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. + fn clamp( + _self: Val, + min: Val, + max: Val, + ) -> Val { + let output: Val = bevy::math::UVec2::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec2::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec2::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec2::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec2::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec2::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec2::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> u32 { + let output: u32 = bevy::math::UVec2::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec2::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> u32 { + let output: u32 = bevy::math::UVec2::element_product(_self.into_inner()).into(); + output + } + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> u32 { + let output: u32 = bevy::math::UVec2::element_sum(_self.into_inner()).into(); + output + } + /// Creates a 3D vector from `self` and the given `z` value. + fn extend(_self: Val, z: u32) -> Val { + let output: Val = bevy::math::UVec2::extend( + _self.into_inner(), + z, + ) + .into(); + output + } + /// Creates a new vector from an array. + fn from_array(a: [u32; 2]) -> Val { + let output: Val = bevy::math::UVec2::from_array(a).into(); + output + } + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> u32 { + let output: u32 = bevy::math::UVec2::length_squared(_self.into_inner()).into(); + output + } + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec2::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> u32 { + let output: u32 = bevy::math::UVec2::max_element(_self.into_inner()).into(); + output + } + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec2::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> u32 { + let output: u32 = bevy::math::UVec2::min_element(_self.into_inner()).into(); + output + } + /// Creates a new vector. + fn new(x: u32, y: u32) -> Val { + let output: Val = bevy::math::UVec2::new(x, y).into(); + output + } + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec2::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`. + fn saturating_add_signed( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec2::saturating_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec2::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec2::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec2::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) -> Val { + let output: Val = bevy::math::UVec2::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + /// Creates a vector with all elements set to `v`. + fn splat(v: u32) -> Val { + let output: Val = bevy::math::UVec2::splat(v).into(); + output + } + /// `[x, y]` + fn to_array(_self: Ref) -> [u32; 2] { + let output: [u32; 2] = bevy::math::UVec2::to_array(&_self).into(); + output + } + /// Creates a 2D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: u32) -> Val { + let output: Val = bevy::math::UVec2::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + /// Creates a 2D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: u32) -> Val { + let output: Val = bevy::math::UVec2::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec2::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_signed(rhs.x), self.y.wrapping_add_signed(rhs.y), ..]`. + fn wrapping_add_signed( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec2::wrapping_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec2::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec2::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec2::wrapping_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings( + remote, + name = "u_vec_3_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::math::UVec3 { + /// Casts all elements of `self` to `f64`. + fn as_dvec3(_self: Ref) -> Val { + let output: Val = bevy::math::UVec3::as_dvec3(&_self).into(); + output + } + /// Casts all elements of `self` to `i16`. + fn as_i16vec3(_self: Ref) -> Val { + let output: Val = bevy::math::UVec3::as_i16vec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i64`. + fn as_i64vec3(_self: Ref) -> Val { + let output: Val = bevy::math::UVec3::as_i64vec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i8`. + fn as_i8vec3(_self: Ref) -> Val { + let output: Val = bevy::math::UVec3::as_i8vec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i32`. + fn as_ivec3(_self: Ref) -> Val { + let output: Val = bevy::math::UVec3::as_ivec3(&_self).into(); + output + } + /// Casts all elements of `self` to `u16`. + fn as_u16vec3(_self: Ref) -> Val { + let output: Val = bevy::math::UVec3::as_u16vec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u64`. + fn as_u64vec3(_self: Ref) -> Val { + let output: Val = bevy::math::UVec3::as_u64vec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u8`. + fn as_u8vec3(_self: Ref) -> Val { + let output: Val = bevy::math::UVec3::as_u8vec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `f32`. + fn as_vec3(_self: Ref) -> Val { + let output: Val = bevy::math::UVec3::as_vec3(&_self).into(); + output + } + /// Casts all elements of `self` to `f32`. + fn as_vec3a(_self: Ref) -> Val { + let output: Val = bevy::math::UVec3::as_vec3a(&_self).into(); + output + } + /// Component-wise clamping of values, similar to [`u32::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. + fn clamp( + _self: Val, + min: Val, + max: Val, + ) -> Val { + let output: Val = bevy::math::UVec3::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec3::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec3::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec3::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec3::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec3::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec3::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Computes the cross product of `self` and `rhs`. + fn cross( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec3::cross( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> u32 { + let output: u32 = bevy::math::UVec3::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec3::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> u32 { + let output: u32 = bevy::math::UVec3::element_product(_self.into_inner()).into(); + output + } + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> u32 { + let output: u32 = bevy::math::UVec3::element_sum(_self.into_inner()).into(); + output + } + /// Creates a 4D vector from `self` and the given `w` value. + fn extend(_self: Val, w: u32) -> Val { + let output: Val = bevy::math::UVec3::extend( + _self.into_inner(), + w, + ) + .into(); + output + } + /// Creates a new vector from an array. + fn from_array(a: [u32; 3]) -> Val { + let output: Val = bevy::math::UVec3::from_array(a).into(); + output + } + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> u32 { + let output: u32 = bevy::math::UVec3::length_squared(_self.into_inner()).into(); + output + } + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec3::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> u32 { + let output: u32 = bevy::math::UVec3::max_element(_self.into_inner()).into(); + output + } + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec3::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> u32 { + let output: u32 = bevy::math::UVec3::min_element(_self.into_inner()).into(); + output + } + /// Creates a new vector. + fn new(x: u32, y: u32, z: u32) -> Val { + let output: Val = bevy::math::UVec3::new(x, y, z).into(); + output + } + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec3::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`. + fn saturating_add_signed( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec3::saturating_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec3::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec3::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec3::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) -> Val { + let output: Val = bevy::math::UVec3::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + /// Creates a vector with all elements set to `v`. + fn splat(v: u32) -> Val { + let output: Val = bevy::math::UVec3::splat(v).into(); + output + } + /// `[x, y, z]` + fn to_array(_self: Ref) -> [u32; 3] { + let output: [u32; 3] = bevy::math::UVec3::to_array(&_self).into(); + output + } + /// Creates a 2D vector from the `x` and `y` elements of `self`, discarding `z`. + /// Truncation may also be performed by using [`self.xy()`][crate::swizzles::Vec3Swizzles::xy()]. + fn truncate(_self: Val) -> Val { + let output: Val = bevy::math::UVec3::truncate( + _self.into_inner(), + ) + .into(); + output + } + /// Creates a 3D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: u32) -> Val { + let output: Val = bevy::math::UVec3::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + /// Creates a 3D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: u32) -> Val { + let output: Val = bevy::math::UVec3::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + /// Creates a 3D vector from `self` with the given value of `z`. + fn with_z(_self: Val, z: u32) -> Val { + let output: Val = bevy::math::UVec3::with_z( + _self.into_inner(), + z, + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec3::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_signed(rhs.x), self.y.wrapping_add_signed(rhs.y), ..]`. + fn wrapping_add_signed( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec3::wrapping_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec3::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec3::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec3::wrapping_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings( + remote, + name = "u_vec_4_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::math::UVec4 { + /// Casts all elements of `self` to `f64`. + fn as_dvec4(_self: Ref) -> Val { + let output: Val = bevy::math::UVec4::as_dvec4(&_self).into(); + output + } + /// Casts all elements of `self` to `i16`. + fn as_i16vec4(_self: Ref) -> Val { + let output: Val = bevy::math::UVec4::as_i16vec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i64`. + fn as_i64vec4(_self: Ref) -> Val { + let output: Val = bevy::math::UVec4::as_i64vec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i8`. + fn as_i8vec4(_self: Ref) -> Val { + let output: Val = bevy::math::UVec4::as_i8vec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i32`. + fn as_ivec4(_self: Ref) -> Val { + let output: Val = bevy::math::UVec4::as_ivec4(&_self).into(); + output + } + /// Casts all elements of `self` to `u16`. + fn as_u16vec4(_self: Ref) -> Val { + let output: Val = bevy::math::UVec4::as_u16vec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u64`. + fn as_u64vec4(_self: Ref) -> Val { + let output: Val = bevy::math::UVec4::as_u64vec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u8`. + fn as_u8vec4(_self: Ref) -> Val { + let output: Val = bevy::math::UVec4::as_u8vec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `f32`. + fn as_vec4(_self: Ref) -> Val { + let output: Val = bevy::math::UVec4::as_vec4(&_self).into(); + output + } + /// Component-wise clamping of values, similar to [`u32::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. + fn clamp( + _self: Val, + min: Val, + max: Val, + ) -> Val { + let output: Val = bevy::math::UVec4::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec4::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec4::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec4::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec4::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec4::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec4::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> u32 { + let output: u32 = bevy::math::UVec4::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec4::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> u32 { + let output: u32 = bevy::math::UVec4::element_product(_self.into_inner()).into(); + output + } + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> u32 { + let output: u32 = bevy::math::UVec4::element_sum(_self.into_inner()).into(); + output + } + /// Creates a new vector from an array. + fn from_array(a: [u32; 4]) -> Val { + let output: Val = bevy::math::UVec4::from_array(a).into(); + output + } + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> u32 { + let output: u32 = bevy::math::UVec4::length_squared(_self.into_inner()).into(); + output + } + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec4::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> u32 { + let output: u32 = bevy::math::UVec4::max_element(_self.into_inner()).into(); + output + } + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec4::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> u32 { + let output: u32 = bevy::math::UVec4::min_element(_self.into_inner()).into(); + output + } + /// Creates a new vector. + fn new(x: u32, y: u32, z: u32, w: u32) -> Val { + let output: Val = bevy::math::UVec4::new(x, y, z, w).into(); + output + } + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec4::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`. + fn saturating_add_signed( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec4::saturating_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec4::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec4::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec4::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) -> Val { + let output: Val = bevy::math::UVec4::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + /// Creates a vector with all elements set to `v`. + fn splat(v: u32) -> Val { + let output: Val = bevy::math::UVec4::splat(v).into(); + output + } + /// `[x, y, z, w]` + fn to_array(_self: Ref) -> [u32; 4] { + let output: [u32; 4] = bevy::math::UVec4::to_array(&_self).into(); + output + } + /// Creates a 3D vector from the `x`, `y` and `z` elements of `self`, discarding `w`. + /// Truncation to [`UVec3`] may also be performed by using [`self.xyz()`][crate::swizzles::Vec4Swizzles::xyz()]. + fn truncate(_self: Val) -> Val { + let output: Val = bevy::math::UVec4::truncate( + _self.into_inner(), + ) + .into(); + output + } + /// Creates a 4D vector from `self` with the given value of `w`. + fn with_w(_self: Val, w: u32) -> Val { + let output: Val = bevy::math::UVec4::with_w( + _self.into_inner(), + w, + ) + .into(); + output + } + /// Creates a 4D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: u32) -> Val { + let output: Val = bevy::math::UVec4::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + /// Creates a 4D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: u32) -> Val { + let output: Val = bevy::math::UVec4::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + /// Creates a 4D vector from `self` with the given value of `z`. + fn with_z(_self: Val, z: u32) -> Val { + let output: Val = bevy::math::UVec4::with_z( + _self.into_inner(), + z, + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec4::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_signed(rhs.x), self.y.wrapping_add_signed(rhs.y), ..]`. + fn wrapping_add_signed( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec4::wrapping_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec4::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec4::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::UVec4::wrapping_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings( + remote, + name = "u_8_vec_2_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::math::U8Vec2 { + /// Casts all elements of `self` to `f64`. + fn as_dvec2(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec2::as_dvec2(&_self).into(); + output + } + /// Casts all elements of `self` to `i16`. + fn as_i16vec2(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec2::as_i16vec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i64`. + fn as_i64vec2(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec2::as_i64vec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i8`. + fn as_i8vec2(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec2::as_i8vec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i32`. + fn as_ivec2(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec2::as_ivec2(&_self).into(); + output + } + /// Casts all elements of `self` to `u16`. + fn as_u16vec2(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec2::as_u16vec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u64`. + fn as_u64vec2(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec2::as_u64vec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u32`. + fn as_uvec2(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec2::as_uvec2(&_self).into(); + output + } + /// Casts all elements of `self` to `f32`. + fn as_vec2(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec2::as_vec2(&_self).into(); + output + } + /// Component-wise clamping of values, similar to [`u8::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. + fn clamp( + _self: Val, + min: Val, + max: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec2::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec2::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec2::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec2::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec2::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec2::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec2::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> u8 { + let output: u8 = bevy::math::U8Vec2::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec2::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> u8 { + let output: u8 = bevy::math::U8Vec2::element_product(_self.into_inner()).into(); + output + } + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> u8 { + let output: u8 = bevy::math::U8Vec2::element_sum(_self.into_inner()).into(); + output + } + /// Creates a 3D vector from `self` and the given `z` value. + fn extend(_self: Val, z: u8) -> Val { + let output: Val = bevy::math::U8Vec2::extend( + _self.into_inner(), + z, + ) + .into(); + output + } + /// Creates a new vector from an array. + fn from_array(a: [u8; 2]) -> Val { + let output: Val = bevy::math::U8Vec2::from_array(a).into(); + output + } + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> u8 { + let output: u8 = bevy::math::U8Vec2::length_squared(_self.into_inner()).into(); + output + } + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec2::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> u8 { + let output: u8 = bevy::math::U8Vec2::max_element(_self.into_inner()).into(); + output + } + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec2::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> u8 { + let output: u8 = bevy::math::U8Vec2::min_element(_self.into_inner()).into(); + output + } + /// Creates a new vector. + fn new(x: u8, y: u8) -> Val { + let output: Val = bevy::math::U8Vec2::new(x, y).into(); + output + } + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec2::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`. + fn saturating_add_signed( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec2::saturating_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec2::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec2::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec2::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec2::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + /// Creates a vector with all elements set to `v`. + fn splat(v: u8) -> Val { + let output: Val = bevy::math::U8Vec2::splat(v).into(); + output + } + /// `[x, y]` + fn to_array(_self: Ref) -> [u8; 2] { + let output: [u8; 2] = bevy::math::U8Vec2::to_array(&_self).into(); + output + } + /// Creates a 2D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: u8) -> Val { + let output: Val = bevy::math::U8Vec2::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + /// Creates a 2D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: u8) -> Val { + let output: Val = bevy::math::U8Vec2::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec2::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_signed(rhs.x), self.y.wrapping_add_signed(rhs.y), ..]`. + fn wrapping_add_signed( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec2::wrapping_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec2::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec2::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec2::wrapping_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings( + remote, + name = "u_8_vec_3_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::math::U8Vec3 { + /// Casts all elements of `self` to `f64`. + fn as_dvec3(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec3::as_dvec3(&_self).into(); + output + } + /// Casts all elements of `self` to `i16`. + fn as_i16vec3(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec3::as_i16vec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i64`. + fn as_i64vec3(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec3::as_i64vec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i8`. + fn as_i8vec3(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec3::as_i8vec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i32`. + fn as_ivec3(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec3::as_ivec3(&_self).into(); + output + } + /// Casts all elements of `self` to `u16`. + fn as_u16vec3(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec3::as_u16vec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u64`. + fn as_u64vec3(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec3::as_u64vec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u32`. + fn as_uvec3(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec3::as_uvec3(&_self).into(); + output + } + /// Casts all elements of `self` to `f32`. + fn as_vec3(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec3::as_vec3(&_self).into(); + output + } + /// Casts all elements of `self` to `f32`. + fn as_vec3a(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec3::as_vec3a(&_self).into(); + output + } + /// Component-wise clamping of values, similar to [`u8::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. + fn clamp( + _self: Val, + min: Val, + max: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec3::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec3::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec3::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec3::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec3::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec3::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec3::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Computes the cross product of `self` and `rhs`. + fn cross( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec3::cross( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> u8 { + let output: u8 = bevy::math::U8Vec3::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec3::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> u8 { + let output: u8 = bevy::math::U8Vec3::element_product(_self.into_inner()).into(); + output + } + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> u8 { + let output: u8 = bevy::math::U8Vec3::element_sum(_self.into_inner()).into(); + output + } + /// Creates a 4D vector from `self` and the given `w` value. + fn extend(_self: Val, w: u8) -> Val { + let output: Val = bevy::math::U8Vec3::extend( + _self.into_inner(), + w, + ) + .into(); + output + } + /// Creates a new vector from an array. + fn from_array(a: [u8; 3]) -> Val { + let output: Val = bevy::math::U8Vec3::from_array(a).into(); + output + } + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> u8 { + let output: u8 = bevy::math::U8Vec3::length_squared(_self.into_inner()).into(); + output + } + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec3::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> u8 { + let output: u8 = bevy::math::U8Vec3::max_element(_self.into_inner()).into(); + output + } + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec3::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> u8 { + let output: u8 = bevy::math::U8Vec3::min_element(_self.into_inner()).into(); + output + } + /// Creates a new vector. + fn new(x: u8, y: u8, z: u8) -> Val { + let output: Val = bevy::math::U8Vec3::new(x, y, z).into(); + output + } + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec3::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`. + fn saturating_add_signed( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec3::saturating_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec3::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec3::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec3::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec3::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + /// Creates a vector with all elements set to `v`. + fn splat(v: u8) -> Val { + let output: Val = bevy::math::U8Vec3::splat(v).into(); + output + } + /// `[x, y, z]` + fn to_array(_self: Ref) -> [u8; 3] { + let output: [u8; 3] = bevy::math::U8Vec3::to_array(&_self).into(); + output + } + /// Creates a 2D vector from the `x` and `y` elements of `self`, discarding `z`. + /// Truncation may also be performed by using [`self.xy()`][crate::swizzles::Vec3Swizzles::xy()]. + fn truncate(_self: Val) -> Val { + let output: Val = bevy::math::U8Vec3::truncate( + _self.into_inner(), + ) + .into(); + output + } + /// Creates a 3D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: u8) -> Val { + let output: Val = bevy::math::U8Vec3::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + /// Creates a 3D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: u8) -> Val { + let output: Val = bevy::math::U8Vec3::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + /// Creates a 3D vector from `self` with the given value of `z`. + fn with_z(_self: Val, z: u8) -> Val { + let output: Val = bevy::math::U8Vec3::with_z( + _self.into_inner(), + z, + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec3::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_signed(rhs.x), self.y.wrapping_add_signed(rhs.y), ..]`. + fn wrapping_add_signed( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec3::wrapping_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec3::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec3::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec3::wrapping_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } +} +#[script_bindings( + remote, + name = "u_8_vec_4_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::math::U8Vec4 { + /// Casts all elements of `self` to `f64`. + fn as_dvec4(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec4::as_dvec4(&_self).into(); + output + } + /// Casts all elements of `self` to `i16`. + fn as_i16vec4(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec4::as_i16vec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i64`. + fn as_i64vec4(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec4::as_i64vec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i8`. + fn as_i8vec4(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec4::as_i8vec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `i32`. + fn as_ivec4(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec4::as_ivec4(&_self).into(); + output + } + /// Casts all elements of `self` to `u16`. + fn as_u16vec4(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec4::as_u16vec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u64`. + fn as_u64vec4(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec4::as_u64vec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u32`. + fn as_uvec4(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec4::as_uvec4(&_self).into(); + output + } + /// Casts all elements of `self` to `f32`. + fn as_vec4(_self: Ref) -> Val { + let output: Val = bevy::math::U8Vec4::as_vec4(&_self).into(); + output + } + /// Component-wise clamping of values, similar to [`u8::clamp`]. + /// Each element in `min` must be less-or-equal to the corresponding element in `max`. + /// # Panics + /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. + fn clamp( + _self: Val, + min: Val, + max: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec4::clamp( + _self.into_inner(), + min.into_inner(), + max.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `==` comparison for each element of + /// `self` and `rhs`. + /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all + /// elements. + fn cmpeq( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec4::cmpeq( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all + /// elements. + fn cmpge( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec4::cmpge( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `>` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all + /// elements. + fn cmpgt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec4::cmpgt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all + /// elements. + fn cmple( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec4::cmple( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `<` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all + /// elements. + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec4::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec4::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Computes the dot product of `self` and `rhs`. + fn dot(_self: Val, rhs: Val) -> u8 { + let output: u8 = bevy::math::U8Vec4::dot(_self.into_inner(), rhs.into_inner()) + .into(); + output + } + /// Returns a vector where every component is the dot product of `self` and `rhs`. + fn dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec4::dot_into_vec( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the product of all elements of `self`. + /// In other words, this computes `self.x * self.y * ..`. + fn element_product(_self: Val) -> u8 { + let output: u8 = bevy::math::U8Vec4::element_product(_self.into_inner()).into(); + output + } + /// Returns the sum of all elements of `self`. + /// In other words, this computes `self.x + self.y + ..`. + fn element_sum(_self: Val) -> u8 { + let output: u8 = bevy::math::U8Vec4::element_sum(_self.into_inner()).into(); + output + } + /// Creates a new vector from an array. + fn from_array(a: [u8; 4]) -> Val { + let output: Val = bevy::math::U8Vec4::from_array(a).into(); + output + } + /// Computes the squared length of `self`. + fn length_squared(_self: Val) -> u8 { + let output: u8 = bevy::math::U8Vec4::length_squared(_self.into_inner()).into(); + output + } + /// Returns a vector containing the maximum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. + fn max( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec4::max( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal maximum of `self`. + /// In other words this computes `max(x, y, ..)`. + fn max_element(_self: Val) -> u8 { + let output: u8 = bevy::math::U8Vec4::max_element(_self.into_inner()).into(); + output + } + /// Returns a vector containing the minimum values for each element of `self` and `rhs`. + /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. + fn min( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec4::min( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns the horizontal minimum of `self`. + /// In other words this computes `min(x, y, ..)`. + fn min_element(_self: Val) -> u8 { + let output: u8 = bevy::math::U8Vec4::min_element(_self.into_inner()).into(); + output + } + /// Creates a new vector. + fn new(x: u8, y: u8, z: u8, w: u8) -> Val { + let output: Val = bevy::math::U8Vec4::new(x, y, z, w).into(); + output + } + /// Returns a vector containing the saturating addition of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. + fn saturating_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec4::saturating_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`. + fn saturating_add_signed( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec4::saturating_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating division of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. + fn saturating_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec4::saturating_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. + fn saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec4::saturating_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the saturating subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. + fn saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec4::saturating_sub( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use + /// for each element of `self`. + /// A true element in the mask uses the corresponding element from `if_true`, and false + /// uses the element from `if_false`. + fn select( + mask: Val, + if_true: Val, + if_false: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec4::select( + mask.into_inner(), + if_true.into_inner(), + if_false.into_inner(), + ) + .into(); + output + } + /// Creates a vector with all elements set to `v`. + fn splat(v: u8) -> Val { + let output: Val = bevy::math::U8Vec4::splat(v).into(); + output + } + /// `[x, y, z, w]` + fn to_array(_self: Ref) -> [u8; 4] { + let output: [u8; 4] = bevy::math::U8Vec4::to_array(&_self).into(); + output + } + /// Creates a 3D vector from the `x`, `y` and `z` elements of `self`, discarding `w`. + /// Truncation to [`U8Vec3`] may also be performed by using [`self.xyz()`][crate::swizzles::Vec4Swizzles::xyz()]. + fn truncate(_self: Val) -> Val { + let output: Val = bevy::math::U8Vec4::truncate( + _self.into_inner(), + ) + .into(); + output + } + /// Creates a 4D vector from `self` with the given value of `w`. + fn with_w(_self: Val, w: u8) -> Val { + let output: Val = bevy::math::U8Vec4::with_w( + _self.into_inner(), + w, + ) + .into(); + output + } + /// Creates a 4D vector from `self` with the given value of `x`. + fn with_x(_self: Val, x: u8) -> Val { + let output: Val = bevy::math::U8Vec4::with_x( + _self.into_inner(), + x, + ) + .into(); + output + } + /// Creates a 4D vector from `self` with the given value of `y`. + fn with_y(_self: Val, y: u8) -> Val { + let output: Val = bevy::math::U8Vec4::with_y( + _self.into_inner(), + y, + ) + .into(); + output + } + /// Creates a 4D vector from `self` with the given value of `z`. + fn with_z(_self: Val, z: u8) -> Val { + let output: Val = bevy::math::U8Vec4::with_z( + _self.into_inner(), + z, + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. + fn wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec4::wrapping_add( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`. + /// In other words this computes `[self.x.wrapping_add_signed(rhs.x), self.y.wrapping_add_signed(rhs.y), ..]`. + fn wrapping_add_signed( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec4::wrapping_add_signed( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping division of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. + fn wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec4::wrapping_div( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. + fn wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec4::wrapping_mul( + _self.into_inner(), + rhs.into_inner(), + ) + .into(); + output + } + /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. + /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. + fn wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U8Vec4::wrapping_sub( _self.into_inner(), rhs.into_inner(), ) @@ -6788,82 +11671,74 @@ impl bevy::math::I64Vec4 { } #[script_bindings( remote, - name = "u_vec_2_functions", + name = "u_16_vec_2_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::math::UVec2 { - fn add( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::add(_self.into_inner(), &rhs) +impl bevy::math::U16Vec2 { + /// Casts all elements of `self` to `f64`. + fn as_dvec2(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec2::as_dvec2(&_self) .into(); output } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + /// Casts all elements of `self` to `i16`. + fn as_i16vec2(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec2::as_i16vec2(&_self) .into(); output } - fn add(_self: Val, rhs: u32) -> Val { - let output: Val = >::add(_self.into_inner(), rhs) + /// Casts all elements of `self` to `i64`. + fn as_i64vec2(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec2::as_i64vec2(&_self) .into(); output } - /// Casts all elements of `self` to `f64`. - fn as_dvec2(_self: Ref) -> Val { - let output: Val = bevy::math::UVec2::as_dvec2(&_self).into(); - output - } - /// Casts all elements of `self` to `i64`. - fn as_i64vec2(_self: Ref) -> Val { - let output: Val = bevy::math::UVec2::as_i64vec2(&_self) + /// Casts all elements of `self` to `i8`. + fn as_i8vec2(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec2::as_i8vec2(&_self) .into(); output } /// Casts all elements of `self` to `i32`. - fn as_ivec2(_self: Ref) -> Val { - let output: Val = bevy::math::UVec2::as_ivec2(&_self).into(); + fn as_ivec2(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec2::as_ivec2(&_self) + .into(); output } /// Casts all elements of `self` to `u64`. - fn as_u64vec2(_self: Ref) -> Val { - let output: Val = bevy::math::UVec2::as_u64vec2(&_self) + fn as_u64vec2(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec2::as_u64vec2(&_self) .into(); output } - /// Casts all elements of `self` to `f32`. - fn as_vec2(_self: Ref) -> Val { - let output: Val = bevy::math::UVec2::as_vec2(&_self).into(); + /// Casts all elements of `self` to `u8`. + fn as_u8vec2(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec2::as_u8vec2(&_self) + .into(); output } - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) + /// Casts all elements of `self` to `u32`. + fn as_uvec2(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec2::as_uvec2(&_self) .into(); output } - /// Component-wise clamping of values, similar to [`u32::clamp`]. + /// Casts all elements of `self` to `f32`. + fn as_vec2(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec2::as_vec2(&_self).into(); + output + } + /// Component-wise clamping of values, similar to [`u16::clamp`]. /// Each element in `min` must be less-or-equal to the corresponding element in `max`. /// # Panics /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( - _self: Val, - min: Val, - max: Val, - ) -> Val { - let output: Val = bevy::math::UVec2::clamp( + _self: Val, + min: Val, + max: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec2::clamp( _self.into_inner(), min.into_inner(), max.into_inner(), @@ -6871,22 +11746,15 @@ impl bevy::math::UVec2 { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns a vector mask containing the result of a `==` comparison for each element of /// `self` and `rhs`. /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all /// elements. fn cmpeq( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::UVec2::cmpeq( + let output: Val = bevy::math::U16Vec2::cmpeq( _self.into_inner(), rhs.into_inner(), ) @@ -6898,10 +11766,10 @@ impl bevy::math::UVec2 { /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all /// elements. fn cmpge( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::UVec2::cmpge( + let output: Val = bevy::math::U16Vec2::cmpge( _self.into_inner(), rhs.into_inner(), ) @@ -6913,10 +11781,10 @@ impl bevy::math::UVec2 { /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all /// elements. fn cmpgt( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::UVec2::cmpgt( + let output: Val = bevy::math::U16Vec2::cmpgt( _self.into_inner(), rhs.into_inner(), ) @@ -6928,10 +11796,10 @@ impl bevy::math::UVec2 { /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all /// elements. fn cmple( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::UVec2::cmple( + let output: Val = bevy::math::U16Vec2::cmple( _self.into_inner(), rhs.into_inner(), ) @@ -6943,10 +11811,10 @@ impl bevy::math::UVec2 { /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all /// elements. fn cmplt( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::UVec2::cmplt( + let output: Val = bevy::math::U16Vec2::cmplt( _self.into_inner(), rhs.into_inner(), ) @@ -6958,55 +11826,28 @@ impl bevy::math::UVec2 { /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all /// elements. fn cmpne( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::UVec2::cmpne( + let output: Val = bevy::math::U16Vec2::cmpne( _self.into_inner(), rhs.into_inner(), ) .into(); output } - fn div( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - } - fn div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn div(_self: Val, rhs: u32) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Computes the dot product of `self` and `rhs`. - fn dot(_self: Val, rhs: Val) -> u32 { - let output: u32 = bevy::math::UVec2::dot(_self.into_inner(), rhs.into_inner()) + fn dot(_self: Val, rhs: Val) -> u16 { + let output: u16 = bevy::math::U16Vec2::dot(_self.into_inner(), rhs.into_inner()) .into(); output } /// Returns a vector where every component is the dot product of `self` and `rhs`. fn dot_into_vec( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec2::dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec2::dot_into_vec( _self.into_inner(), rhs.into_inner(), ) @@ -7015,26 +11856,20 @@ impl bevy::math::UVec2 { } /// Returns the product of all elements of `self`. /// In other words, this computes `self.x * self.y * ..`. - fn element_product(_self: Val) -> u32 { - let output: u32 = bevy::math::UVec2::element_product(_self.into_inner()).into(); + fn element_product(_self: Val) -> u16 { + let output: u16 = bevy::math::U16Vec2::element_product(_self.into_inner()) + .into(); output } /// Returns the sum of all elements of `self`. /// In other words, this computes `self.x + self.y + ..`. - fn element_sum(_self: Val) -> u32 { - let output: u32 = bevy::math::UVec2::element_sum(_self.into_inner()).into(); - output - } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); + fn element_sum(_self: Val) -> u16 { + let output: u16 = bevy::math::U16Vec2::element_sum(_self.into_inner()).into(); output } /// Creates a 3D vector from `self` and the given `z` value. - fn extend(_self: Val, z: u32) -> Val { - let output: Val = bevy::math::UVec2::extend( + fn extend(_self: Val, z: u16) -> Val { + let output: Val = bevy::math::U16Vec2::extend( _self.into_inner(), z, ) @@ -7042,22 +11877,22 @@ impl bevy::math::UVec2 { output } /// Creates a new vector from an array. - fn from_array(a: [u32; 2]) -> Val { - let output: Val = bevy::math::UVec2::from_array(a).into(); + fn from_array(a: [u16; 2]) -> Val { + let output: Val = bevy::math::U16Vec2::from_array(a).into(); output } /// Computes the squared length of `self`. - fn length_squared(_self: Val) -> u32 { - let output: u32 = bevy::math::UVec2::length_squared(_self.into_inner()).into(); + fn length_squared(_self: Val) -> u16 { + let output: u16 = bevy::math::U16Vec2::length_squared(_self.into_inner()).into(); output } /// Returns a vector containing the maximum values for each element of `self` and `rhs`. /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. fn max( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec2::max( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec2::max( _self.into_inner(), rhs.into_inner(), ) @@ -7066,17 +11901,17 @@ impl bevy::math::UVec2 { } /// Returns the horizontal maximum of `self`. /// In other words this computes `max(x, y, ..)`. - fn max_element(_self: Val) -> u32 { - let output: u32 = bevy::math::UVec2::max_element(_self.into_inner()).into(); + fn max_element(_self: Val) -> u16 { + let output: u16 = bevy::math::U16Vec2::max_element(_self.into_inner()).into(); output } /// Returns a vector containing the minimum values for each element of `self` and `rhs`. /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. fn min( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec2::min( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec2::min( _self.into_inner(), rhs.into_inner(), ) @@ -7085,76 +11920,22 @@ impl bevy::math::UVec2 { } /// Returns the horizontal minimum of `self`. /// In other words this computes `min(x, y, ..)`. - fn min_element(_self: Val) -> u32 { - let output: u32 = bevy::math::UVec2::min_element(_self.into_inner()).into(); - output - } - fn mul( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: u32) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); + fn min_element(_self: Val) -> u16 { + let output: u16 = bevy::math::U16Vec2::min_element(_self.into_inner()).into(); output } /// Creates a new vector. - fn new(x: u32, y: u32) -> Val { - let output: Val = bevy::math::UVec2::new(x, y).into(); - output - } - fn rem( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - } - fn rem( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn rem(_self: Val, rhs: u32) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); + fn new(x: u16, y: u16) -> Val { + let output: Val = bevy::math::U16Vec2::new(x, y).into(); output } /// Returns a vector containing the saturating addition of `self` and `rhs`. /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. fn saturating_add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec2::saturating_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec2::saturating_add( _self.into_inner(), rhs.into_inner(), ) @@ -7164,10 +11945,10 @@ impl bevy::math::UVec2 { /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`. /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`. fn saturating_add_signed( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec2::saturating_add_signed( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec2::saturating_add_signed( _self.into_inner(), rhs.into_inner(), ) @@ -7177,10 +11958,10 @@ impl bevy::math::UVec2 { /// Returns a vector containing the saturating division of `self` and `rhs`. /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. fn saturating_div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec2::saturating_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec2::saturating_div( _self.into_inner(), rhs.into_inner(), ) @@ -7190,10 +11971,10 @@ impl bevy::math::UVec2 { /// Returns a vector containing the saturating multiplication of `self` and `rhs`. /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. fn saturating_mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec2::saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec2::saturating_mul( _self.into_inner(), rhs.into_inner(), ) @@ -7203,10 +11984,10 @@ impl bevy::math::UVec2 { /// Returns a vector containing the saturating subtraction of `self` and `rhs`. /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. fn saturating_sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec2::saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec2::saturating_sub( _self.into_inner(), rhs.into_inner(), ) @@ -7219,10 +12000,10 @@ impl bevy::math::UVec2 { /// uses the element from `if_false`. fn select( mask: Val, - if_true: Val, - if_false: Val, - ) -> Val { - let output: Val = bevy::math::UVec2::select( + if_true: Val, + if_false: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec2::select( mask.into_inner(), if_true.into_inner(), if_false.into_inner(), @@ -7231,45 +12012,18 @@ impl bevy::math::UVec2 { output } /// Creates a vector with all elements set to `v`. - fn splat(v: u32) -> Val { - let output: Val = bevy::math::UVec2::splat(v).into(); - output - } - fn sub( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn sub(_self: Val, rhs: u32) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); + fn splat(v: u16) -> Val { + let output: Val = bevy::math::U16Vec2::splat(v).into(); output } /// `[x, y]` - fn to_array(_self: Ref) -> [u32; 2] { - let output: [u32; 2] = bevy::math::UVec2::to_array(&_self).into(); + fn to_array(_self: Ref) -> [u16; 2] { + let output: [u16; 2] = bevy::math::U16Vec2::to_array(&_self).into(); output } /// Creates a 2D vector from `self` with the given value of `x`. - fn with_x(_self: Val, x: u32) -> Val { - let output: Val = bevy::math::UVec2::with_x( + fn with_x(_self: Val, x: u16) -> Val { + let output: Val = bevy::math::U16Vec2::with_x( _self.into_inner(), x, ) @@ -7277,8 +12031,8 @@ impl bevy::math::UVec2 { output } /// Creates a 2D vector from `self` with the given value of `y`. - fn with_y(_self: Val, y: u32) -> Val { - let output: Val = bevy::math::UVec2::with_y( + fn with_y(_self: Val, y: u16) -> Val { + let output: Val = bevy::math::U16Vec2::with_y( _self.into_inner(), y, ) @@ -7288,10 +12042,10 @@ impl bevy::math::UVec2 { /// Returns a vector containing the wrapping addition of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. fn wrapping_add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec2::wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec2::wrapping_add( _self.into_inner(), rhs.into_inner(), ) @@ -7301,10 +12055,10 @@ impl bevy::math::UVec2 { /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`. /// In other words this computes `[self.x.wrapping_add_signed(rhs.x), self.y.wrapping_add_signed(rhs.y), ..]`. fn wrapping_add_signed( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec2::wrapping_add_signed( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec2::wrapping_add_signed( _self.into_inner(), rhs.into_inner(), ) @@ -7314,10 +12068,10 @@ impl bevy::math::UVec2 { /// Returns a vector containing the wrapping division of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. fn wrapping_div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec2::wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec2::wrapping_div( _self.into_inner(), rhs.into_inner(), ) @@ -7327,10 +12081,10 @@ impl bevy::math::UVec2 { /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. fn wrapping_mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec2::wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec2::wrapping_mul( _self.into_inner(), rhs.into_inner(), ) @@ -7340,10 +12094,10 @@ impl bevy::math::UVec2 { /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. fn wrapping_sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec2::wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec2::wrapping_sub( _self.into_inner(), rhs.into_inner(), ) @@ -7353,87 +12107,80 @@ impl bevy::math::UVec2 { } #[script_bindings( remote, - name = "u_vec_3_functions", + name = "u_16_vec_3_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::math::UVec3 { - fn add( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::add(_self.into_inner(), &rhs) +impl bevy::math::U16Vec3 { + /// Casts all elements of `self` to `f64`. + fn as_dvec3(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec3::as_dvec3(&_self) .into(); output } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + /// Casts all elements of `self` to `i16`. + fn as_i16vec3(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec3::as_i16vec3(&_self) .into(); output } - fn add(_self: Val, rhs: u32) -> Val { - let output: Val = >::add(_self.into_inner(), rhs) + /// Casts all elements of `self` to `i64`. + fn as_i64vec3(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec3::as_i64vec3(&_self) .into(); output } - /// Casts all elements of `self` to `f64`. - fn as_dvec3(_self: Ref) -> Val { - let output: Val = bevy::math::UVec3::as_dvec3(&_self).into(); - output - } - /// Casts all elements of `self` to `i64`. - fn as_i64vec3(_self: Ref) -> Val { - let output: Val = bevy::math::UVec3::as_i64vec3(&_self) + /// Casts all elements of `self` to `i8`. + fn as_i8vec3(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec3::as_i8vec3(&_self) .into(); output } /// Casts all elements of `self` to `i32`. - fn as_ivec3(_self: Ref) -> Val { - let output: Val = bevy::math::UVec3::as_ivec3(&_self).into(); + fn as_ivec3(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec3::as_ivec3(&_self) + .into(); output } /// Casts all elements of `self` to `u64`. - fn as_u64vec3(_self: Ref) -> Val { - let output: Val = bevy::math::UVec3::as_u64vec3(&_self) + fn as_u64vec3(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec3::as_u64vec3(&_self) .into(); output } - /// Casts all elements of `self` to `f32`. - fn as_vec3(_self: Ref) -> Val { - let output: Val = bevy::math::UVec3::as_vec3(&_self).into(); + /// Casts all elements of `self` to `u8`. + fn as_u8vec3(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec3::as_u8vec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u32`. + fn as_uvec3(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec3::as_uvec3(&_self) + .into(); output } /// Casts all elements of `self` to `f32`. - fn as_vec3a(_self: Ref) -> Val { - let output: Val = bevy::math::UVec3::as_vec3a(&_self).into(); + fn as_vec3(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec3::as_vec3(&_self).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) + /// Casts all elements of `self` to `f32`. + fn as_vec3a(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec3::as_vec3a(&_self) .into(); output } - /// Component-wise clamping of values, similar to [`u32::clamp`]. + /// Component-wise clamping of values, similar to [`u16::clamp`]. /// Each element in `min` must be less-or-equal to the corresponding element in `max`. /// # Panics /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( - _self: Val, - min: Val, - max: Val, - ) -> Val { - let output: Val = bevy::math::UVec3::clamp( + _self: Val, + min: Val, + max: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec3::clamp( _self.into_inner(), min.into_inner(), max.into_inner(), @@ -7441,22 +12188,15 @@ impl bevy::math::UVec3 { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns a vector mask containing the result of a `==` comparison for each element of /// `self` and `rhs`. /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all /// elements. - fn cmpeq( - _self: Val, - rhs: Val, + fn cmpeq( + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::UVec3::cmpeq( + let output: Val = bevy::math::U16Vec3::cmpeq( _self.into_inner(), rhs.into_inner(), ) @@ -7468,10 +12208,10 @@ impl bevy::math::UVec3 { /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all /// elements. fn cmpge( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::UVec3::cmpge( + let output: Val = bevy::math::U16Vec3::cmpge( _self.into_inner(), rhs.into_inner(), ) @@ -7483,10 +12223,10 @@ impl bevy::math::UVec3 { /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all /// elements. fn cmpgt( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::UVec3::cmpgt( + let output: Val = bevy::math::U16Vec3::cmpgt( _self.into_inner(), rhs.into_inner(), ) @@ -7498,10 +12238,10 @@ impl bevy::math::UVec3 { /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all /// elements. fn cmple( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::UVec3::cmple( + let output: Val = bevy::math::U16Vec3::cmple( _self.into_inner(), rhs.into_inner(), ) @@ -7513,10 +12253,10 @@ impl bevy::math::UVec3 { /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all /// elements. fn cmplt( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::UVec3::cmplt( + let output: Val = bevy::math::U16Vec3::cmplt( _self.into_inner(), rhs.into_inner(), ) @@ -7528,10 +12268,10 @@ impl bevy::math::UVec3 { /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all /// elements. fn cmpne( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::UVec3::cmpne( + let output: Val = bevy::math::U16Vec3::cmpne( _self.into_inner(), rhs.into_inner(), ) @@ -7540,55 +12280,28 @@ impl bevy::math::UVec3 { } /// Computes the cross product of `self` and `rhs`. fn cross( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec3::cross( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec3::cross( _self.into_inner(), rhs.into_inner(), ) .into(); output } - fn div( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - } - fn div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn div(_self: Val, rhs: u32) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Computes the dot product of `self` and `rhs`. - fn dot(_self: Val, rhs: Val) -> u32 { - let output: u32 = bevy::math::UVec3::dot(_self.into_inner(), rhs.into_inner()) + fn dot(_self: Val, rhs: Val) -> u16 { + let output: u16 = bevy::math::U16Vec3::dot(_self.into_inner(), rhs.into_inner()) .into(); output } /// Returns a vector where every component is the dot product of `self` and `rhs`. fn dot_into_vec( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec3::dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec3::dot_into_vec( _self.into_inner(), rhs.into_inner(), ) @@ -7597,26 +12310,20 @@ impl bevy::math::UVec3 { } /// Returns the product of all elements of `self`. /// In other words, this computes `self.x * self.y * ..`. - fn element_product(_self: Val) -> u32 { - let output: u32 = bevy::math::UVec3::element_product(_self.into_inner()).into(); + fn element_product(_self: Val) -> u16 { + let output: u16 = bevy::math::U16Vec3::element_product(_self.into_inner()) + .into(); output } /// Returns the sum of all elements of `self`. /// In other words, this computes `self.x + self.y + ..`. - fn element_sum(_self: Val) -> u32 { - let output: u32 = bevy::math::UVec3::element_sum(_self.into_inner()).into(); - output - } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); + fn element_sum(_self: Val) -> u16 { + let output: u16 = bevy::math::U16Vec3::element_sum(_self.into_inner()).into(); output } /// Creates a 4D vector from `self` and the given `w` value. - fn extend(_self: Val, w: u32) -> Val { - let output: Val = bevy::math::UVec3::extend( + fn extend(_self: Val, w: u16) -> Val { + let output: Val = bevy::math::U16Vec3::extend( _self.into_inner(), w, ) @@ -7624,22 +12331,22 @@ impl bevy::math::UVec3 { output } /// Creates a new vector from an array. - fn from_array(a: [u32; 3]) -> Val { - let output: Val = bevy::math::UVec3::from_array(a).into(); + fn from_array(a: [u16; 3]) -> Val { + let output: Val = bevy::math::U16Vec3::from_array(a).into(); output } /// Computes the squared length of `self`. - fn length_squared(_self: Val) -> u32 { - let output: u32 = bevy::math::UVec3::length_squared(_self.into_inner()).into(); + fn length_squared(_self: Val) -> u16 { + let output: u16 = bevy::math::U16Vec3::length_squared(_self.into_inner()).into(); output } /// Returns a vector containing the maximum values for each element of `self` and `rhs`. /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. fn max( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec3::max( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec3::max( _self.into_inner(), rhs.into_inner(), ) @@ -7648,17 +12355,17 @@ impl bevy::math::UVec3 { } /// Returns the horizontal maximum of `self`. /// In other words this computes `max(x, y, ..)`. - fn max_element(_self: Val) -> u32 { - let output: u32 = bevy::math::UVec3::max_element(_self.into_inner()).into(); + fn max_element(_self: Val) -> u16 { + let output: u16 = bevy::math::U16Vec3::max_element(_self.into_inner()).into(); output } /// Returns a vector containing the minimum values for each element of `self` and `rhs`. /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. fn min( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec3::min( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec3::min( _self.into_inner(), rhs.into_inner(), ) @@ -7667,76 +12374,22 @@ impl bevy::math::UVec3 { } /// Returns the horizontal minimum of `self`. /// In other words this computes `min(x, y, ..)`. - fn min_element(_self: Val) -> u32 { - let output: u32 = bevy::math::UVec3::min_element(_self.into_inner()).into(); - output - } - fn mul( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: u32) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); + fn min_element(_self: Val) -> u16 { + let output: u16 = bevy::math::U16Vec3::min_element(_self.into_inner()).into(); output } /// Creates a new vector. - fn new(x: u32, y: u32, z: u32) -> Val { - let output: Val = bevy::math::UVec3::new(x, y, z).into(); - output - } - fn rem( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - } - fn rem( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn rem(_self: Val, rhs: u32) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); + fn new(x: u16, y: u16, z: u16) -> Val { + let output: Val = bevy::math::U16Vec3::new(x, y, z).into(); output } /// Returns a vector containing the saturating addition of `self` and `rhs`. /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. fn saturating_add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec3::saturating_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec3::saturating_add( _self.into_inner(), rhs.into_inner(), ) @@ -7746,10 +12399,10 @@ impl bevy::math::UVec3 { /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`. /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`. fn saturating_add_signed( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec3::saturating_add_signed( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec3::saturating_add_signed( _self.into_inner(), rhs.into_inner(), ) @@ -7759,10 +12412,10 @@ impl bevy::math::UVec3 { /// Returns a vector containing the saturating division of `self` and `rhs`. /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. fn saturating_div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec3::saturating_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec3::saturating_div( _self.into_inner(), rhs.into_inner(), ) @@ -7772,10 +12425,10 @@ impl bevy::math::UVec3 { /// Returns a vector containing the saturating multiplication of `self` and `rhs`. /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. fn saturating_mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec3::saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec3::saturating_mul( _self.into_inner(), rhs.into_inner(), ) @@ -7785,10 +12438,10 @@ impl bevy::math::UVec3 { /// Returns a vector containing the saturating subtraction of `self` and `rhs`. /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. fn saturating_sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec3::saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec3::saturating_sub( _self.into_inner(), rhs.into_inner(), ) @@ -7801,10 +12454,10 @@ impl bevy::math::UVec3 { /// uses the element from `if_false`. fn select( mask: Val, - if_true: Val, - if_false: Val, - ) -> Val { - let output: Val = bevy::math::UVec3::select( + if_true: Val, + if_false: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec3::select( mask.into_inner(), if_true.into_inner(), if_false.into_inner(), @@ -7813,54 +12466,27 @@ impl bevy::math::UVec3 { output } /// Creates a vector with all elements set to `v`. - fn splat(v: u32) -> Val { - let output: Val = bevy::math::UVec3::splat(v).into(); - output - } - fn sub( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn sub(_self: Val, rhs: u32) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); + fn splat(v: u16) -> Val { + let output: Val = bevy::math::U16Vec3::splat(v).into(); output } /// `[x, y, z]` - fn to_array(_self: Ref) -> [u32; 3] { - let output: [u32; 3] = bevy::math::UVec3::to_array(&_self).into(); + fn to_array(_self: Ref) -> [u16; 3] { + let output: [u16; 3] = bevy::math::U16Vec3::to_array(&_self).into(); output } /// Creates a 2D vector from the `x` and `y` elements of `self`, discarding `z`. /// Truncation may also be performed by using [`self.xy()`][crate::swizzles::Vec3Swizzles::xy()]. - fn truncate(_self: Val) -> Val { - let output: Val = bevy::math::UVec3::truncate( + fn truncate(_self: Val) -> Val { + let output: Val = bevy::math::U16Vec3::truncate( _self.into_inner(), ) .into(); output } /// Creates a 3D vector from `self` with the given value of `x`. - fn with_x(_self: Val, x: u32) -> Val { - let output: Val = bevy::math::UVec3::with_x( + fn with_x(_self: Val, x: u16) -> Val { + let output: Val = bevy::math::U16Vec3::with_x( _self.into_inner(), x, ) @@ -7868,8 +12494,8 @@ impl bevy::math::UVec3 { output } /// Creates a 3D vector from `self` with the given value of `y`. - fn with_y(_self: Val, y: u32) -> Val { - let output: Val = bevy::math::UVec3::with_y( + fn with_y(_self: Val, y: u16) -> Val { + let output: Val = bevy::math::U16Vec3::with_y( _self.into_inner(), y, ) @@ -7877,8 +12503,8 @@ impl bevy::math::UVec3 { output } /// Creates a 3D vector from `self` with the given value of `z`. - fn with_z(_self: Val, z: u32) -> Val { - let output: Val = bevy::math::UVec3::with_z( + fn with_z(_self: Val, z: u16) -> Val { + let output: Val = bevy::math::U16Vec3::with_z( _self.into_inner(), z, ) @@ -7888,10 +12514,10 @@ impl bevy::math::UVec3 { /// Returns a vector containing the wrapping addition of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. fn wrapping_add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec3::wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec3::wrapping_add( _self.into_inner(), rhs.into_inner(), ) @@ -7901,10 +12527,10 @@ impl bevy::math::UVec3 { /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`. /// In other words this computes `[self.x.wrapping_add_signed(rhs.x), self.y.wrapping_add_signed(rhs.y), ..]`. fn wrapping_add_signed( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec3::wrapping_add_signed( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec3::wrapping_add_signed( _self.into_inner(), rhs.into_inner(), ) @@ -7914,10 +12540,10 @@ impl bevy::math::UVec3 { /// Returns a vector containing the wrapping division of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. fn wrapping_div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec3::wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec3::wrapping_div( _self.into_inner(), rhs.into_inner(), ) @@ -7927,10 +12553,10 @@ impl bevy::math::UVec3 { /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. fn wrapping_mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec3::wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec3::wrapping_mul( _self.into_inner(), rhs.into_inner(), ) @@ -7940,10 +12566,10 @@ impl bevy::math::UVec3 { /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. fn wrapping_sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec3::wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec3::wrapping_sub( _self.into_inner(), rhs.into_inner(), ) @@ -7953,82 +12579,74 @@ impl bevy::math::UVec3 { } #[script_bindings( remote, - name = "u_vec_4_functions", + name = "u_16_vec_4_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::math::UVec4 { - fn add( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::add(_self.into_inner(), &rhs) +impl bevy::math::U16Vec4 { + /// Casts all elements of `self` to `f64`. + fn as_dvec4(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec4::as_dvec4(&_self) .into(); output } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) + /// Casts all elements of `self` to `i16`. + fn as_i16vec4(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec4::as_i16vec4(&_self) .into(); output } - fn add(_self: Val, rhs: u32) -> Val { - let output: Val = >::add(_self.into_inner(), rhs) + /// Casts all elements of `self` to `i64`. + fn as_i64vec4(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec4::as_i64vec4(&_self) .into(); output } - /// Casts all elements of `self` to `f64`. - fn as_dvec4(_self: Ref) -> Val { - let output: Val = bevy::math::UVec4::as_dvec4(&_self).into(); - output - } - /// Casts all elements of `self` to `i64`. - fn as_i64vec4(_self: Ref) -> Val { - let output: Val = bevy::math::UVec4::as_i64vec4(&_self) + /// Casts all elements of `self` to `i8`. + fn as_i8vec4(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec4::as_i8vec4(&_self) .into(); output } /// Casts all elements of `self` to `i32`. - fn as_ivec4(_self: Ref) -> Val { - let output: Val = bevy::math::UVec4::as_ivec4(&_self).into(); + fn as_ivec4(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec4::as_ivec4(&_self) + .into(); output } /// Casts all elements of `self` to `u64`. - fn as_u64vec4(_self: Ref) -> Val { - let output: Val = bevy::math::UVec4::as_u64vec4(&_self) + fn as_u64vec4(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec4::as_u64vec4(&_self) .into(); output } - /// Casts all elements of `self` to `f32`. - fn as_vec4(_self: Ref) -> Val { - let output: Val = bevy::math::UVec4::as_vec4(&_self).into(); + /// Casts all elements of `self` to `u8`. + fn as_u8vec4(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec4::as_u8vec4(&_self) + .into(); output } - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) + /// Casts all elements of `self` to `u32`. + fn as_uvec4(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec4::as_uvec4(&_self) .into(); output } - /// Component-wise clamping of values, similar to [`u32::clamp`]. + /// Casts all elements of `self` to `f32`. + fn as_vec4(_self: Ref) -> Val { + let output: Val = bevy::math::U16Vec4::as_vec4(&_self).into(); + output + } + /// Component-wise clamping of values, similar to [`u16::clamp`]. /// Each element in `min` must be less-or-equal to the corresponding element in `max`. /// # Panics /// Will panic if `min` is greater than `max` when `glam_assert` is enabled. fn clamp( - _self: Val, - min: Val, - max: Val, - ) -> Val { - let output: Val = bevy::math::UVec4::clamp( + _self: Val, + min: Val, + max: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec4::clamp( _self.into_inner(), min.into_inner(), max.into_inner(), @@ -8036,22 +12654,15 @@ impl bevy::math::UVec4 { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns a vector mask containing the result of a `==` comparison for each element of /// `self` and `rhs`. /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all /// elements. fn cmpeq( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::UVec4::cmpeq( + let output: Val = bevy::math::U16Vec4::cmpeq( _self.into_inner(), rhs.into_inner(), ) @@ -8063,10 +12674,10 @@ impl bevy::math::UVec4 { /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all /// elements. fn cmpge( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::UVec4::cmpge( + let output: Val = bevy::math::U16Vec4::cmpge( _self.into_inner(), rhs.into_inner(), ) @@ -8078,10 +12689,10 @@ impl bevy::math::UVec4 { /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all /// elements. fn cmpgt( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::UVec4::cmpgt( + let output: Val = bevy::math::U16Vec4::cmpgt( _self.into_inner(), rhs.into_inner(), ) @@ -8093,10 +12704,10 @@ impl bevy::math::UVec4 { /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all /// elements. fn cmple( - _self: Val, - rhs: Val, + _self: Val, + rhs: Val, ) -> Val { - let output: Val = bevy::math::UVec4::cmple( + let output: Val = bevy::math::U16Vec4::cmple( _self.into_inner(), rhs.into_inner(), ) @@ -8107,71 +12718,44 @@ impl bevy::math::UVec4 { /// `self` and `rhs`. /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all /// elements. - fn cmplt( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec4::cmplt( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - } - /// Returns a vector mask containing the result of a `!=` comparison for each element of - /// `self` and `rhs`. - /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all - /// elements. - fn cmpne( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec4::cmpne( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - } - fn div( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - } - fn div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) + fn cmplt( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec4::cmplt( + _self.into_inner(), + rhs.into_inner(), + ) .into(); output } - fn div(_self: Val, rhs: u32) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) + /// Returns a vector mask containing the result of a `!=` comparison for each element of + /// `self` and `rhs`. + /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all + /// elements. + fn cmpne( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec4::cmpne( + _self.into_inner(), + rhs.into_inner(), + ) .into(); output } /// Computes the dot product of `self` and `rhs`. - fn dot(_self: Val, rhs: Val) -> u32 { - let output: u32 = bevy::math::UVec4::dot(_self.into_inner(), rhs.into_inner()) + fn dot(_self: Val, rhs: Val) -> u16 { + let output: u16 = bevy::math::U16Vec4::dot(_self.into_inner(), rhs.into_inner()) .into(); output } /// Returns a vector where every component is the dot product of `self` and `rhs`. fn dot_into_vec( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec4::dot_into_vec( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec4::dot_into_vec( _self.into_inner(), rhs.into_inner(), ) @@ -8180,40 +12764,34 @@ impl bevy::math::UVec4 { } /// Returns the product of all elements of `self`. /// In other words, this computes `self.x * self.y * ..`. - fn element_product(_self: Val) -> u32 { - let output: u32 = bevy::math::UVec4::element_product(_self.into_inner()).into(); + fn element_product(_self: Val) -> u16 { + let output: u16 = bevy::math::U16Vec4::element_product(_self.into_inner()) + .into(); output } /// Returns the sum of all elements of `self`. /// In other words, this computes `self.x + self.y + ..`. - fn element_sum(_self: Val) -> u32 { - let output: u32 = bevy::math::UVec4::element_sum(_self.into_inner()).into(); - output - } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); + fn element_sum(_self: Val) -> u16 { + let output: u16 = bevy::math::U16Vec4::element_sum(_self.into_inner()).into(); output } /// Creates a new vector from an array. - fn from_array(a: [u32; 4]) -> Val { - let output: Val = bevy::math::UVec4::from_array(a).into(); + fn from_array(a: [u16; 4]) -> Val { + let output: Val = bevy::math::U16Vec4::from_array(a).into(); output } /// Computes the squared length of `self`. - fn length_squared(_self: Val) -> u32 { - let output: u32 = bevy::math::UVec4::length_squared(_self.into_inner()).into(); + fn length_squared(_self: Val) -> u16 { + let output: u16 = bevy::math::U16Vec4::length_squared(_self.into_inner()).into(); output } /// Returns a vector containing the maximum values for each element of `self` and `rhs`. /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`. fn max( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec4::max( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec4::max( _self.into_inner(), rhs.into_inner(), ) @@ -8222,17 +12800,17 @@ impl bevy::math::UVec4 { } /// Returns the horizontal maximum of `self`. /// In other words this computes `max(x, y, ..)`. - fn max_element(_self: Val) -> u32 { - let output: u32 = bevy::math::UVec4::max_element(_self.into_inner()).into(); + fn max_element(_self: Val) -> u16 { + let output: u16 = bevy::math::U16Vec4::max_element(_self.into_inner()).into(); output } /// Returns a vector containing the minimum values for each element of `self` and `rhs`. /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`. fn min( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec4::min( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec4::min( _self.into_inner(), rhs.into_inner(), ) @@ -8241,76 +12819,23 @@ impl bevy::math::UVec4 { } /// Returns the horizontal minimum of `self`. /// In other words this computes `min(x, y, ..)`. - fn min_element(_self: Val) -> u32 { - let output: u32 = bevy::math::UVec4::min_element(_self.into_inner()).into(); - output - } - fn mul( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: u32) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); + fn min_element(_self: Val) -> u16 { + let output: u16 = bevy::math::U16Vec4::min_element(_self.into_inner()).into(); output } /// Creates a new vector. - fn new(x: u32, y: u32, z: u32, w: u32) -> Val { - let output: Val = bevy::math::UVec4::new(x, y, z, w).into(); - output - } - fn rem( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - } - fn rem( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn rem(_self: Val, rhs: u32) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs) + fn new(x: u16, y: u16, z: u16, w: u16) -> Val { + let output: Val = bevy::math::U16Vec4::new(x, y, z, w) .into(); output } /// Returns a vector containing the saturating addition of `self` and `rhs`. /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. fn saturating_add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec4::saturating_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec4::saturating_add( _self.into_inner(), rhs.into_inner(), ) @@ -8320,10 +12845,10 @@ impl bevy::math::UVec4 { /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`. /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`. fn saturating_add_signed( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec4::saturating_add_signed( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec4::saturating_add_signed( _self.into_inner(), rhs.into_inner(), ) @@ -8333,10 +12858,10 @@ impl bevy::math::UVec4 { /// Returns a vector containing the saturating division of `self` and `rhs`. /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`. fn saturating_div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec4::saturating_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec4::saturating_div( _self.into_inner(), rhs.into_inner(), ) @@ -8346,10 +12871,10 @@ impl bevy::math::UVec4 { /// Returns a vector containing the saturating multiplication of `self` and `rhs`. /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`. fn saturating_mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec4::saturating_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec4::saturating_mul( _self.into_inner(), rhs.into_inner(), ) @@ -8359,10 +12884,10 @@ impl bevy::math::UVec4 { /// Returns a vector containing the saturating subtraction of `self` and `rhs`. /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`. fn saturating_sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec4::saturating_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec4::saturating_sub( _self.into_inner(), rhs.into_inner(), ) @@ -8375,10 +12900,10 @@ impl bevy::math::UVec4 { /// uses the element from `if_false`. fn select( mask: Val, - if_true: Val, - if_false: Val, - ) -> Val { - let output: Val = bevy::math::UVec4::select( + if_true: Val, + if_false: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec4::select( mask.into_inner(), if_true.into_inner(), if_false.into_inner(), @@ -8387,54 +12912,27 @@ impl bevy::math::UVec4 { output } /// Creates a vector with all elements set to `v`. - fn splat(v: u32) -> Val { - let output: Val = bevy::math::UVec4::splat(v).into(); - output - } - fn sub( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn sub(_self: Val, rhs: u32) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); + fn splat(v: u16) -> Val { + let output: Val = bevy::math::U16Vec4::splat(v).into(); output } /// `[x, y, z, w]` - fn to_array(_self: Ref) -> [u32; 4] { - let output: [u32; 4] = bevy::math::UVec4::to_array(&_self).into(); + fn to_array(_self: Ref) -> [u16; 4] { + let output: [u16; 4] = bevy::math::U16Vec4::to_array(&_self).into(); output } /// Creates a 3D vector from the `x`, `y` and `z` elements of `self`, discarding `w`. - /// Truncation to [`UVec3`] may also be performed by using [`self.xyz()`][crate::swizzles::Vec4Swizzles::xyz()]. - fn truncate(_self: Val) -> Val { - let output: Val = bevy::math::UVec4::truncate( + /// Truncation to [`U16Vec3`] may also be performed by using [`self.xyz()`][crate::swizzles::Vec4Swizzles::xyz()]. + fn truncate(_self: Val) -> Val { + let output: Val = bevy::math::U16Vec4::truncate( _self.into_inner(), ) .into(); output } /// Creates a 4D vector from `self` with the given value of `w`. - fn with_w(_self: Val, w: u32) -> Val { - let output: Val = bevy::math::UVec4::with_w( + fn with_w(_self: Val, w: u16) -> Val { + let output: Val = bevy::math::U16Vec4::with_w( _self.into_inner(), w, ) @@ -8442,8 +12940,8 @@ impl bevy::math::UVec4 { output } /// Creates a 4D vector from `self` with the given value of `x`. - fn with_x(_self: Val, x: u32) -> Val { - let output: Val = bevy::math::UVec4::with_x( + fn with_x(_self: Val, x: u16) -> Val { + let output: Val = bevy::math::U16Vec4::with_x( _self.into_inner(), x, ) @@ -8451,8 +12949,8 @@ impl bevy::math::UVec4 { output } /// Creates a 4D vector from `self` with the given value of `y`. - fn with_y(_self: Val, y: u32) -> Val { - let output: Val = bevy::math::UVec4::with_y( + fn with_y(_self: Val, y: u16) -> Val { + let output: Val = bevy::math::U16Vec4::with_y( _self.into_inner(), y, ) @@ -8460,8 +12958,8 @@ impl bevy::math::UVec4 { output } /// Creates a 4D vector from `self` with the given value of `z`. - fn with_z(_self: Val, z: u32) -> Val { - let output: Val = bevy::math::UVec4::with_z( + fn with_z(_self: Val, z: u16) -> Val { + let output: Val = bevy::math::U16Vec4::with_z( _self.into_inner(), z, ) @@ -8471,10 +12969,10 @@ impl bevy::math::UVec4 { /// Returns a vector containing the wrapping addition of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`. fn wrapping_add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec4::wrapping_add( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec4::wrapping_add( _self.into_inner(), rhs.into_inner(), ) @@ -8484,10 +12982,10 @@ impl bevy::math::UVec4 { /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`. /// In other words this computes `[self.x.wrapping_add_signed(rhs.x), self.y.wrapping_add_signed(rhs.y), ..]`. fn wrapping_add_signed( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec4::wrapping_add_signed( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec4::wrapping_add_signed( _self.into_inner(), rhs.into_inner(), ) @@ -8497,10 +12995,10 @@ impl bevy::math::UVec4 { /// Returns a vector containing the wrapping division of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`. fn wrapping_div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec4::wrapping_div( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec4::wrapping_div( _self.into_inner(), rhs.into_inner(), ) @@ -8510,10 +13008,10 @@ impl bevy::math::UVec4 { /// Returns a vector containing the wrapping multiplication of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`. fn wrapping_mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec4::wrapping_mul( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec4::wrapping_mul( _self.into_inner(), rhs.into_inner(), ) @@ -8523,10 +13021,10 @@ impl bevy::math::UVec4 { /// Returns a vector containing the wrapping subtraction of `self` and `rhs`. /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`. fn wrapping_sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::UVec4::wrapping_sub( + _self: Val, + rhs: Val, + ) -> Val { + let output: Val = bevy::math::U16Vec4::wrapping_sub( _self.into_inner(), rhs.into_inner(), ) @@ -8541,51 +13039,48 @@ impl bevy::math::UVec4 { generated )] impl bevy::math::U64Vec2 { - fn add( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn add(_self: Val, rhs: u64) -> Val { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - } /// Casts all elements of `self` to `f64`. fn as_dvec2(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec2::as_dvec2(&_self) .into(); output } + /// Casts all elements of `self` to `i16`. + fn as_i16vec2(_self: Ref) -> Val { + let output: Val = bevy::math::U64Vec2::as_i16vec2(&_self) + .into(); + output + } /// Casts all elements of `self` to `i64`. fn as_i64vec2(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec2::as_i64vec2(&_self) .into(); output } + /// Casts all elements of `self` to `i8`. + fn as_i8vec2(_self: Ref) -> Val { + let output: Val = bevy::math::U64Vec2::as_i8vec2(&_self) + .into(); + output + } /// Casts all elements of `self` to `i32`. fn as_ivec2(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec2::as_ivec2(&_self) .into(); output } + /// Casts all elements of `self` to `u16`. + fn as_u16vec2(_self: Ref) -> Val { + let output: Val = bevy::math::U64Vec2::as_u16vec2(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u8`. + fn as_u8vec2(_self: Ref) -> Val { + let output: Val = bevy::math::U64Vec2::as_u8vec2(&_self) + .into(); + output + } /// Casts all elements of `self` to `u32`. fn as_uvec2(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec2::as_uvec2(&_self) @@ -8597,13 +13092,6 @@ impl bevy::math::U64Vec2 { let output: Val = bevy::math::U64Vec2::as_vec2(&_self).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } /// Component-wise clamping of values, similar to [`u64::clamp`]. /// Each element in `min` must be less-or-equal to the corresponding element in `max`. /// # Panics @@ -8621,13 +13109,6 @@ impl bevy::math::U64Vec2 { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns a vector mask containing the result of a `==` comparison for each element of /// `self` and `rhs`. /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all @@ -8718,33 +13199,6 @@ impl bevy::math::U64Vec2 { .into(); output } - fn div( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - } - fn div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn div(_self: Val, rhs: u64) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Computes the dot product of `self` and `rhs`. fn dot(_self: Val, rhs: Val) -> u64 { let output: u64 = bevy::math::U64Vec2::dot(_self.into_inner(), rhs.into_inner()) @@ -8776,13 +13230,6 @@ impl bevy::math::U64Vec2 { let output: u64 = bevy::math::U64Vec2::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Creates a 3D vector from `self` and the given `z` value. fn extend(_self: Val, z: u64) -> Val { let output: Val = bevy::math::U64Vec2::extend( @@ -8840,65 +13287,11 @@ impl bevy::math::U64Vec2 { let output: u64 = bevy::math::U64Vec2::min_element(_self.into_inner()).into(); output } - fn mul( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: u64) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } /// Creates a new vector. fn new(x: u64, y: u64) -> Val { let output: Val = bevy::math::U64Vec2::new(x, y).into(); output } - fn rem( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - } - fn rem( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn rem(_self: Val, rhs: u64) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - } /// Returns a vector containing the saturating addition of `self` and `rhs`. /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. fn saturating_add( @@ -8986,33 +13379,6 @@ impl bevy::math::U64Vec2 { let output: Val = bevy::math::U64Vec2::splat(v).into(); output } - fn sub( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn sub(_self: Val, rhs: u64) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - } /// `[x, y]` fn to_array(_self: Ref) -> [u64; 2] { let output: [u64; 2] = bevy::math::U64Vec2::to_array(&_self).into(); @@ -9108,52 +13474,49 @@ impl bevy::math::U64Vec2 { bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::math::U64Vec3 { - fn add( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn add(_self: Val, rhs: u64) -> Val { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - } +impl bevy::math::U64Vec3 { /// Casts all elements of `self` to `f64`. fn as_dvec3(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec3::as_dvec3(&_self) .into(); output } + /// Casts all elements of `self` to `i16`. + fn as_i16vec3(_self: Ref) -> Val { + let output: Val = bevy::math::U64Vec3::as_i16vec3(&_self) + .into(); + output + } /// Casts all elements of `self` to `i64`. fn as_i64vec3(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec3::as_i64vec3(&_self) .into(); output } + /// Casts all elements of `self` to `i8`. + fn as_i8vec3(_self: Ref) -> Val { + let output: Val = bevy::math::U64Vec3::as_i8vec3(&_self) + .into(); + output + } /// Casts all elements of `self` to `i32`. fn as_ivec3(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec3::as_ivec3(&_self) .into(); output } + /// Casts all elements of `self` to `u16`. + fn as_u16vec3(_self: Ref) -> Val { + let output: Val = bevy::math::U64Vec3::as_u16vec3(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u8`. + fn as_u8vec3(_self: Ref) -> Val { + let output: Val = bevy::math::U64Vec3::as_u8vec3(&_self) + .into(); + output + } /// Casts all elements of `self` to `u32`. fn as_uvec3(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec3::as_uvec3(&_self) @@ -9171,13 +13534,6 @@ impl bevy::math::U64Vec3 { .into(); output } - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } /// Component-wise clamping of values, similar to [`u64::clamp`]. /// Each element in `min` must be less-or-equal to the corresponding element in `max`. /// # Panics @@ -9195,13 +13551,6 @@ impl bevy::math::U64Vec3 { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns a vector mask containing the result of a `==` comparison for each element of /// `self` and `rhs`. /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all @@ -9304,33 +13653,6 @@ impl bevy::math::U64Vec3 { .into(); output } - fn div( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - } - fn div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn div(_self: Val, rhs: u64) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Computes the dot product of `self` and `rhs`. fn dot(_self: Val, rhs: Val) -> u64 { let output: u64 = bevy::math::U64Vec3::dot(_self.into_inner(), rhs.into_inner()) @@ -9362,13 +13684,6 @@ impl bevy::math::U64Vec3 { let output: u64 = bevy::math::U64Vec3::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Creates a 4D vector from `self` and the given `w` value. fn extend(_self: Val, w: u64) -> Val { let output: Val = bevy::math::U64Vec3::extend( @@ -9426,65 +13741,11 @@ impl bevy::math::U64Vec3 { let output: u64 = bevy::math::U64Vec3::min_element(_self.into_inner()).into(); output } - fn mul( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: u64) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } /// Creates a new vector. fn new(x: u64, y: u64, z: u64) -> Val { let output: Val = bevy::math::U64Vec3::new(x, y, z).into(); output } - fn rem( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - } - fn rem( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn rem(_self: Val, rhs: u64) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - } /// Returns a vector containing the saturating addition of `self` and `rhs`. /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. fn saturating_add( @@ -9572,33 +13833,6 @@ impl bevy::math::U64Vec3 { let output: Val = bevy::math::U64Vec3::splat(v).into(); output } - fn sub( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn sub(_self: Val, rhs: u64) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - } /// `[x, y, z]` fn to_array(_self: Ref) -> [u64; 3] { let output: [u64; 3] = bevy::math::U64Vec3::to_array(&_self).into(); @@ -9713,51 +13947,48 @@ impl bevy::math::U64Vec3 { generated )] impl bevy::math::U64Vec4 { - fn add( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn add(_self: Val, rhs: u64) -> Val { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - } /// Casts all elements of `self` to `f64`. fn as_dvec4(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec4::as_dvec4(&_self) .into(); output } + /// Casts all elements of `self` to `i16`. + fn as_i16vec4(_self: Ref) -> Val { + let output: Val = bevy::math::U64Vec4::as_i16vec4(&_self) + .into(); + output + } /// Casts all elements of `self` to `i64`. fn as_i64vec4(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec4::as_i64vec4(&_self) .into(); output } + /// Casts all elements of `self` to `i8`. + fn as_i8vec4(_self: Ref) -> Val { + let output: Val = bevy::math::U64Vec4::as_i8vec4(&_self) + .into(); + output + } /// Casts all elements of `self` to `i32`. fn as_ivec4(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec4::as_ivec4(&_self) .into(); output } + /// Casts all elements of `self` to `u16`. + fn as_u16vec4(_self: Ref) -> Val { + let output: Val = bevy::math::U64Vec4::as_u16vec4(&_self) + .into(); + output + } + /// Casts all elements of `self` to `u8`. + fn as_u8vec4(_self: Ref) -> Val { + let output: Val = bevy::math::U64Vec4::as_u8vec4(&_self) + .into(); + output + } /// Casts all elements of `self` to `u32`. fn as_uvec4(_self: Ref) -> Val { let output: Val = bevy::math::U64Vec4::as_uvec4(&_self) @@ -9769,13 +14000,6 @@ impl bevy::math::U64Vec4 { let output: Val = bevy::math::U64Vec4::as_vec4(&_self).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } /// Component-wise clamping of values, similar to [`u64::clamp`]. /// Each element in `min` must be less-or-equal to the corresponding element in `max`. /// # Panics @@ -9793,13 +14017,6 @@ impl bevy::math::U64Vec4 { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns a vector mask containing the result of a `==` comparison for each element of /// `self` and `rhs`. /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all @@ -9890,33 +14107,6 @@ impl bevy::math::U64Vec4 { .into(); output } - fn div( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - } - fn div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn div(_self: Val, rhs: u64) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Computes the dot product of `self` and `rhs`. fn dot(_self: Val, rhs: Val) -> u64 { let output: u64 = bevy::math::U64Vec4::dot(_self.into_inner(), rhs.into_inner()) @@ -9948,13 +14138,6 @@ impl bevy::math::U64Vec4 { let output: u64 = bevy::math::U64Vec4::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Creates a new vector from an array. fn from_array(a: [u64; 4]) -> Val { let output: Val = bevy::math::U64Vec4::from_array(a).into(); @@ -10003,66 +14186,12 @@ impl bevy::math::U64Vec4 { let output: u64 = bevy::math::U64Vec4::min_element(_self.into_inner()).into(); output } - fn mul( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: u64) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } /// Creates a new vector. fn new(x: u64, y: u64, z: u64, w: u64) -> Val { let output: Val = bevy::math::U64Vec4::new(x, y, z, w) .into(); output } - fn rem( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - } - fn rem( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn rem(_self: Val, rhs: u64) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - } /// Returns a vector containing the saturating addition of `self` and `rhs`. /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`. fn saturating_add( @@ -10150,33 +14279,6 @@ impl bevy::math::U64Vec4 { let output: Val = bevy::math::U64Vec4::splat(v).into(); output } - fn sub( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn sub(_self: Val, rhs: u64) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - } /// `[x, y, z, w]` fn to_array(_self: Ref) -> [u64; 4] { let output: [u64; 4] = bevy::math::U64Vec4::to_array(&_self).into(); @@ -10326,33 +14428,6 @@ impl bevy::math::Vec2 { .into(); output } - fn add( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn add(_self: Val, rhs: f32) -> Val { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - } fn angle_between(_self: Val, rhs: Val) -> f32 { let output: f32 = bevy::math::Vec2::angle_between( _self.into_inner(), @@ -10376,23 +14451,45 @@ impl bevy::math::Vec2 { let output: Val = bevy::math::Vec2::as_dvec2(&_self).into(); output } + /// Casts all elements of `self` to `i16`. + fn as_i16vec2(_self: Ref) -> Val { + let output: Val = bevy::math::Vec2::as_i16vec2(&_self) + .into(); + output + } /// Casts all elements of `self` to `i64`. fn as_i64vec2(_self: Ref) -> Val { let output: Val = bevy::math::Vec2::as_i64vec2(&_self) .into(); output } + /// Casts all elements of `self` to `i8`. + fn as_i8vec2(_self: Ref) -> Val { + let output: Val = bevy::math::Vec2::as_i8vec2(&_self).into(); + output + } /// Casts all elements of `self` to `i32`. fn as_ivec2(_self: Ref) -> Val { let output: Val = bevy::math::Vec2::as_ivec2(&_self).into(); output } + /// Casts all elements of `self` to `u16`. + fn as_u16vec2(_self: Ref) -> Val { + let output: Val = bevy::math::Vec2::as_u16vec2(&_self) + .into(); + output + } /// Casts all elements of `self` to `u64`. fn as_u64vec2(_self: Ref) -> Val { let output: Val = bevy::math::Vec2::as_u64vec2(&_self) .into(); output } + /// Casts all elements of `self` to `u8`. + fn as_u8vec2(_self: Ref) -> Val { + let output: Val = bevy::math::Vec2::as_u8vec2(&_self).into(); + output + } /// Casts all elements of `self` to `u32`. fn as_uvec2(_self: Ref) -> Val { let output: Val = bevy::math::Vec2::as_uvec2(&_self).into(); @@ -10466,13 +14563,6 @@ impl bevy::math::Vec2 { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns a vector mask containing the result of a `==` comparison for each element of /// `self` and `rhs`. /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all @@ -10596,33 +14686,6 @@ impl bevy::math::Vec2 { .into(); output } - fn div( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - } - fn div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn div(_self: Val, rhs: f32) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. fn div_euclid( _self: Val, @@ -10665,13 +14728,6 @@ impl bevy::math::Vec2 { let output: f32 = bevy::math::Vec2::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Returns a vector containing `e^self` (the exponential function) for each element of /// `self`. fn exp(_self: Val) -> Val { @@ -10874,33 +14930,6 @@ impl bevy::math::Vec2 { .into(); output } - fn mul( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: f32) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } /// Fused multiply-add. Computes `(self * a) + b` element-wise with only one rounding /// error, yielding a more accurate result than an unfused multiply-add. /// Using `mul_add` *may* be more performant than an unfused multiply-add if the target @@ -10920,13 +14949,6 @@ impl bevy::math::Vec2 { .into(); output } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - } /// Creates a new vector. fn new(x: f32, y: f32) -> Val { let output: Val = bevy::math::Vec2::new(x, y).into(); @@ -11098,33 +15120,6 @@ impl bevy::math::Vec2 { .into(); output } - fn rem( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - } - fn rem( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn rem(_self: Val, rhs: f32) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - } /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. /// [Euclidean division]: f32::rem_euclid fn rem_euclid( @@ -11207,33 +15202,6 @@ impl bevy::math::Vec2 { let output: Val = bevy::math::Vec2::splat(v).into(); output } - fn sub( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn sub(_self: Val, rhs: f32) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - } /// Returns the angle (in radians) of this vector in the range `[-π, +π]`. /// The input does not need to be a unit vector however it must be non-zero. fn to_angle(_self: Val) -> f32 { @@ -11304,33 +15272,6 @@ impl bevy::math::Vec3A { .into(); output } - fn add( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn add(_self: Val, rhs: f32) -> Val { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - } /// Returns the angle (in radians) between two vectors in the range `[0, +π]`. /// The inputs do not need to be unit vectors however they must be non-zero. fn angle_between(_self: Val, rhs: Val) -> f32 { @@ -11368,23 +15309,47 @@ impl bevy::math::Vec3A { let output: Val = bevy::math::Vec3A::as_dvec3(&_self).into(); output } + /// Casts all elements of `self` to `i16`. + fn as_i16vec3(_self: Ref) -> Val { + let output: Val = bevy::math::Vec3A::as_i16vec3(&_self) + .into(); + output + } /// Casts all elements of `self` to `i64`. fn as_i64vec3(_self: Ref) -> Val { let output: Val = bevy::math::Vec3A::as_i64vec3(&_self) .into(); output } + /// Casts all elements of `self` to `i8`. + fn as_i8vec3(_self: Ref) -> Val { + let output: Val = bevy::math::Vec3A::as_i8vec3(&_self) + .into(); + output + } /// Casts all elements of `self` to `i32`. fn as_ivec3(_self: Ref) -> Val { let output: Val = bevy::math::Vec3A::as_ivec3(&_self).into(); output } + /// Casts all elements of `self` to `u16`. + fn as_u16vec3(_self: Ref) -> Val { + let output: Val = bevy::math::Vec3A::as_u16vec3(&_self) + .into(); + output + } /// Casts all elements of `self` to `u64`. fn as_u64vec3(_self: Ref) -> Val { let output: Val = bevy::math::Vec3A::as_u64vec3(&_self) .into(); output } + /// Casts all elements of `self` to `u8`. + fn as_u8vec3(_self: Ref) -> Val { + let output: Val = bevy::math::Vec3A::as_u8vec3(&_self) + .into(); + output + } /// Casts all elements of `self` to `u32`. fn as_uvec3(_self: Ref) -> Val { let output: Val = bevy::math::Vec3A::as_uvec3(&_self).into(); @@ -11458,13 +15423,6 @@ impl bevy::math::Vec3A { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns a vector mask containing the result of a `==` comparison for each element of /// `self` and `rhs`. /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all @@ -11600,33 +15558,6 @@ impl bevy::math::Vec3A { .into(); output } - fn div( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - } - fn div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn div(_self: Val, rhs: f32) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. fn div_euclid( _self: Val, @@ -11669,13 +15600,6 @@ impl bevy::math::Vec3A { let output: f32 = bevy::math::Vec3A::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, rhs: Ref) -> bool { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - } /// Returns a vector containing `e^self` (the exponential function) for each element of /// `self`. fn exp(_self: Val) -> Val { @@ -11877,33 +15801,6 @@ impl bevy::math::Vec3A { .into(); output } - fn mul( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: f32) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } /// Fused multiply-add. Computes `(self * a) + b` element-wise with only one rounding /// error, yielding a more accurate result than an unfused multiply-add. /// Using `mul_add` *may* be more performant than an unfused multiply-add if the target @@ -11923,13 +15820,6 @@ impl bevy::math::Vec3A { .into(); output } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - } /// Creates a new vector. fn new(x: f32, y: f32, z: f32) -> Val { let output: Val = bevy::math::Vec3A::new(x, y, z).into(); @@ -12088,33 +15978,6 @@ impl bevy::math::Vec3A { .into(); output } - fn rem( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - } - fn rem( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn rem(_self: Val, rhs: f32) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - } /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. /// [Euclidean division]: f32::rem_euclid fn rem_euclid( @@ -12168,33 +16031,6 @@ impl bevy::math::Vec3A { let output: Val = bevy::math::Vec3A::splat(v).into(); output } - fn sub( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn sub(_self: Val, rhs: f32) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - } /// `[x, y, z]` fn to_array(_self: Ref) -> [f32; 3] { let output: [f32; 3] = bevy::math::Vec3A::to_array(&_self).into(); @@ -12277,55 +16113,50 @@ impl bevy::math::Vec4 { .into(); output } - fn add( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn add(_self: Val, rhs: f32) -> Val { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - } /// Casts all elements of `self` to `f64`. fn as_dvec4(_self: Ref) -> Val { let output: Val = bevy::math::Vec4::as_dvec4(&_self).into(); output } + /// Casts all elements of `self` to `i16`. + fn as_i16vec4(_self: Ref) -> Val { + let output: Val = bevy::math::Vec4::as_i16vec4(&_self) + .into(); + output + } /// Casts all elements of `self` to `i64`. fn as_i64vec4(_self: Ref) -> Val { let output: Val = bevy::math::Vec4::as_i64vec4(&_self) .into(); output } + /// Casts all elements of `self` to `i8`. + fn as_i8vec4(_self: Ref) -> Val { + let output: Val = bevy::math::Vec4::as_i8vec4(&_self).into(); + output + } /// Casts all elements of `self` to `i32`. fn as_ivec4(_self: Ref) -> Val { let output: Val = bevy::math::Vec4::as_ivec4(&_self).into(); output } + /// Casts all elements of `self` to `u16`. + fn as_u16vec4(_self: Ref) -> Val { + let output: Val = bevy::math::Vec4::as_u16vec4(&_self) + .into(); + output + } /// Casts all elements of `self` to `u64`. fn as_u64vec4(_self: Ref) -> Val { let output: Val = bevy::math::Vec4::as_u64vec4(&_self) .into(); output } + /// Casts all elements of `self` to `u8`. + fn as_u8vec4(_self: Ref) -> Val { + let output: Val = bevy::math::Vec4::as_u8vec4(&_self).into(); + output + } /// Casts all elements of `self` to `u32`. fn as_uvec4(_self: Ref) -> Val { let output: Val = bevy::math::Vec4::as_uvec4(&_self).into(); @@ -12399,13 +16230,6 @@ impl bevy::math::Vec4 { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns a vector mask containing the result of a `==` comparison for each element of /// `self` and `rhs`. /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all @@ -12529,33 +16353,6 @@ impl bevy::math::Vec4 { .into(); output } - fn div( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - } - fn div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn div(_self: Val, rhs: f32) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. fn div_euclid( _self: Val, @@ -12598,13 +16395,6 @@ impl bevy::math::Vec4 { let output: f32 = bevy::math::Vec4::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, rhs: Ref) -> bool { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - } /// Returns a vector containing `e^self` (the exponential function) for each element of /// `self`. fn exp(_self: Val) -> Val { @@ -12790,33 +16580,6 @@ impl bevy::math::Vec4 { .into(); output } - fn mul( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: f32) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } /// Fused multiply-add. Computes `(self * a) + b` element-wise with only one rounding /// error, yielding a more accurate result than an unfused multiply-add. /// Using `mul_add` *may* be more performant than an unfused multiply-add if the target @@ -12836,13 +16599,6 @@ impl bevy::math::Vec4 { .into(); output } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - } /// Creates a new vector. fn new(x: f32, y: f32, z: f32, w: f32) -> Val { let output: Val = bevy::math::Vec4::new(x, y, z, w).into(); @@ -12998,33 +16754,6 @@ impl bevy::math::Vec4 { .into(); output } - fn rem( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - } - fn rem( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn rem(_self: Val, rhs: f32) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - } /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. /// [Euclidean division]: f32::rem_euclid fn rem_euclid( @@ -13076,33 +16805,6 @@ impl bevy::math::Vec4 { let output: Val = bevy::math::Vec4::splat(v).into(); output } - fn sub( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn sub(_self: Val, rhs: f32) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - } /// `[x, y, z, w]` fn to_array(_self: Ref) -> [f32; 4] { let output: [f32; 4] = bevy::math::Vec4::to_array(&_self).into(); @@ -13179,13 +16881,6 @@ impl bevy::math::BVec2 { let output: bool = bevy::math::BVec2::any(_self.into_inner()).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } /// Returns a bitmask with the lowest 2 bits set from the elements of `self`. /// A true element results in a `1` bit and a false element in a `0` bit. Element `x` goes /// into the first lowest bit, element `y` into the second, etc. @@ -13193,20 +16888,6 @@ impl bevy::math::BVec2 { let output: u32 = bevy::math::BVec2::bitmask(_self.into_inner()).into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Creates a new vector mask from a bool array. fn from_array(a: [bool; 2]) -> Val { let output: Val = bevy::math::BVec2::from_array(a).into(); @@ -13252,13 +16933,6 @@ impl bevy::math::BVec3 { let output: bool = bevy::math::BVec3::any(_self.into_inner()).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } /// Returns a bitmask with the lowest 3 bits set from the elements of `self`. /// A true element results in a `1` bit and a false element in a `0` bit. Element `x` goes /// into the first lowest bit, element `y` into the second, etc. @@ -13266,20 +16940,6 @@ impl bevy::math::BVec3 { let output: u32 = bevy::math::BVec3::bitmask(_self.into_inner()).into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Creates a new vector mask from a bool array. fn from_array(a: [bool; 3]) -> Val { let output: Val = bevy::math::BVec3::from_array(a).into(); @@ -13325,13 +16985,6 @@ impl bevy::math::BVec4 { let output: bool = bevy::math::BVec4::any(_self.into_inner()).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } /// Returns a bitmask with the lowest 4 bits set from the elements of `self`. /// A true element results in a `1` bit and a false element in a `0` bit. Element `x` goes /// into the first lowest bit, element `y` into the second, etc. @@ -13339,20 +16992,6 @@ impl bevy::math::BVec4 { let output: u32 = bevy::math::BVec4::bitmask(_self.into_inner()).into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Creates a new vector mask from a bool array. fn from_array(a: [bool; 4]) -> Val { let output: Val = bevy::math::BVec4::from_array(a).into(); @@ -13414,33 +17053,6 @@ impl bevy::math::DVec2 { .into(); output } - fn add( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn add(_self: Val, rhs: f64) -> Val { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - } fn angle_between(_self: Val, rhs: Val) -> f64 { let output: f64 = bevy::math::DVec2::angle_between( _self.into_inner(), @@ -13459,23 +17071,47 @@ impl bevy::math::DVec2 { .into(); output } + /// Casts all elements of `self` to `i16`. + fn as_i16vec2(_self: Ref) -> Val { + let output: Val = bevy::math::DVec2::as_i16vec2(&_self) + .into(); + output + } /// Casts all elements of `self` to `i64`. fn as_i64vec2(_self: Ref) -> Val { let output: Val = bevy::math::DVec2::as_i64vec2(&_self) .into(); output } + /// Casts all elements of `self` to `i8`. + fn as_i8vec2(_self: Ref) -> Val { + let output: Val = bevy::math::DVec2::as_i8vec2(&_self) + .into(); + output + } /// Casts all elements of `self` to `i32`. fn as_ivec2(_self: Ref) -> Val { let output: Val = bevy::math::DVec2::as_ivec2(&_self).into(); output } + /// Casts all elements of `self` to `u16`. + fn as_u16vec2(_self: Ref) -> Val { + let output: Val = bevy::math::DVec2::as_u16vec2(&_self) + .into(); + output + } /// Casts all elements of `self` to `u64`. fn as_u64vec2(_self: Ref) -> Val { let output: Val = bevy::math::DVec2::as_u64vec2(&_self) .into(); output } + /// Casts all elements of `self` to `u8`. + fn as_u8vec2(_self: Ref) -> Val { + let output: Val = bevy::math::DVec2::as_u8vec2(&_self) + .into(); + output + } /// Casts all elements of `self` to `u32`. fn as_uvec2(_self: Ref) -> Val { let output: Val = bevy::math::DVec2::as_uvec2(&_self).into(); @@ -13554,13 +17190,6 @@ impl bevy::math::DVec2 { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns a vector mask containing the result of a `==` comparison for each element of /// `self` and `rhs`. /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all @@ -13684,33 +17313,6 @@ impl bevy::math::DVec2 { .into(); output } - fn div( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - } - fn div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn div(_self: Val, rhs: f64) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. fn div_euclid( _self: Val, @@ -13753,13 +17355,6 @@ impl bevy::math::DVec2 { let output: f64 = bevy::math::DVec2::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Returns a vector containing `e^self` (the exponential function) for each element of /// `self`. fn exp(_self: Val) -> Val { @@ -13962,33 +17557,6 @@ impl bevy::math::DVec2 { .into(); output } - fn mul( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: f64) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } /// Fused multiply-add. Computes `(self * a) + b` element-wise with only one rounding /// error, yielding a more accurate result than an unfused multiply-add. /// Using `mul_add` *may* be more performant than an unfused multiply-add if the target @@ -14008,13 +17576,6 @@ impl bevy::math::DVec2 { .into(); output } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - } /// Creates a new vector. fn new(x: f64, y: f64) -> Val { let output: Val = bevy::math::DVec2::new(x, y).into(); @@ -14189,33 +17750,6 @@ impl bevy::math::DVec2 { .into(); output } - fn rem( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - } - fn rem( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn rem(_self: Val, rhs: f64) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - } /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. /// [Euclidean division]: f64::rem_euclid fn rem_euclid( @@ -14300,33 +17834,6 @@ impl bevy::math::DVec2 { let output: Val = bevy::math::DVec2::splat(v).into(); output } - fn sub( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn sub(_self: Val, rhs: f64) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - } /// Returns the angle (in radians) of this vector in the range `[-π, +π]`. /// The input does not need to be a unit vector however it must be non-zero. fn to_angle(_self: Val) -> f64 { @@ -14397,33 +17904,6 @@ impl bevy::math::DVec3 { .into(); output } - fn add( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn add(_self: Val, rhs: f64) -> Val { - let output: Val = >::add(_self.into_inner(), rhs) - .into(); - output - } /// Returns the angle (in radians) between two vectors in the range `[0, +π]`. /// The inputs do not need to be unit vectors however they must be non-zero. fn angle_between(_self: Val, rhs: Val) -> f64 { @@ -14456,23 +17936,47 @@ impl bevy::math::DVec3 { .into(); output } + /// Casts all elements of `self` to `i16`. + fn as_i16vec3(_self: Ref) -> Val { + let output: Val = bevy::math::DVec3::as_i16vec3(&_self) + .into(); + output + } /// Casts all elements of `self` to `i64`. fn as_i64vec3(_self: Ref) -> Val { let output: Val = bevy::math::DVec3::as_i64vec3(&_self) .into(); output } + /// Casts all elements of `self` to `i8`. + fn as_i8vec3(_self: Ref) -> Val { + let output: Val = bevy::math::DVec3::as_i8vec3(&_self) + .into(); + output + } /// Casts all elements of `self` to `i32`. fn as_ivec3(_self: Ref) -> Val { let output: Val = bevy::math::DVec3::as_ivec3(&_self).into(); output } + /// Casts all elements of `self` to `u16`. + fn as_u16vec3(_self: Ref) -> Val { + let output: Val = bevy::math::DVec3::as_u16vec3(&_self) + .into(); + output + } /// Casts all elements of `self` to `u64`. fn as_u64vec3(_self: Ref) -> Val { let output: Val = bevy::math::DVec3::as_u64vec3(&_self) .into(); output } + /// Casts all elements of `self` to `u8`. + fn as_u8vec3(_self: Ref) -> Val { + let output: Val = bevy::math::DVec3::as_u8vec3(&_self) + .into(); + output + } /// Casts all elements of `self` to `u32`. fn as_uvec3(_self: Ref) -> Val { let output: Val = bevy::math::DVec3::as_uvec3(&_self).into(); @@ -14556,13 +18060,6 @@ impl bevy::math::DVec3 { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns a vector mask containing the result of a `==` comparison for each element of /// `self` and `rhs`. /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all @@ -14698,33 +18195,6 @@ impl bevy::math::DVec3 { .into(); output } - fn div( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - } - fn div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn div(_self: Val, rhs: f64) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. fn div_euclid( _self: Val, @@ -14767,13 +18237,6 @@ impl bevy::math::DVec3 { let output: f64 = bevy::math::DVec3::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Returns a vector containing `e^self` (the exponential function) for each element of /// `self`. fn exp(_self: Val) -> Val { @@ -14968,33 +18431,6 @@ impl bevy::math::DVec3 { .into(); output } - fn mul( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: f64) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } /// Fused multiply-add. Computes `(self * a) + b` element-wise with only one rounding /// error, yielding a more accurate result than an unfused multiply-add. /// Using `mul_add` *may* be more performant than an unfused multiply-add if the target @@ -15014,13 +18450,6 @@ impl bevy::math::DVec3 { .into(); output } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - } /// Creates a new vector. fn new(x: f64, y: f64, z: f64) -> Val { let output: Val = bevy::math::DVec3::new(x, y, z).into(); @@ -15179,33 +18608,6 @@ impl bevy::math::DVec3 { .into(); output } - fn rem( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - } - fn rem( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn rem(_self: Val, rhs: f64) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs) - .into(); - output - } /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. /// [Euclidean division]: f64::rem_euclid fn rem_euclid( @@ -15259,33 +18661,6 @@ impl bevy::math::DVec3 { let output: Val = bevy::math::DVec3::splat(v).into(); output } - fn sub( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn sub(_self: Val, rhs: f64) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - } /// `[x, y, z]` fn to_array(_self: Ref) -> [f64; 3] { let output: [f64; 3] = bevy::math::DVec3::to_array(&_self).into(); @@ -15368,30 +18743,9 @@ impl bevy::math::DVec4 { .into(); output } - fn add( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::add(_self.into_inner(), &rhs) - .into(); - output - } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn add(_self: Val, rhs: f64) -> Val { - let output: Val = >::add(_self.into_inner(), rhs) + /// Casts all elements of `self` to `i16`. + fn as_i16vec4(_self: Ref) -> Val { + let output: Val = bevy::math::DVec4::as_i16vec4(&_self) .into(); output } @@ -15401,17 +18755,35 @@ impl bevy::math::DVec4 { .into(); output } + /// Casts all elements of `self` to `i8`. + fn as_i8vec4(_self: Ref) -> Val { + let output: Val = bevy::math::DVec4::as_i8vec4(&_self) + .into(); + output + } /// Casts all elements of `self` to `i32`. fn as_ivec4(_self: Ref) -> Val { let output: Val = bevy::math::DVec4::as_ivec4(&_self).into(); output } + /// Casts all elements of `self` to `u16`. + fn as_u16vec4(_self: Ref) -> Val { + let output: Val = bevy::math::DVec4::as_u16vec4(&_self) + .into(); + output + } /// Casts all elements of `self` to `u64`. fn as_u64vec4(_self: Ref) -> Val { let output: Val = bevy::math::DVec4::as_u64vec4(&_self) .into(); output } + /// Casts all elements of `self` to `u8`. + fn as_u8vec4(_self: Ref) -> Val { + let output: Val = bevy::math::DVec4::as_u8vec4(&_self) + .into(); + output + } /// Casts all elements of `self` to `u32`. fn as_uvec4(_self: Ref) -> Val { let output: Val = bevy::math::DVec4::as_uvec4(&_self).into(); @@ -15490,13 +18862,6 @@ impl bevy::math::DVec4 { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns a vector mask containing the result of a `==` comparison for each element of /// `self` and `rhs`. /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all @@ -15620,33 +18985,6 @@ impl bevy::math::DVec4 { .into(); output } - fn div( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::div(_self.into_inner(), &rhs) - .into(); - output - } - fn div( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::div(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn div(_self: Val, rhs: f64) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`. fn div_euclid( _self: Val, @@ -15689,13 +19027,6 @@ impl bevy::math::DVec4 { let output: f64 = bevy::math::DVec4::element_sum(_self.into_inner()).into(); output } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Returns a vector containing `e^self` (the exponential function) for each element of /// `self`. fn exp(_self: Val) -> Val { @@ -15881,33 +19212,6 @@ impl bevy::math::DVec4 { .into(); output } - fn mul( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), &rhs) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: f64) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } /// Fused multiply-add. Computes `(self * a) + b` element-wise with only one rounding /// error, yielding a more accurate result than an unfused multiply-add. /// Using `mul_add` *may* be more performant than an unfused multiply-add if the target @@ -15927,13 +19231,6 @@ impl bevy::math::DVec4 { .into(); output } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - } /// Creates a new vector. fn new(x: f64, y: f64, z: f64, w: f64) -> Val { let output: Val = bevy::math::DVec4::new(x, y, z, w).into(); @@ -16077,45 +19374,18 @@ impl bevy::math::DVec4 { } /// Returns the vector rejection of `self` from `rhs`. /// The vector rejection is the vector perpendicular to the projection of `self` onto - /// `rhs`, in rhs words the result of `self - self.project_onto(rhs)`. - /// `rhs` must be normalized. - /// # Panics - /// Will panic if `rhs` is not normalized when `glam_assert` is enabled. - fn reject_from_normalized( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = bevy::math::DVec4::reject_from_normalized( - _self.into_inner(), - rhs.into_inner(), - ) - .into(); - output - } - fn rem( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::rem(_self.into_inner(), &rhs) - .into(); - output - } - fn rem( + /// `rhs`, in rhs words the result of `self - self.project_onto(rhs)`. + /// `rhs` must be normalized. + /// # Panics + /// Will panic if `rhs` is not normalized when `glam_assert` is enabled. + fn reject_from_normalized( _self: Val, rhs: Val, ) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn rem(_self: Val, rhs: f64) -> Val { - let output: Val = >::rem(_self.into_inner(), rhs) + let output: Val = bevy::math::DVec4::reject_from_normalized( + _self.into_inner(), + rhs.into_inner(), + ) .into(); output } @@ -16172,33 +19442,6 @@ impl bevy::math::DVec4 { let output: Val = bevy::math::DVec4::splat(v).into(); output } - fn sub( - _self: Val, - rhs: Ref, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), &rhs) - .into(); - output - } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn sub(_self: Val, rhs: f64) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs) - .into(); - output - } /// `[x, y, z, w]` fn to_array(_self: Ref) -> [f64; 4] { let output: [f64; 4] = bevy::math::DVec4::to_array(&_self).into(); @@ -16289,16 +19532,6 @@ impl bevy::math::Mat2 { .into(); output } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Adds two 2x2 matrices. fn add_mat2( _self: Ref, @@ -16312,13 +19545,6 @@ impl bevy::math::Mat2 { let output: Val = bevy::math::Mat2::as_dmat2(&_self).into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns the matrix column for the given `index`. /// # Panics /// Panics if `index` is greater than 1. @@ -16331,26 +19557,12 @@ impl bevy::math::Mat2 { let output: f32 = bevy::math::Mat2::determinant(&_self).into(); output } - fn div(_self: Val, rhs: f32) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Divides a 2x2 matrix by a scalar. fn div_scalar(_self: Ref, rhs: f32) -> Val { let output: Val = bevy::math::Mat2::div_scalar(&_self, rhs) .into(); output } - fn eq(_self: Ref, rhs: Ref) -> bool { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - } /// Creates a 2x2 matrix containing a rotation of `angle` (in radians). fn from_angle(angle: f32) -> Val { let output: Val = bevy::math::Mat2::from_angle(angle).into(); @@ -16454,33 +19666,6 @@ impl bevy::math::Mat2 { let output: bool = bevy::math::Mat2::is_nan(&_self).into(); output } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: f32) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } /// Multiplies two 2x2 matrices. fn mul_mat2( _self: Ref, @@ -16508,13 +19693,6 @@ impl bevy::math::Mat2 { .into(); output } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - } /// Returns the matrix row for the given `index`. /// # Panics /// Panics if `index` is greater than 1. @@ -16522,16 +19700,6 @@ impl bevy::math::Mat2 { let output: Val = bevy::math::Mat2::row(&_self, index).into(); output } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Subtracts two 2x2 matrices. fn sub_mat2( _self: Ref, @@ -16591,16 +19759,6 @@ impl bevy::math::Mat3 { .into(); output } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Adds two 3x3 matrices. fn add_mat3( _self: Ref, @@ -16614,13 +19772,6 @@ impl bevy::math::Mat3 { let output: Val = bevy::math::Mat3::as_dmat3(&_self).into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns the matrix column for the given `index`. /// # Panics /// Panics if `index` is greater than 2. @@ -16633,26 +19784,12 @@ impl bevy::math::Mat3 { let output: f32 = bevy::math::Mat3::determinant(&_self).into(); output } - fn div(_self: Val, rhs: f32) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Divides a 3x3 matrix by a scalar. fn div_scalar(_self: Ref, rhs: f32) -> Val { let output: Val = bevy::math::Mat3::div_scalar(&_self, rhs) .into(); output } - fn eq(_self: Ref, rhs: Ref) -> bool { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - } /// Creates an affine transformation matrix from the given 2D rotation `angle` (in /// radians). /// The resulting matrix can be used to transform 2D points and vectors. See @@ -16832,53 +19969,6 @@ impl bevy::math::Mat3 { let output: bool = bevy::math::Mat3::is_nan(&_self).into(); output } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: f32) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } /// Multiplies two 3x3 matrices. fn mul_mat3( _self: Ref, @@ -16918,13 +20008,6 @@ impl bevy::math::Mat3 { .into(); output } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - } /// Returns the matrix row for the given `index`. /// # Panics /// Panics if `index` is greater than 2. @@ -16932,16 +20015,6 @@ impl bevy::math::Mat3 { let output: Val = bevy::math::Mat3::row(&_self, index).into(); output } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Subtracts two 3x3 matrices. fn sub_mat3( _self: Ref, @@ -17049,16 +20122,6 @@ impl bevy::math::Mat3A { .into(); output } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Adds two 3x3 matrices. fn add_mat3( _self: Ref, @@ -17072,13 +20135,6 @@ impl bevy::math::Mat3A { let output: Val = bevy::math::Mat3A::as_dmat3(&_self).into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns the matrix column for the given `index`. /// # Panics /// Panics if `index` is greater than 2. @@ -17092,26 +20148,12 @@ impl bevy::math::Mat3A { let output: f32 = bevy::math::Mat3A::determinant(&_self).into(); output } - fn div(_self: Val, rhs: f32) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Divides a 3x3 matrix by a scalar. fn div_scalar(_self: Ref, rhs: f32) -> Val { let output: Val = bevy::math::Mat3A::div_scalar(&_self, rhs) .into(); output } - fn eq(_self: Ref, rhs: Ref) -> bool { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - } /// Creates an affine transformation matrix from the given 2D rotation `angle` (in /// radians). /// The resulting matrix can be used to transform 2D points and vectors. See @@ -17291,53 +20333,6 @@ impl bevy::math::Mat3A { let output: bool = bevy::math::Mat3A::is_nan(&_self).into(); output } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: f32) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } /// Multiplies two 3x3 matrices. fn mul_mat3( _self: Ref, @@ -17377,13 +20372,6 @@ impl bevy::math::Mat3A { .into(); output } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - } /// Returns the matrix row for the given `index`. /// # Panics /// Panics if `index` is greater than 2. @@ -17392,16 +20380,6 @@ impl bevy::math::Mat3A { .into(); output } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Subtracts two 3x3 matrices. fn sub_mat3( _self: Ref, @@ -17509,16 +20487,6 @@ impl bevy::math::Mat4 { .into(); output } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Adds two 4x4 matrices. fn add_mat4( _self: Ref, @@ -17532,13 +20500,6 @@ impl bevy::math::Mat4 { let output: Val = bevy::math::Mat4::as_dmat4(&_self).into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns the matrix column for the given `index`. /// # Panics /// Panics if `index` is greater than 3. @@ -17551,26 +20512,12 @@ impl bevy::math::Mat4 { let output: f32 = bevy::math::Mat4::determinant(&_self).into(); output } - fn div(_self: Val, rhs: f32) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Divides a 4x4 matrix by a scalar. fn div_scalar(_self: Ref, rhs: f32) -> Val { let output: Val = bevy::math::Mat4::div_scalar(&_self, rhs) .into(); output } - fn eq(_self: Ref, rhs: Ref) -> bool { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - } /// Creates an affine transformation matrix containing a 3D rotation around a normalized /// rotation `axis` of `angle` (in radians). /// The resulting matrix can be used to transform 3D points and vectors. See @@ -17832,43 +20779,6 @@ impl bevy::math::Mat4 { .into(); output } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: f32) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } /// Multiplies two 4x4 matrices. fn mul_mat4( _self: Ref, @@ -17896,13 +20806,6 @@ impl bevy::math::Mat4 { .into(); output } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - } /// Creates a left-handed orthographic projection matrix with `[0,1]` depth range. /// Useful to map a left-handed coordinate system to the normalized device coordinates that WebGPU/Direct3D/Metal expect. fn orthographic_lh( @@ -18137,16 +21040,6 @@ impl bevy::math::Mat4 { let output: Val = bevy::math::Mat4::row(&_self, index).into(); output } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Subtracts two 4x4 matrices. fn sub_mat4( _self: Ref, @@ -18285,16 +21178,6 @@ impl bevy::math::DMat2 { .into(); output } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Adds two 2x2 matrices. fn add_mat2( _self: Ref, @@ -18308,13 +21191,6 @@ impl bevy::math::DMat2 { let output: Val = bevy::math::DMat2::as_mat2(&_self).into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns the matrix column for the given `index`. /// # Panics /// Panics if `index` is greater than 1. @@ -18328,26 +21204,12 @@ impl bevy::math::DMat2 { let output: f64 = bevy::math::DMat2::determinant(&_self).into(); output } - fn div(_self: Val, rhs: f64) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Divides a 2x2 matrix by a scalar. fn div_scalar(_self: Ref, rhs: f64) -> Val { let output: Val = bevy::math::DMat2::div_scalar(&_self, rhs) .into(); output } - fn eq(_self: Ref, rhs: Ref) -> bool { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - } /// Creates a 2x2 matrix containing a rotation of `angle` (in radians). fn from_angle(angle: f64) -> Val { let output: Val = bevy::math::DMat2::from_angle(angle).into(); @@ -18428,33 +21290,6 @@ impl bevy::math::DMat2 { let output: bool = bevy::math::DMat2::is_nan(&_self).into(); output } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: f64) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } /// Multiplies two 2x2 matrices. fn mul_mat2( _self: Ref, @@ -18482,13 +21317,6 @@ impl bevy::math::DMat2 { .into(); output } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - } /// Returns the matrix row for the given `index`. /// # Panics /// Panics if `index` is greater than 1. @@ -18497,16 +21325,6 @@ impl bevy::math::DMat2 { .into(); output } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Subtracts two 2x2 matrices. fn sub_mat2( _self: Ref, @@ -18566,16 +21384,6 @@ impl bevy::math::DMat3 { .into(); output } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Adds two 3x3 matrices. fn add_mat3( _self: Ref, @@ -18589,13 +21397,6 @@ impl bevy::math::DMat3 { let output: Val = bevy::math::DMat3::as_mat3(&_self).into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns the matrix column for the given `index`. /// # Panics /// Panics if `index` is greater than 2. @@ -18609,26 +21410,12 @@ impl bevy::math::DMat3 { let output: f64 = bevy::math::DMat3::determinant(&_self).into(); output } - fn div(_self: Val, rhs: f64) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Divides a 3x3 matrix by a scalar. fn div_scalar(_self: Ref, rhs: f64) -> Val { let output: Val = bevy::math::DMat3::div_scalar(&_self, rhs) .into(); output } - fn eq(_self: Ref, rhs: Ref) -> bool { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - } /// Creates an affine transformation matrix from the given 2D rotation `angle` (in /// radians). /// The resulting matrix can be used to transform 2D points and vectors. See @@ -18808,43 +21595,6 @@ impl bevy::math::DMat3 { let output: bool = bevy::math::DMat3::is_nan(&_self).into(); output } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: f64) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } /// Multiplies two 3x3 matrices. fn mul_mat3( _self: Ref, @@ -18872,13 +21622,6 @@ impl bevy::math::DMat3 { .into(); output } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - } /// Returns the matrix row for the given `index`. /// # Panics /// Panics if `index` is greater than 2. @@ -18887,16 +21630,6 @@ impl bevy::math::DMat3 { .into(); output } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Subtracts two 3x3 matrices. fn sub_mat3( _self: Ref, @@ -19004,16 +21737,6 @@ impl bevy::math::DMat4 { .into(); output } - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Adds two 4x4 matrices. fn add_mat4( _self: Ref, @@ -19027,13 +21750,6 @@ impl bevy::math::DMat4 { let output: Val = bevy::math::DMat4::as_mat4(&_self).into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns the matrix column for the given `index`. /// # Panics /// Panics if `index` is greater than 3. @@ -19047,26 +21763,12 @@ impl bevy::math::DMat4 { let output: f64 = bevy::math::DMat4::determinant(&_self).into(); output } - fn div(_self: Val, rhs: f64) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Divides a 4x4 matrix by a scalar. fn div_scalar(_self: Ref, rhs: f64) -> Val { let output: Val = bevy::math::DMat4::div_scalar(&_self, rhs) .into(); output } - fn eq(_self: Ref, rhs: Ref) -> bool { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - } /// Creates an affine transformation matrix containing a 3D rotation around a normalized /// rotation `axis` of `angle` (in radians). /// The resulting matrix can be used to transform 3D points and vectors. See @@ -19319,43 +22021,6 @@ impl bevy::math::DMat4 { .into(); output } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul(_self: Val, rhs: f64) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } /// Multiplies two 4x4 matrices. fn mul_mat4( _self: Ref, @@ -19383,13 +22048,6 @@ impl bevy::math::DMat4 { .into(); output } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - } /// Creates a left-handed orthographic projection matrix with `[0,1]` depth range. /// Useful to map a left-handed coordinate system to the normalized device coordinates that WebGPU/Direct3D/Metal expect. fn orthographic_lh( @@ -19610,16 +22268,6 @@ impl bevy::math::DMat4 { .into(); output } - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Subtracts two 4x4 matrices. fn sub_mat4( _self: Ref, @@ -19727,20 +22375,6 @@ impl bevy::math::Affine2 { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq(_self: Ref, rhs: Ref) -> bool { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - } /// Creates an affine transform from the given rotation `angle`. fn from_angle(angle: f32) -> Val { let output: Val = bevy::math::Affine2::from_angle(angle) @@ -19867,36 +22501,6 @@ impl bevy::math::Affine2 { let output: bool = bevy::math::Affine2::is_nan(&_self).into(); output } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Creates a `[f32; 6]` array storing data in column major order. fn to_cols_array(_self: Ref) -> [f32; 6] { let output: [f32; 6] = bevy::math::Affine2::to_cols_array(&_self).into(); @@ -19963,20 +22567,6 @@ impl bevy::math::Affine3A { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq(_self: Ref, rhs: Ref) -> bool { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - } /// Creates an affine transform containing a 3D rotation around a normalized /// rotation `axis` of `angle` (in radians). fn from_axis_angle( @@ -20209,26 +22799,6 @@ impl bevy::math::Affine3A { .into(); output } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Creates a `[f32; 12]` array storing data in column major order. fn to_cols_array(_self: Ref) -> [f32; 12] { let output: [f32; 12] = bevy::math::Affine3A::to_cols_array(&_self).into(); @@ -20322,20 +22892,6 @@ impl bevy::math::DAffine2 { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq(_self: Ref, rhs: Ref) -> bool { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - } /// Creates an affine transform from the given rotation `angle`. fn from_angle(angle: f64) -> Val { let output: Val = bevy::math::DAffine2::from_angle(angle) @@ -20456,26 +23012,6 @@ impl bevy::math::DAffine2 { let output: bool = bevy::math::DAffine2::is_nan(&_self).into(); output } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Creates a `[f64; 6]` array storing data in column major order. fn to_cols_array(_self: Ref) -> [f64; 6] { let output: [f64; 6] = bevy::math::DAffine2::to_cols_array(&_self).into(); @@ -20543,20 +23079,6 @@ impl bevy::math::DAffine3 { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq(_self: Ref, rhs: Ref) -> bool { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - } /// Creates an affine transform containing a 3D rotation around a normalized /// rotation `axis` of `angle` (in radians). fn from_axis_angle( @@ -20789,26 +23311,6 @@ impl bevy::math::DAffine3 { .into(); output } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Creates a `[f64; 12]` array storing data in column major order. fn to_cols_array(_self: Ref) -> [f64; 12] { let output: [f64; 12] = bevy::math::DAffine3::to_cols_array(&_self).into(); @@ -20876,20 +23378,6 @@ impl bevy::math::DQuat { .into(); output } - /// Adds two quaternions. - /// The sum is not guaranteed to be normalized. - /// Note that addition is not the same as combining the rotations represented by the - /// two quaternions! That corresponds to multiplication. - fn add( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::add(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// Returns the angle (in radians) for the minimal rotation /// for transforming this quaternion into another. /// Both quaternions must be normalized. @@ -20910,13 +23398,6 @@ impl bevy::math::DQuat { .into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns the quaternion conjugate of `self`. For a unit quaternion the /// conjugate is also the inverse. fn conjugate(_self: Val) -> Val { @@ -20926,15 +23407,6 @@ impl bevy::math::DQuat { .into(); output } - /// Divides a quaternion by a scalar value. - /// The quotient is not guaranteed to be normalized. - fn div(_self: Val, rhs: f64) -> Val { - let output: Val = >::div(_self.into_inner(), rhs) - .into(); - output - } /// Computes the dot product of `self` and `rhs`. The dot product is /// equal to the cosine of the angle between two quaternion rotations. fn dot(_self: Val, rhs: Val) -> f64 { @@ -20942,13 +23414,6 @@ impl bevy::math::DQuat { .into(); output } - fn eq(_self: Ref, rhs: Ref) -> bool { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - } /// Creates a quaternion from a 3x3 rotation matrix inside a 3D affine transform. /// Note if the input affine matrix contain scales, shears, or other non-rotation /// transformations then the resulting quaternion will be ill-defined. @@ -21196,44 +23661,6 @@ impl bevy::math::DQuat { } /// Multiplies two quaternions. If they each represent a rotation, the result will /// represent the combined rotation. - /// Note that due to floating point rounding the result may not be perfectly - /// normalized. - /// # Panics - /// Will panic if `self` or `rhs` are not normalized when `glam_assert` is enabled. - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - /// Multiplies a quaternion and a 3D vector, returning the rotated vector. - /// # Panics - /// Will panic if `self` is not normalized when `glam_assert` is enabled. - fn mul( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output - } - /// Multiplies a quaternion by a scalar value. - /// The product is not guaranteed to be normalized. - fn mul(_self: Val, rhs: f64) -> Val { - let output: Val = >::mul(_self.into_inner(), rhs) - .into(); - output - } - /// 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. @@ -21262,13 +23689,6 @@ impl bevy::math::DQuat { .into(); output } - fn neg(_self: Val) -> Val { - let output: Val = ::neg( - _self.into_inner(), - ) - .into(); - output - } /// Returns `self` normalized to length 1.0. /// For valid results, `self` must _not_ be of length zero. /// Panics @@ -21319,18 +23739,6 @@ impl bevy::math::DQuat { .into(); output } - /// Subtracts the `rhs` quaternion from `self`. - /// The difference is not guaranteed to be normalized. - fn sub( - _self: Val, - rhs: Val, - ) -> Val { - let output: Val = >::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output - } /// `[x, y, z, w]` fn to_array(_self: Ref) -> [f64; 4] { let output: [f64; 4] = bevy::math::DQuat::to_array(&_self).into(); @@ -21369,29 +23777,7 @@ impl bevy::math::DQuat { bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::math::EulerRot { - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::math::EulerRot {} #[script_bindings( remote, name = "b_vec_3_a_functions", @@ -21416,20 +23802,6 @@ impl bevy::math::BVec3A { let output: u32 = bevy::math::BVec3A::bitmask(_self.into_inner()).into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq(_self: Ref, rhs: Ref) -> bool { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - } /// Creates a new vector mask from a bool array. fn from_array(a: [bool; 3]) -> Val { let output: Val = bevy::math::BVec3A::from_array(a).into(); @@ -21482,20 +23854,6 @@ impl bevy::math::BVec4A { let output: u32 = bevy::math::BVec4A::bitmask(_self.into_inner()).into(); output } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq(_self: Ref, rhs: Ref) -> bool { - let output: bool = >::eq(&_self, &rhs) - .into(); - output - } /// Creates a new vector mask from a bool array. fn from_array(a: [bool; 4]) -> Val { let output: Val = bevy::math::BVec4A::from_array(a).into(); @@ -21531,20 +23889,6 @@ impl bevy::math::BVec4A { generated )] impl smol_str::SmolStr { - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } fn is_empty(_self: Ref) -> bool { let output: bool = smol_str::SmolStr::is_empty(&_self).into(); output @@ -21607,20 +23951,6 @@ impl uuid::Uuid { let output: (u64, u64) = uuid::Uuid::as_u64_pair(&_self).into(); output } - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// A buffer that can be used for `encode_...` calls, that is /// guaranteed to be long enough for any of the format adapters. /// # Examples @@ -21645,13 +23975,6 @@ impl uuid::Uuid { let output: [u8; 45] = uuid::Uuid::encode_buffer().into(); output } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Creates a UUID using the supplied bytes. /// # Examples /// Basic usage: @@ -21938,17 +24261,31 @@ impl ::bevy::app::Plugin for BevyReflectScriptingPlugin { register_duration_functions(&mut world); register_instant_functions(&mut world); register_range_full_functions(&mut world); + register_type_id_functions(&mut world); register_quat_functions(&mut world); register_vec_3_functions(&mut world); + register_socket_addr_functions(&mut world); register_i_vec_2_functions(&mut world); register_i_vec_3_functions(&mut world); register_i_vec_4_functions(&mut world); + register_i_8_vec_2_functions(&mut world); + register_i_8_vec_3_functions(&mut world); + register_i_8_vec_4_functions(&mut world); + register_i_16_vec_2_functions(&mut world); + register_i_16_vec_3_functions(&mut world); + register_i_16_vec_4_functions(&mut world); register_i_64_vec_2_functions(&mut world); register_i_64_vec_3_functions(&mut world); register_i_64_vec_4_functions(&mut world); register_u_vec_2_functions(&mut world); register_u_vec_3_functions(&mut world); register_u_vec_4_functions(&mut world); + register_u_8_vec_2_functions(&mut world); + register_u_8_vec_3_functions(&mut world); + register_u_8_vec_4_functions(&mut world); + register_u_16_vec_2_functions(&mut world); + register_u_16_vec_3_functions(&mut world); + register_u_16_vec_4_functions(&mut world); register_u_64_vec_2_functions(&mut world); register_u_64_vec_3_functions(&mut world); register_u_64_vec_4_functions(&mut world); diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_time.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_time.rs index 4802139580..c13ea6931c 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_time.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_time.rs @@ -18,30 +18,14 @@ pub struct BevyTimeScriptingPlugin; bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::time::prelude::Fixed { - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } -} +impl bevy::time::prelude::Fixed {} #[script_bindings( remote, name = "real_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::time::prelude::Real { - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } -} +impl bevy::time::prelude::Real {} #[script_bindings( remote, name = "timer_functions", @@ -49,20 +33,6 @@ impl bevy::time::prelude::Real { generated )] impl bevy::time::prelude::Timer { - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns the duration of the timer. /// # Examples /// ``` @@ -71,8 +41,8 @@ impl bevy::time::prelude::Timer { /// let timer = Timer::new(Duration::from_secs(1), TimerMode::Once); /// assert_eq!(timer.duration(), Duration::from_secs(1)); /// ``` - fn duration(_self: Ref) -> Val { - let output: Val = bevy::time::prelude::Timer::duration( + fn duration(_self: Ref) -> Val { + let output: Val = bevy::time::prelude::Timer::duration( &_self, ) .into(); @@ -89,8 +59,8 @@ impl bevy::time::prelude::Timer { /// timer.tick(Duration::from_secs_f32(0.5)); /// assert_eq!(timer.elapsed(), Duration::from_secs_f32(0.5)); /// ``` - fn elapsed(_self: Ref) -> Val { - let output: Val = bevy::time::prelude::Timer::elapsed( + fn elapsed(_self: Ref) -> Val { + let output: Val = bevy::time::prelude::Timer::elapsed( &_self, ) .into(); @@ -108,16 +78,6 @@ impl bevy::time::prelude::Timer { let output: f64 = bevy::time::prelude::Timer::elapsed_secs_f64(&_self).into(); output } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Returns `true` if the timer has reached its duration. /// For repeating timers, this method behaves identically to [`Timer::just_finished`]. /// # Examples @@ -218,7 +178,7 @@ impl bevy::time::prelude::Timer { /// Creates a new timer with a given duration. /// See also [`Timer::from_seconds`](Timer::from_seconds). fn new( - duration: Val, + duration: Val, mode: Val, ) -> Val { let output: Val = bevy::time::prelude::Timer::new( @@ -268,8 +228,8 @@ impl bevy::time::prelude::Timer { /// timer.tick(Duration::from_secs_f32(0.5)); /// assert_eq!(timer.remaining(), Duration::from_secs_f32(1.5)); /// ``` - fn remaining(_self: Ref) -> Val { - let output: Val = bevy::time::prelude::Timer::remaining( + fn remaining(_self: Ref) -> Val { + let output: Val = bevy::time::prelude::Timer::remaining( &_self, ) .into(); @@ -318,7 +278,7 @@ impl bevy::time::prelude::Timer { /// ``` fn set_duration( mut _self: Mut, - duration: Val, + duration: Val, ) -> () { let output: () = bevy::time::prelude::Timer::set_duration( &mut _self, @@ -341,7 +301,7 @@ impl bevy::time::prelude::Timer { /// ``` fn set_elapsed( mut _self: Mut, - time: Val, + time: Val, ) -> () { let output: () = bevy::time::prelude::Timer::set_elapsed( &mut _self, @@ -414,51 +374,14 @@ impl bevy::time::prelude::Timer { bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::time::prelude::TimerMode { - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } -} +impl bevy::time::prelude::TimerMode {} #[script_bindings( remote, name = "virtual_functions", bms_core_path = "bevy_mod_scripting_core", generated )] -impl bevy::time::prelude::Virtual { - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } -} +impl bevy::time::prelude::Virtual {} #[script_bindings( remote, name = "stopwatch_functions", @@ -466,20 +389,6 @@ impl bevy::time::prelude::Virtual { generated )] impl bevy::time::Stopwatch { - fn assert_receiver_is_total_eq(_self: Ref) -> () { - let output: () = ::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output - } - fn clone(_self: Ref) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns the elapsed time since the last [`reset`](Stopwatch::reset) /// of the stopwatch. /// # Examples @@ -493,8 +402,8 @@ impl bevy::time::Stopwatch { /// # See Also /// [`elapsed_secs`](Stopwatch::elapsed_secs) - if an `f32` value is desirable instead. /// [`elapsed_secs_f64`](Stopwatch::elapsed_secs_f64) - if an `f64` is desirable instead. - fn elapsed(_self: Ref) -> Val { - let output: Val = bevy::time::Stopwatch::elapsed(&_self) + fn elapsed(_self: Ref) -> Val { + let output: Val = bevy::time::Stopwatch::elapsed(&_self) .into(); output } @@ -524,13 +433,6 @@ impl bevy::time::Stopwatch { let output: f64 = bevy::time::Stopwatch::elapsed_secs_f64(&_self).into(); output } - fn eq(_self: Ref, other: Ref) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Returns `true` if the stopwatch is paused. /// # Examples /// ``` @@ -599,7 +501,7 @@ impl bevy::time::Stopwatch { /// ``` fn set_elapsed( mut _self: Mut, - time: Val, + time: Val, ) -> () { let output: () = bevy::time::Stopwatch::set_elapsed( &mut _self, diff --git a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_transform.rs b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_transform.rs index 33f27c9332..bd4bffae85 100644 --- a/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_transform.rs +++ b/crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_transform.rs @@ -39,15 +39,6 @@ impl bevy::transform::components::GlobalTransform { .into(); output } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns the 3d affine transformation matrix as a [`Mat4`]. fn compute_matrix( _self: Ref, @@ -80,16 +71,6 @@ impl bevy::transform::components::GlobalTransform { .into(); output } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Return the local forward vector (-Z). fn forward( _self: Ref, @@ -159,36 +140,6 @@ impl bevy::transform::components::GlobalTransform { .into(); output } - fn mul( - _self: Val, - value: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), value.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - global_transform: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), global_transform.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - transform: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), transform.into_inner()) - .into(); - output - } /// Multiplies `self` with `transform` component by component, returning the /// resulting [`GlobalTransform`] fn mul_transform( @@ -222,7 +173,6 @@ impl bevy::transform::components::GlobalTransform { /// ``` /// # use bevy_transform::prelude::{GlobalTransform, Transform}; /// # use bevy_ecs::prelude::{Entity, Query, Component, Commands}; - /// # use bevy_hierarchy::{prelude::Parent, BuildChildren}; /// #[derive(Component)] /// struct ToReparent { /// new_parent: Entity, @@ -394,15 +344,6 @@ impl bevy::transform::components::Transform { .into(); output } - fn clone( - _self: Ref, - ) -> Val { - let output: Val = ::clone( - &_self, - ) - .into(); - output - } /// Returns the 3d affine transformation matrix from this transforms translation, /// rotation, and scale. fn compute_affine( @@ -435,16 +376,6 @@ impl bevy::transform::components::Transform { .into(); output } - fn eq( - _self: Ref, - other: Ref, - ) -> bool { - let output: bool = >::eq(&_self, &other) - .into(); - output - } /// Equivalent to [`-local_z()`][Transform::local_z] fn forward( _self: Ref, @@ -570,36 +501,6 @@ impl bevy::transform::components::Transform { .into(); output } - fn mul( - _self: Val, - value: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), value.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - global_transform: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), global_transform.into_inner()) - .into(); - output - } - fn mul( - _self: Val, - transform: Val, - ) -> Val { - let output: Val = >::mul(_self.into_inner(), transform.into_inner()) - .into(); - output - } /// Multiplies `self` with `transform` component by component, returning the /// resulting [`Transform`] fn mul_transform( @@ -656,6 +557,11 @@ impl bevy::transform::components::Transform { } /// Rotates this [`Transform`] around the given `axis` by `angle` (in radians). /// If this [`Transform`] has a parent, the `axis` is relative to the rotation of the parent. + /// # Warning + /// If you pass in an `axis` based on the current rotation (e.g. obtained via [`Transform::local_x`]), + /// floating point errors can accumulate exponentially when applying rotations repeatedly this way. This will + /// result in a denormalized rotation. In this case, it is recommended to normalize the [`Transform::rotation`] after + /// each call to this method. fn rotate_axis( mut _self: Mut, axis: Val, @@ -683,6 +589,11 @@ impl bevy::transform::components::Transform { output } /// Rotates this [`Transform`] around its local `axis` by `angle` (in radians). + /// # Warning + /// If you pass in an `axis` based on the current rotation (e.g. obtained via [`Transform::local_x`]), + /// floating point errors can accumulate exponentially when applying rotations repeatedly this way. This will + /// result in a denormalized rotation. In this case, it is recommended to normalize the [`Transform::rotation`] after + /// each call to this method. fn rotate_local_axis( mut _self: Mut, axis: Val, @@ -861,10 +772,18 @@ impl bevy::transform::components::Transform { output } } +#[script_bindings( + remote, + name = "transform_tree_changed_functions", + bms_core_path = "bevy_mod_scripting_core", + generated +)] +impl bevy::transform::components::TransformTreeChanged {} impl ::bevy::app::Plugin for BevyTransformScriptingPlugin { fn build(&self, app: &mut ::bevy::prelude::App) { let mut world = app.world_mut(); register_global_transform_functions(&mut world); register_transform_functions(&mut world); + register_transform_tree_changed_functions(&mut world); } } diff --git a/crates/bevy_mod_scripting_functions/src/core.rs b/crates/bevy_mod_scripting_functions/src/core.rs index 08963a02d3..82da20e1ad 100644 --- a/crates/bevy_mod_scripting_functions/src/core.rs +++ b/crates/bevy_mod_scripting_functions/src/core.rs @@ -4,28 +4,28 @@ use std::{collections::HashMap, ops::Deref}; use bevy::prelude::*; use bevy_mod_scripting_core::{ - bindings::{ - function::{ - from::Union, namespace::GlobalNamespace, script_function::DynamicScriptFunctionMut, - }, - script_system::ScriptSystemBuilder, - }, - docgen::info::FunctionInfo, - *, + bindings::{ + function::{ + from::Union, namespace::GlobalNamespace, script_function::DynamicScriptFunctionMut, + }, + script_system::ScriptSystemBuilder, + }, + docgen::info::FunctionInfo, + *, }; use bevy_mod_scripting_derive::script_bindings; use bevy_system_reflection::{ReflectSchedule, ReflectSystem}; use bindings::{ - function::{ - from::{Ref, Val}, - from_ref::FromScriptRef, - into_ref::IntoScriptRef, - script_function::{FunctionCallContext, ScriptFunctionMut}, - }, - pretty_print::DisplayWithWorld, - script_value::ScriptValue, - ReflectReference, ScriptComponentRegistration, ScriptQueryBuilder, ScriptQueryResult, - ScriptResourceRegistration, ScriptTypeRegistration, ThreadWorldContainer, WorldContainer, + function::{ + from::{Ref, Val}, + from_ref::FromScriptRef, + into_ref::IntoScriptRef, + script_function::{FunctionCallContext, ScriptFunctionMut}, + }, + pretty_print::DisplayWithWorld, + script_value::ScriptValue, + ReflectReference, ScriptComponentRegistration, ScriptQueryBuilder, ScriptQueryResult, + ScriptResourceRegistration, ScriptTypeRegistration, ThreadWorldContainer, WorldContainer, }; use error::InteropError; use reflection_extensions::{PartialReflectExt, TypeIdExtensions}; diff --git a/crates/bevy_mod_scripting_functions/src/lib.rs b/crates/bevy_mod_scripting_functions/src/lib.rs index b9174ae4e0..2bfbe22357 100644 --- a/crates/bevy_mod_scripting_functions/src/lib.rs +++ b/crates/bevy_mod_scripting_functions/src/lib.rs @@ -15,7 +15,7 @@ impl Plugin for ScriptFunctionsPlugin { register_core_functions(app); // TODO: if bevy ever does this itself we should remove this - app.world_mut().register_component::(); + app.world_mut().register_component::(); app.world_mut().register_component::(); } } diff --git a/crates/bevy_system_reflection/Cargo.toml b/crates/bevy_system_reflection/Cargo.toml index 95921576f8..675d8929f3 100644 --- a/crates/bevy_system_reflection/Cargo.toml +++ b/crates/bevy_system_reflection/Cargo.toml @@ -12,9 +12,8 @@ categories = ["game-development"] readme = "readme.md" [dependencies] -bevy = { workspace = true, default-features = false } +bevy = { workspace = true, default-features = false, features = ["bevy_log"]} dot-writer = "0.1.4" -petgraph = "0.6" [dev-dependencies] diff --git a/crates/bevy_system_reflection/src/lib.rs b/crates/bevy_system_reflection/src/lib.rs index b176d96c2a..473ab74ad6 100644 --- a/crates/bevy_system_reflection/src/lib.rs +++ b/crates/bevy_system_reflection/src/lib.rs @@ -1,13 +1,16 @@ //! A visualiser for bevy system schedules, as well as utilities for querying them via reflection -use std::ops::Deref; -use std::{any::TypeId, borrow::Cow}; - -use bevy::ecs::schedule::{ - InternedScheduleLabel, InternedSystemSet, NodeId, Schedule, ScheduleLabel, SystemSet, +use std::{any::TypeId, borrow::Cow, ops::Deref}; + +use bevy::{ + ecs::{ + schedule::{ + InternedScheduleLabel, InternedSystemSet, NodeId, Schedule, ScheduleLabel, SystemSet, + }, + system::{System, SystemInput}, + }, + platform::collections::{HashMap, HashSet}, + reflect::Reflect, }; -use bevy::ecs::system::{System, SystemInput}; -use bevy::reflect::Reflect; -use bevy::utils::hashbrown::{HashMap, HashSet}; use dot_writer::{Attributes, DotWriter}; #[derive(Reflect, Debug, Clone)] @@ -283,7 +286,7 @@ pub fn schedule_to_reflect_graph(schedule: &Schedule) -> ReflectSystemGraph { let dependencies = dependency .all_edges() - .map(|(from, to, _)| Edge { + .map(|(from, to)| Edge { from: ReflectNodeId(from), to: ReflectNodeId(to), }) @@ -291,7 +294,7 @@ pub fn schedule_to_reflect_graph(schedule: &Schedule) -> ReflectSystemGraph { let hierarchy = hierarchy .all_edges() - .map(|(from, to, _)| Edge { + .map(|(from, to)| Edge { from: ReflectNodeId(from), to: ReflectNodeId(to), }) @@ -466,17 +469,11 @@ pub struct Edge { #[cfg(test)] mod test { - use bevy::{ - app::Update, - ecs::{ - schedule::{IntoSystemConfigs, IntoSystemSetConfigs}, - world::World, - }, - }; + use bevy::{app::Update, ecs::world::World, prelude::IntoScheduleConfigs}; - use super::*; + use super::*; - fn system_a() {} + fn system_a() {} fn system_b() {} diff --git a/crates/ladfile_builder/Cargo.toml b/crates/ladfile_builder/Cargo.toml index 6b78ed7b8d..adcc25e745 100644 --- a/crates/ladfile_builder/Cargo.toml +++ b/crates/ladfile_builder/Cargo.toml @@ -16,7 +16,7 @@ readme = "readme.md" bevy_mod_scripting_core = { workspace = true } # I don't think bevy has a top level feature for this :C bevy = { workspace = true } -bevy_reflect = { version = "0.15.3", features = ["documentation"] } +bevy_reflect = { version = "0.16.0", features = ["documentation"] } ladfile = { version = "0.5.0", path = "../ladfile" } regex = "1.11" diff --git a/crates/ladfile_builder/src/lib.rs b/crates/ladfile_builder/src/lib.rs index 3c6e6de46d..f4e057f7a0 100644 --- a/crates/ladfile_builder/src/lib.rs +++ b/crates/ladfile_builder/src/lib.rs @@ -1,34 +1,35 @@ //! Parsing definitions for the LAD (Language Agnostic Decleration) file format. pub mod plugin; -use bevy::{ecs::world::World, utils::HashSet}; +use std::{ + any::TypeId, + borrow::Cow, + cmp::{max, min}, + collections::HashMap, + ffi::OsString, + path::PathBuf, +}; + +use bevy::{ecs::world::World, platform::collections::HashSet}; use bevy_mod_scripting_core::{ - bindings::{ - function::{ - namespace::Namespace, - script_function::{ - DynamicScriptFunction, DynamicScriptFunctionMut, FunctionCallContext, - }, - }, - ReflectReference, - }, - docgen::{ - info::FunctionInfo, - typed_through::{ThroughTypeInfo, TypedWrapperKind, UntypedWrapperKind}, - TypedThrough, - }, - match_by_type, + bindings::{ + function::{ + namespace::Namespace, + script_function::{ + DynamicScriptFunction, DynamicScriptFunctionMut, FunctionCallContext, + }, + }, + ReflectReference, + }, + docgen::{ + info::FunctionInfo, + typed_through::{ThroughTypeInfo, TypedWrapperKind, UntypedWrapperKind}, + TypedThrough, + }, + match_by_type, }; use bevy_reflect::{NamedField, TypeInfo, TypeRegistry, Typed, UnnamedField}; use ladfile::*; -use std::{ - any::TypeId, - borrow::Cow, - cmp::{max, min}, - collections::HashMap, - ffi::OsString, - path::PathBuf, -}; /// We can assume that the types here will be either primitives /// or reflect types, as the rest will be covered by typed wrappers @@ -787,21 +788,21 @@ impl<'t> LadFileBuilder<'t> { #[cfg(test)] mod test { - use bevy_mod_scripting_core::{ - bindings::{ - function::{ - from::Ref, - namespace::{GlobalNamespace, IntoNamespace}, - }, - Union, Val, - }, - docgen::info::GetFunctionInfo, - }; - use bevy_reflect::Reflect; - - use super::*; - - /// normalize line endings etc.. + use bevy_mod_scripting_core::{ + bindings::{ + function::{ + from::Ref, + namespace::{GlobalNamespace, IntoNamespace}, + }, + Union, Val, + }, + docgen::info::GetFunctionInfo, + }; + use bevy_reflect::Reflect; + + use super::*; + + /// normalize line endings etc.. fn normalize_file(file: &mut String) { *file = file.replace("\r\n", "\n"); } diff --git a/crates/ladfile_builder/src/plugin.rs b/crates/ladfile_builder/src/plugin.rs index ef6a3a6773..89942ae47a 100644 --- a/crates/ladfile_builder/src/plugin.rs +++ b/crates/ladfile_builder/src/plugin.rs @@ -3,17 +3,13 @@ use std::path::PathBuf; use bevy::{ - app::{App, Plugin, Startup}, - ecs::{ - reflect::AppTypeRegistry, - system::{Res, Resource}, - world::World, - }, + app::{App, Plugin, Startup}, + ecs::{prelude::Resource, reflect::AppTypeRegistry, system::Res, world::World}, }; use bevy_mod_scripting_core::bindings::{ - function::{namespace::Namespace, script_function::AppScriptFunctionRegistry}, - globals::AppScriptGlobalsRegistry, - IntoNamespace, MarkAsCore, MarkAsGenerated, MarkAsSignificant, + function::{namespace::Namespace, script_function::AppScriptFunctionRegistry}, + globals::AppScriptGlobalsRegistry, + IntoNamespace, MarkAsCore, MarkAsGenerated, MarkAsSignificant, }; use ladfile::{default_importance, LadTypeKind}; diff --git a/crates/languages/bevy_mod_scripting_lua/Cargo.toml b/crates/languages/bevy_mod_scripting_lua/Cargo.toml index 9ca8352a0a..45aa8aee47 100644 --- a/crates/languages/bevy_mod_scripting_lua/Cargo.toml +++ b/crates/languages/bevy_mod_scripting_lua/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_mod_scripting_lua" -version = "0.12.0" +version = "0.13.0" authors = ["Maksymilian Mozolewski "] edition = "2021" license = "MIT OR Apache-2.0" @@ -40,10 +40,6 @@ path = "src/lib.rs" bevy = { workspace = true, default-features = false } bevy_mod_scripting_core = { workspace = true, features = ["mlua_impls"] } mlua = { version = "0.10", features = ["vendored", "send", "macros"] } -parking_lot = "0.12.1" -uuid = "1.1" -smol_str = "0.2.2" -smallvec = "1.13" profiling = { workspace = true } [lints] diff --git a/crates/languages/bevy_mod_scripting_lua/src/lib.rs b/crates/languages/bevy_mod_scripting_lua/src/lib.rs index 473c98d24c..33df2015d0 100644 --- a/crates/languages/bevy_mod_scripting_lua/src/lib.rs +++ b/crates/languages/bevy_mod_scripting_lua/src/lib.rs @@ -72,7 +72,7 @@ impl Default for LuaScriptingPlugin { Ok(()) }, - |_script_id, context: &mut Lua| { + |_script_id, context| { // set static globals let world = ThreadWorldContainer.try_get_world()?; let globals_registry = diff --git a/crates/languages/bevy_mod_scripting_rhai/Cargo.toml b/crates/languages/bevy_mod_scripting_rhai/Cargo.toml index 2c2789922d..64e10ee089 100644 --- a/crates/languages/bevy_mod_scripting_rhai/Cargo.toml +++ b/crates/languages/bevy_mod_scripting_rhai/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_mod_scripting_rhai" -version = "0.12.0" +version = "0.13.0" authors = ["Maksymilian Mozolewski "] edition = "2021" license = "MIT OR Apache-2.0" diff --git a/crates/languages/bevy_mod_scripting_rhai/src/lib.rs b/crates/languages/bevy_mod_scripting_rhai/src/lib.rs index 6f72de7362..c9dd10bae0 100644 --- a/crates/languages/bevy_mod_scripting_rhai/src/lib.rs +++ b/crates/languages/bevy_mod_scripting_rhai/src/lib.rs @@ -3,31 +3,30 @@ use std::ops::Deref; use bevy::{ - app::Plugin, - ecs::{entity::Entity, world::World}, + app::Plugin, + ecs::{entity::Entity, world::World}, }; use bevy_mod_scripting_core::{ - asset::Language, - bindings::{ - function::namespace::Namespace, globals::AppScriptGlobalsRegistry, - script_value::ScriptValue, ThreadWorldContainer, WorldContainer, - }, - context::{ContextBuilder, ContextInitializer, ContextPreHandlingInitializer}, - error::ScriptError, - event::CallbackLabel, - reflection_extensions::PartialReflectExt, - runtime::RuntimeSettings, - script::ScriptId, - IntoScriptPluginParams, ScriptingPlugin, + asset::Language, + bindings::{ + function::namespace::Namespace, globals::AppScriptGlobalsRegistry, + script_value::ScriptValue, ThreadWorldContainer, WorldContainer, + }, + context::{ContextBuilder, ContextInitializer, ContextPreHandlingInitializer}, + error::ScriptError, + event::CallbackLabel, + reflection_extensions::PartialReflectExt, + runtime::RuntimeSettings, + script::ScriptId, + IntoScriptPluginParams, ScriptingPlugin, }; use bindings::{ - reference::{ReservedKeyword, RhaiReflectReference, RhaiStaticReflectReference}, - script_value::{FromDynamic, IntoDynamic}, + reference::{ReservedKeyword, RhaiReflectReference, RhaiStaticReflectReference}, + script_value::{FromDynamic, IntoDynamic}, }; use parking_lot::RwLock; -use rhai::{CallFnOptions, Dynamic, Engine, EvalAltResult, Scope, AST}; - pub use rhai; +use rhai::{CallFnOptions, Dynamic, Engine, EvalAltResult, Scope, AST}; /// Bindings for rhai. pub mod bindings; @@ -71,7 +70,7 @@ impl Default for RhaiScriptingPlugin { scripting_plugin: ScriptingPlugin { context_assignment_strategy: Default::default(), runtime_settings: RuntimeSettings { - initializers: vec![|runtime: &RhaiRuntime| { + initializers: vec![|runtime| { let mut engine = runtime.write(); engine.set_max_expr_depths(999, 999); engine.build_type::(); @@ -86,14 +85,14 @@ impl Default for RhaiScriptingPlugin { reload: rhai_context_reload, }, context_initializers: vec![ - |_, context: &mut RhaiScriptContext| { + |_, context| { context.scope.set_or_push( "world", RhaiStaticReflectReference(std::any::TypeId::of::()), ); Ok(()) }, - |_, context: &mut RhaiScriptContext| { + |_, context| { // initialize global functions let world = ThreadWorldContainer.try_get_world()?; let globals_registry = @@ -301,9 +300,9 @@ pub fn rhai_callback_handler( #[cfg(test)] mod test { - use super::*; + use super::*; - #[test] + #[test] fn test_reload_doesnt_overwrite_old_context() { let runtime = RhaiRuntime::new(Engine::new()); let script_id = ScriptId::from("asd.rhai"); diff --git a/crates/testing_crates/script_integration_test_harness/src/lib.rs b/crates/testing_crates/script_integration_test_harness/src/lib.rs index 17956e9c62..e8fdce8efa 100644 --- a/crates/testing_crates/script_integration_test_harness/src/lib.rs +++ b/crates/testing_crates/script_integration_test_harness/src/lib.rs @@ -1,40 +1,40 @@ pub mod test_functions; use std::{ - marker::PhantomData, - path::PathBuf, - time::{Duration, Instant}, + marker::PhantomData, + path::PathBuf, + time::{Duration, Instant}, }; use bevy::{ - app::{Last, Plugin, PostUpdate, Startup, Update}, - asset::{AssetServer, Handle}, - ecs::{ - component::Component, - event::{Event, Events}, - schedule::{IntoSystemConfigs, SystemConfigs}, - system::{IntoSystem, Local, Res, Resource, SystemState}, - world::{Command, FromWorld, Mut}, - }, - log::Level, - prelude::{Entity, World}, - reflect::{Reflect, TypeRegistry}, - utils::tracing, + app::{Last, Plugin, PostUpdate, Startup, Update}, + asset::{AssetServer, Handle}, + ecs::{ + component::Component, + event::{Event, Events}, + prelude::{Command, Resource}, + schedule::ScheduleConfigs, + system::{BoxedSystem, InfallibleSystemWrapper, IntoSystem, Local, Res, SystemState}, + world::{FromWorld, Mut}, + }, + log::{tracing, tracing::event, Level}, + prelude::{BevyError, Entity, IntoScheduleConfigs, World}, + reflect::{Reflect, TypeRegistry}, }; use bevy_mod_scripting_core::{ - asset::ScriptAsset, - bindings::{ - pretty_print::DisplayWithWorld, script_value::ScriptValue, CoreScriptGlobalsPlugin, - ReflectAccessId, WorldAccessGuard, WorldGuard, - }, - callback_labels, - commands::CreateOrUpdateScript, - error::{InteropError, ScriptError}, - event::{IntoCallbackLabel, ScriptErrorEvent}, - extractors::{HandlerContext, WithWorldGuard}, - handler::handle_script_errors, - script::ScriptId, - BMSScriptingInfrastructurePlugin, IntoScriptPluginParams, ScriptingPlugin, + asset::ScriptAsset, + bindings::{ + pretty_print::DisplayWithWorld, script_value::ScriptValue, CoreScriptGlobalsPlugin, + ReflectAccessId, WorldAccessGuard, WorldGuard, + }, + callback_labels, + commands::CreateOrUpdateScript, + error::{InteropError, ScriptError}, + event::{IntoCallbackLabel, ScriptErrorEvent}, + extractors::{HandlerContext, WithWorldGuard}, + handler::handle_script_errors, + script::ScriptId, + BMSScriptingInfrastructurePlugin, IntoScriptPluginParams, ScriptingPlugin, }; use bevy_mod_scripting_functions::ScriptFunctionsPlugin; use criterion::{measurement::Measurement, BatchSize}; @@ -55,9 +55,12 @@ struct TestCallbackBuilder { } impl TestCallbackBuilder { - fn build(script_id: impl Into, expect_response: bool) -> SystemConfigs { + fn build( + script_id: impl Into, + expect_response: bool, + ) -> ScheduleConfigs>> { let script_id = script_id.into(); - IntoSystem::into_system( + let system = Box::new(InfallibleSystemWrapper::new(IntoSystem::into_system( move |world: &mut World, system_state: &mut SystemState>>| { let with_guard = system_state.get_mut(world); @@ -65,9 +68,9 @@ impl TestCallbackBuilder system_state.apply(world); }, - ) - .with_name(L::into_callback_label().to_string()) - .into_configs() + ).with_name(L::into_callback_label().to_string()))); + + system.into_configs() } } @@ -130,12 +133,12 @@ pub fn make_test_lua_plugin() -> bevy_mod_scripting_lua::LuaScriptingPlugin { #[cfg(feature = "rhai")] pub fn make_test_rhai_plugin() -> bevy_mod_scripting_rhai::RhaiScriptingPlugin { use bevy_mod_scripting_core::{ - bindings::{ThreadWorldContainer, WorldContainer}, - ConfigureScriptPlugin, + bindings::{ThreadWorldContainer, WorldContainer}, + ConfigureScriptPlugin, }; use bevy_mod_scripting_rhai::{ - rhai::{Dynamic, EvalAltResult, FnPtr, NativeCallContext}, - RhaiScriptingPlugin, + rhai::{Dynamic, EvalAltResult, FnPtr, NativeCallContext}, + RhaiScriptingPlugin, }; RhaiScriptingPlugin::default().add_runtime_initializer(|runtime| { @@ -341,7 +344,7 @@ pub fn run_lua_benchmark( label: &str, criterion: &mut criterion::BenchmarkGroup, ) -> Result<(), String> { - use bevy::{log::Level, utils::tracing}; + use bevy::log::Level; use bevy_mod_scripting_lua::mlua::Function; let plugin = make_test_lua_plugin(); @@ -373,7 +376,7 @@ pub fn run_rhai_benchmark( label: &str, criterion: &mut criterion::BenchmarkGroup, ) -> Result<(), String> { - use bevy::{log::Level, utils::tracing}; + use bevy::log::Level; use bevy_mod_scripting_rhai::rhai::Dynamic; let plugin = make_test_rhai_plugin(); @@ -418,7 +421,7 @@ where F: Fn(&mut P::C, &P::R, &str, &mut criterion::BenchmarkGroup) -> Result<(), String>, { use bevy_mod_scripting_core::bindings::{ - ThreadWorldContainer, WorldAccessGuard, WorldContainer, + ThreadWorldContainer, WorldAccessGuard, WorldContainer, }; let mut app = setup_integration_test(|_, _| {}); @@ -587,7 +590,7 @@ pub fn perform_benchmark_with_generator< ) }, |(i, w)| { - bevy::utils::tracing::event!(bevy::log::Level::TRACE, "profiling_iter {}", label); + event!(bevy::log::Level::TRACE, "profiling_iter {}", label); bench_fn(w, i) }, batch_size, diff --git a/crates/testing_crates/test_utils/src/test_data.rs b/crates/testing_crates/test_utils/src/test_data.rs index 030f7dc020..6bc5d1eaba 100644 --- a/crates/testing_crates/test_utils/src/test_data.rs +++ b/crates/testing_crates/test_utils/src/test_data.rs @@ -1,12 +1,13 @@ -use std::alloc::Layout; -use std::collections::HashMap; +use std::{alloc::Layout, collections::HashMap}; -use bevy::asset::AssetPlugin; -use bevy::diagnostic::DiagnosticsPlugin; -use bevy::ecs::{component::*, world::World}; -use bevy::log::LogPlugin; -use bevy::prelude::*; -use bevy::reflect::*; +use bevy::{ + asset::AssetPlugin, + diagnostic::DiagnosticsPlugin, + ecs::{component::*, world::World}, + log::LogPlugin, + prelude::*, + reflect::*, +}; /// Test component with Reflect and ReflectComponent registered #[derive(Component, Reflect, PartialEq, Eq, Debug)] @@ -312,6 +313,8 @@ fn init_world(world: &mut World, init: StorageType::Table, Layout::new::(), None, + true, + ComponentCloneBehavior::Default, )) }; } @@ -346,7 +349,6 @@ pub fn setup_integration_test(init: F) app.add_plugins(( MinimalPlugins, AssetPlugin::default(), - HierarchyPlugin, DiagnosticsPlugin, LogPlugin { filter: log_level, @@ -358,9 +360,9 @@ pub fn setup_integration_test(init: F) #[cfg(test)] mod test { - use super::*; + use super::*; - #[test] + #[test] fn setup_works() { setup_world(|_, _| {}); } diff --git a/crates/xtask/src/main.rs b/crates/xtask/src/main.rs index cfe7487c5b..ab1d217a96 100644 --- a/crates/xtask/src/main.rs +++ b/crates/xtask/src/main.rs @@ -598,6 +598,13 @@ struct CodegenTemplateArgs { self_is_bms_lua: bool, } +fn fetch_default_bevy_features() -> String { + let path = "codegen_bevy_features.txt"; + std::fs::read_to_string(path) + .with_context(|| format!("Failed to read default bevy features from {path}")) + .unwrap() +} + #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, clap::Subcommand, strum::AsRefStr)] #[clap( name = "xtask", @@ -677,7 +684,7 @@ enum Xtasks { #[clap( long, - default_value = "bevy_asset,bevy_animation,bevy_core_pipeline,bevy_ui,bevy_pbr,bevy_render,bevy_text,bevy_sprite,file_watcher,multi_threaded", + default_value = fetch_default_bevy_features(), help = "The features to enable for the bevy crate" )] bevy_features: Vec, diff --git a/examples/game_of_life.rs b/examples/game_of_life.rs index 325b4a4db9..a65b907596 100644 --- a/examples/game_of_life.rs +++ b/examples/game_of_life.rs @@ -280,7 +280,7 @@ pub fn update_rendered_state( let old_rendered_state = assets .get_mut(&old_rendered_state.image) .expect("World is not setup correctly"); - old_rendered_state.data = new_state.cells.clone(); + old_rendered_state.data = Some(new_state.cells.clone()); } } @@ -301,7 +301,7 @@ pub fn send_on_click( ) { if buttons.just_pressed(MouseButton::Left) { let window = q_windows.single(); - let pos = window.cursor_position().unwrap_or_default(); + let pos = window.unwrap().cursor_position().unwrap_or_default(); let x = pos.x as u32; let y = pos.y as u32; events.send(ScriptCallbackEvent::new_for_all( diff --git a/src/lib.rs b/src/lib.rs index a880540a76..5860ae083c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,17 +1,17 @@ #![doc=include_str!("../readme.md")] pub mod core { - pub use bevy_mod_scripting_core::*; + pub use bevy_mod_scripting_core::*; } #[cfg(feature = "lua")] pub mod lua { - pub use bevy_mod_scripting_lua::*; + pub use bevy_mod_scripting_lua::*; } #[cfg(feature = "rhai")] pub mod rhai { - pub use bevy_mod_scripting_rhai::*; + pub use bevy_mod_scripting_rhai::*; } // #[cfg(feature = "rune")] @@ -21,7 +21,7 @@ pub mod rhai { use bevy::app::plugin_group; use bevy_mod_scripting_core::{ - bindings::CoreScriptGlobalsPlugin, BMSScriptingInfrastructurePlugin, + bindings::CoreScriptGlobalsPlugin, BMSScriptingInfrastructurePlugin, }; pub use bevy_mod_scripting_derive::*; pub use bevy_mod_scripting_functions::*;