Skip to main content

Vec4

Struct Vec4 

Source
pub struct Vec4(/* private fields */);
Expand description

A 4-dimensional vector.

SIMD vector types are used for storage on supported platforms.

This type is 16 byte aligned.

Implementations§

Source§

impl Vec4

Source

pub const ZERO: Vec4

All zeroes.

Source

pub const ONE: Vec4

All ones.

Source

pub const NEG_ONE: Vec4

All negative ones.

Source

pub const MIN: Vec4

All f32::MIN.

Source

pub const MAX: Vec4

All f32::MAX.

Source

pub const NAN: Vec4

All f32::NAN.

Source

pub const INFINITY: Vec4

All f32::INFINITY.

Source

pub const NEG_INFINITY: Vec4

All f32::NEG_INFINITY.

Source

pub const X: Vec4

A unit vector pointing along the positive X axis.

Source

pub const Y: Vec4

A unit vector pointing along the positive Y axis.

Source

pub const Z: Vec4

A unit vector pointing along the positive Z axis.

Source

pub const W: Vec4

A unit vector pointing along the positive W axis.

Source

pub const NEG_X: Vec4

A unit vector pointing along the negative X axis.

Source

pub const NEG_Y: Vec4

A unit vector pointing along the negative Y axis.

Source

pub const NEG_Z: Vec4

A unit vector pointing along the negative Z axis.

Source

pub const NEG_W: Vec4

A unit vector pointing along the negative W axis.

Source

pub const AXES: [Vec4; 4]

The unit axes.

Source

pub const USES_CORE_SIMD: bool = false

Vec4 uses Rust Portable SIMD

Source

pub const USES_NEON: bool = false

Vec4 uses Arm NEON

Source

pub const USES_SCALAR_MATH: bool = false

Vec4 uses scalar math

Source

pub const USES_SSE2: bool = true

Vec4 uses Intel SSE2

Source

pub const USES_WASM_SIMD: bool = false

Vec4 uses WebAssembly 128-bit SIMD

Source

pub const USES_WASM32_SIMD: bool = false

👎Deprecated since 0.31.0:

Renamed to USES_WASM_SIMD

Source

pub const fn new(x: f32, y: f32, z: f32, w: f32) -> Vec4

Creates a new vector.

Source

pub const fn splat(v: f32) -> Vec4

Creates a vector with all elements set to v.

Examples found in repository?
examples/ui/ui_material.rs (line 49)
20fn setup(
21    mut commands: Commands,
22    mut ui_materials: ResMut<Assets<CustomUiMaterial>>,
23    asset_server: Res<AssetServer>,
24) {
25    // Camera so we can see UI
26    commands.spawn(Camera2d);
27
28    commands
29        .spawn(Node {
30            width: percent(100),
31            height: percent(100),
32            align_items: AlignItems::Center,
33            justify_content: JustifyContent::Center,
34            ..default()
35        })
36        .with_children(|parent| {
37            let banner_scale_factor = 0.5;
38            parent.spawn((
39                Node {
40                    position_type: PositionType::Absolute,
41                    width: px(905.0 * banner_scale_factor),
42                    height: px(363.0 * banner_scale_factor),
43                    border: UiRect::all(px(20)),
44                    border_radius: BorderRadius::all(px(20)),
45                    ..default()
46                },
47                MaterialNode(ui_materials.add(CustomUiMaterial {
48                    color: LinearRgba::WHITE.to_f32_array().into(),
49                    slider: Vec4::splat(0.5),
50                    color_texture: asset_server.load("branding/banner.png"),
51                    border_color: LinearRgba::WHITE.to_f32_array().into(),
52                })),
53                // UI material nodes can have outlines and shadows like any other UI node
54                Outline {
55                    width: px(2),
56                    offset: px(100),
57                    color: DARK_BLUE.into(),
58                },
59            ));
60        });
61}
More examples
Hide additional examples
examples/testbed/ui.rs (line 3615)
3606    pub fn setup(
3607        mut commands: Commands,
3608        mut default_ui_materials: ResMut<Assets<DefaultUiMaterial>>,
3609        mut ui_materials: ResMut<Assets<CustomUiMaterial>>,
3610        asset_server: Res<AssetServer>,
3611    ) {
3612        let default_material = default_ui_materials.add(DefaultUiMaterial {});
3613        let custom_material = |slider| CustomUiMaterial {
3614            color: LinearRgba::from(CYAN_100).to_vec4(),
3615            slider: Vec4::splat(slider),
3616            color_texture: asset_server.load("branding/banner.png"),
3617            border_color: LinearRgba::from(YELLOW_100).to_vec4(),
3618        };
3619        let full_material = ui_materials.add(custom_material(1.));
3620        let material_node = Node {
3621            width: px(200),
3622            height: px(80),
3623            border: px(10).all(),
3624            border_radius: BorderRadius::all(px(20)),
3625            ..default()
3626        };
3627        let material_label = |text: &str| (Text::new(text), TextFont::from_font_size(px(10.)));
3628
3629        commands.spawn((Camera2d, DespawnOnExit(super::Scene::NodeMaterial)));
3630        commands.spawn((
3631            Node {
3632                display: Display::Grid,
3633                // two column grid, labels then materials, first row is spanned by title.
3634                width: percent(100),
3635                height: percent(100),
3636                grid_template_columns: vec![GridTrack::auto(), GridTrack::px(200.)],
3637                align_items: AlignItems::Center,
3638                align_content: AlignContent::Center,
3639                justify_content: JustifyContent::Center,
3640                row_gap: px(10.),
3641                column_gap: px(20.),
3642                ..default()
3643            },
3644            DespawnOnExit(super::Scene::NodeMaterial),
3645            children![
3646                (
3647                    Text::new("MaterialNode"),
3648                    TextFont::from_font_size(px(30.)),
3649                    TextLayout::justify(Justify::Center),
3650                    Node {
3651                        grid_column: GridPlacement::span(2),
3652                        margin: px(10.).bottom(),
3653                        ..default()
3654                    },
3655                ),
3656                // Default UI material (just white with the default ui_material.wgsl shader for the bevy_ui crate)
3657                material_label("'ui_material.wgsl' default material"),
3658                (material_node.clone(), MaterialNode(default_material),),
3659                // Custom UI material, 1./3 full.
3660                material_label("'custom_ui_material.wgsl' 1/3"),
3661                (
3662                    material_node.clone(),
3663                    MaterialNode(ui_materials.add(custom_material(1. / 3.))),
3664                ),
3665                // Custom UI material, 2./3 full.
3666                material_label("'custom_ui_material.wgsl' 2/3"),
3667                (
3668                    material_node.clone(),
3669                    MaterialNode(ui_materials.add(custom_material(2. / 3.)))
3670                ),
3671                // Custom UI material, full.
3672                material_label("'custom_ui_material.wgsl' Full"),
3673                (material_node.clone(), MaterialNode(full_material.clone()),),
3674                // Custom UI material, full. Clipped using overflow so bottom 50% missing
3675                material_label("'custom_ui_material.wgsl' clipped vertically"),
3676                (
3677                    Node {
3678                        width: material_node.width,
3679                        height: material_node.height,
3680                        ..default()
3681                    },
3682                    Outline {
3683                        width: px(1),
3684                        color: RED_500.into(),
3685                        ..default()
3686                    },
3687                    children![(
3688                        Node {
3689                            width: percent(100),
3690                            height: percent(50),
3691                            overflow: Overflow::clip(),
3692                            ..default()
3693                        },
3694                        children![(material_node.clone(), MaterialNode(full_material.clone()))],
3695                    )],
3696                ),
3697                // Custom UI material clipped on both axis so bottom 25% and right 25% not visible.
3698                material_label("'custom_ui_material.wgsl' end clipped on both axis"),
3699                (
3700                    Node {
3701                        width: material_node.width,
3702                        height: material_node.height,
3703                        ..default()
3704                    },
3705                    Outline {
3706                        width: px(1),
3707                        color: RED_500.into(),
3708                        ..default()
3709                    },
3710                    children![(
3711                        Node {
3712                            width: percent(75),
3713                            height: percent(75),
3714                            overflow: Overflow::clip(),
3715                            ..default()
3716                        },
3717                        children![(
3718                            Node {
3719                                position_type: PositionType::Absolute,
3720                                width: px(200),
3721                                height: px(80),
3722                                border: px(10).all(),
3723                                border_radius: BorderRadius::all(px(20)),
3724                                ..default()
3725                            },
3726                            MaterialNode(full_material.clone()),
3727                        )],
3728                    )],
3729                ),
3730                // Custom UI material clipped on both axis so top 25% and left 25% not visible.
3731                material_label("'custom_ui_material.wgsl' start clipped on both axis"),
3732                (
3733                    Node {
3734                        width: material_node.width,
3735                        height: material_node.height,
3736                        align_items: AlignItems::End,
3737                        justify_content: JustifyContent::End,
3738                        ..default()
3739                    },
3740                    Outline {
3741                        width: px(1),
3742                        color: RED_500.into(),
3743                        ..default()
3744                    },
3745                    children![(
3746                        Node {
3747                            width: percent(75),
3748                            height: percent(75),
3749                            overflow: Overflow::clip(),
3750                            ..default()
3751                        },
3752                        children![(
3753                            Node {
3754                                position_type: PositionType::Absolute,
3755                                width: px(200),
3756                                height: px(80),
3757                                right: px(0),
3758                                bottom: px(0),
3759                                border: px(10).all(),
3760                                border_radius: BorderRadius::all(px(20)),
3761                                ..default()
3762                            },
3763                            MaterialNode(full_material),
3764                        )],
3765                    )],
3766                ),
3767            ],
3768        ));
3769    }
Source

pub fn map<F>(self, f: F) -> Vec4
where F: FnMut(f32) -> f32,

Returns a vector containing each element of self modified by a mapping function f.

Source

pub fn select(mask: BVec4A, if_true: Vec4, if_false: Vec4) -> Vec4

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.

Source

pub const fn from_array(a: [f32; 4]) -> Vec4

Creates a new vector from an array.

Source

pub const fn to_array(&self) -> [f32; 4]

Converts self to [x, y, z, w]

Source

pub const fn from_slice(slice: &[f32]) -> Vec4

Creates a vector from the first 4 values in slice.

§Panics

Panics if slice is less than 4 elements long.

Source

pub fn write_to_slice(self, slice: &mut [f32])

Writes the elements of self to the first 4 elements in slice.

§Panics

Panics if slice is less than 4 elements long.

Source

pub fn truncate(self) -> Vec3

Creates a 3D vector from the x, y and z elements of self, discarding w.

Truncation to Vec3 may also be performed by using self.xyz().

To truncate to Vec3A use Vec3A::from_vec4().

Source

pub fn project(self) -> Vec3

Projects a homogeneous coordinate to 3D space by performing perspective divide.

To project to Vec3A use Vec3A::from_homogeneous().

§Panics

Will panic if self.w is 0 when glam_assert is enabled.

Source

pub fn with_x(self, x: f32) -> Vec4

Creates a 4D vector from self with the given value of x.

Source

pub fn with_y(self, y: f32) -> Vec4

Creates a 4D vector from self with the given value of y.

Source

pub fn with_z(self, z: f32) -> Vec4

Creates a 4D vector from self with the given value of z.

Source

pub fn with_w(self, w: f32) -> Vec4

Creates a 4D vector from self with the given value of w.

Source

pub fn dot(self, rhs: Vec4) -> f32

Computes the dot product of self and rhs.

Source

pub fn dot_into_vec(self, rhs: Vec4) -> Vec4

Returns a vector where every component is the dot product of self and rhs.

Source

pub fn min(self, rhs: Vec4) -> Vec4

Returns a vector containing the minimum values for each element of self and rhs.

In other words this computes [min(x, rhs.x), min(self.y, rhs.y), ..].

NaN propogation does not follow IEEE 754-2008 semantics for minNum and may differ on different SIMD architectures.

Source

pub fn max(self, rhs: Vec4) -> Vec4

Returns a vector containing the maximum values for each element of self and rhs.

In other words this computes [max(self.x, rhs.x), max(self.y, rhs.y), ..].

NaN propogation does not follow IEEE 754-2008 semantics for maxNum and may differ on different SIMD architectures.

Source

pub fn clamp(self, min: Vec4, max: Vec4) -> Vec4

Component-wise clamping of values, similar to f32::clamp.

Each element in min must be less-or-equal to the corresponding element in max.

NaN propogation does not follow IEEE 754-2008 semantics and may differ on different SIMD architectures.

§Panics

Will panic if min is greater than max when glam_assert is enabled.

Source

pub fn min_element(self) -> f32

Returns the horizontal minimum of self.

In other words this computes min(x, y, ..).

NaN propogation does not follow IEEE 754-2008 semantics and may differ on different SIMD architectures.

Source

pub fn max_element(self) -> f32

Returns the horizontal maximum of self.

In other words this computes max(x, y, ..).

NaN propogation does not follow IEEE 754-2008 semantics and may differ on different SIMD architectures.

Source

pub fn min_position(self) -> usize

Returns the index of the first minimum element of self.

Source

pub fn max_position(self) -> usize

Returns the index of the first maximum element of self.

Source

pub fn element_sum(self) -> f32

Returns the sum of all elements of self.

In other words, this computes self.x + self.y + ...

Source

pub fn element_product(self) -> f32

Returns the product of all elements of self.

In other words, this computes self.x * self.y * ...

Source

pub fn cmpeq(self, rhs: Vec4) -> BVec4A

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.

Source

pub fn cmpne(self, rhs: Vec4) -> BVec4A

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.

Source

pub fn cmpge(self, rhs: Vec4) -> BVec4A

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.

Source

pub fn cmpgt(self, rhs: Vec4) -> BVec4A

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.

Source

pub fn cmple(self, rhs: Vec4) -> BVec4A

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.

Source

pub fn cmplt(self, rhs: Vec4) -> BVec4A

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.

Source

pub fn abs(self) -> Vec4

Returns a vector containing the absolute value of each element of self.

Source

pub fn signum(self) -> Vec4

Returns a vector with elements representing the sign of self.

  • 1.0 if the number is positive, +0.0 or INFINITY
  • -1.0 if the number is negative, -0.0 or NEG_INFINITY
  • NAN if the number is NAN
Source

pub fn copysign(self, rhs: Vec4) -> Vec4

Returns a vector with signs of rhs and the magnitudes of self.

Source

pub fn is_negative_bitmask(self) -> u32

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.

An element is negative if it has a negative sign, including -0.0, NaNs with negative sign bit and negative infinity.

Source

pub fn is_negative_mask(self) -> BVec4A

Returns a mask indicating which components are negative.

An element is negative if it has a negative sign, including -0.0, NaNs with negative sign bit and negative infinity.

Source

pub fn is_finite(self) -> bool

Returns true if, and only if, all elements are finite. If any element is either NaN, positive or negative infinity, this will return false.

Source

pub fn is_finite_mask(self) -> BVec4A

Performs is_finite on each element of self, returning a vector mask of the results.

In other words, this computes [x.is_finite(), y.is_finite(), ...].

Source

pub fn is_nan(self) -> bool

Returns true if any elements are NaN.

Source

pub fn is_nan_mask(self) -> BVec4A

Performs is_nan on each element of self, returning a vector mask of the results.

In other words, this computes [x.is_nan(), y.is_nan(), ...].

Source

pub fn length(self) -> f32

Computes the length of self.

Source

pub fn length_squared(self) -> f32

Computes the squared length of self.

This is faster than length() as it avoids a square root operation.

Source

pub fn length_recip(self) -> f32

Computes 1.0 / length().

For valid results, self must not be of length zero.

Source

pub fn distance(self, rhs: Vec4) -> f32

Computes the Euclidean distance between two points in space.

Source

pub fn distance_squared(self, rhs: Vec4) -> f32

Compute the squared euclidean distance between two points in space.

Source

pub fn div_euclid(self, rhs: Vec4) -> Vec4

Returns the element-wise quotient of [Euclidean division] of self by rhs.

Source

pub fn rem_euclid(self, rhs: Vec4) -> Vec4

Returns the element-wise remainder of Euclidean division of self by rhs.

Source

pub fn normalize(self) -> Vec4

Returns self normalized to length 1.0.

For valid results, self must be finite and not of length zero, nor very close to zero.

See also Self::try_normalize() and Self::normalize_or_zero().

§Panics

Will panic if the resulting normalized vector is not finite when glam_assert is enabled.

Source

pub fn try_normalize(self) -> Option<Vec4>

Returns self normalized to length 1.0 if possible, else returns None.

In particular, if the input is zero (or very close to zero), or non-finite, the result of this operation will be None.

See also Self::normalize_or_zero().

Source

pub fn normalize_or(self, fallback: Vec4) -> Vec4

Returns self normalized to length 1.0 if possible, else returns a fallback value.

In particular, if the input is zero (or very close to zero), or non-finite, the result of this operation will be the fallback value.

See also Self::try_normalize().

Source

pub fn normalize_or_zero(self) -> Vec4

Returns self normalized to length 1.0 if possible, else returns zero.

In particular, if the input is zero (or very close to zero), or non-finite, the result of this operation will be zero.

See also Self::try_normalize().

Source

pub fn normalize_and_length(self) -> (Vec4, f32)

Returns self normalized to length 1.0 and the length of self.

If self is zero length then (Self::X, 0.0) is returned.

Source

pub fn is_normalized(self) -> bool

Returns whether self is length 1.0 or not.

Uses a precision threshold of approximately 1e-4.

Source

pub fn project_onto(self, rhs: Vec4) -> Vec4

Returns the vector projection of self onto rhs.

rhs must be of non-zero length.

§Panics

Will panic if rhs is zero length when glam_assert is enabled.

Source

pub fn reject_from(self, rhs: Vec4) -> Vec4

Returns the vector rejection of self from rhs.

The vector rejection is the vector perpendicular to the projection of self onto rhs, in rhs words the result of self - self.project_onto(rhs).

rhs must be of non-zero length.

§Panics

Will panic if rhs has a length of zero when glam_assert is enabled.

Source

pub fn project_onto_normalized(self, rhs: Vec4) -> Vec4

Returns the vector projection of self onto rhs.

rhs must be normalized.

§Panics

Will panic if rhs is not normalized when glam_assert is enabled.

Source

pub fn reject_from_normalized(self, rhs: Vec4) -> Vec4

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.

Source

pub fn round(self) -> Vec4

Returns a vector containing the nearest integer to a number for each element of self. Round half-way cases away from 0.0.

Source

pub fn floor(self) -> Vec4

Returns a vector containing the largest integer less than or equal to a number for each element of self.

Source

pub fn ceil(self) -> Vec4

Returns a vector containing the smallest integer greater than or equal to a number for each element of self.

Source

pub fn trunc(self) -> Vec4

Returns a vector containing the integer part each element of self. This means numbers are always truncated towards zero.

Source

pub fn step(self, rhs: Vec4) -> Vec4

Returns a vector containing 0.0 if rhs < self and 1.0 otherwise.

Similar to glsl’s step(edge, x), which translates into edge.step(x)

Source

pub fn smoothstep(self, edge0: Vec4, edge1: Vec4) -> Vec4

Performs Hermite interpolation between 0.0 and 1.0 using x normalized to [edge0, edge1].

This is equivalent to t * t * (3.0 - 2.0 * t), where t is clamped to [0.0, 1.0]. Results are undefined if any element of edge0 is greater than or equal to the corresponding element of edge1.

§Panics

Will panic if any element of edge0 is greater than or equal to the corresponding element of edge1, when glam_assert is enabled.

Source

pub fn saturate(self) -> Vec4

Returns a vector containing all elements of self clamped to the range of [0, 1].

Source

pub fn fract(self) -> Vec4

Returns a vector containing the fractional part of the vector as self - self.trunc().

Note that this differs from the GLSL implementation of fract which returns self - self.floor().

Note that this is fast but not precise for large numbers.

Source

pub fn fract_gl(self) -> Vec4

Returns a vector containing the fractional part of the vector as self - self.floor().

Note that this differs from the Rust implementation of fract which returns self - self.trunc().

Note that this is fast but not precise for large numbers.

Source

pub fn exp(self) -> Vec4

Returns a vector containing e^self (the exponential function) for each element of self.

Source

pub fn exp2(self) -> Vec4

Returns a vector containing 2^self for each element of self.

Source

pub fn ln(self) -> Vec4

Returns a vector containing the natural logarithm for each element of self. This returns NaN when the element is negative and negative infinity when the element is zero.

Source

pub fn log2(self) -> Vec4

Returns a vector containing the base 2 logarithm for each element of self. This returns NaN when the element is negative and negative infinity when the element is zero.

Source

pub fn powf(self, n: f32) -> Vec4

Returns a vector containing each element of self raised to the power of n.

Source

pub fn sqrt(self) -> Vec4

Returns a vector containing the square root for each element of self. This returns NaN when the element is negative.

Source

pub fn cos(self) -> Vec4

Returns a vector containing the cosine for each element of self.

Source

pub fn sin(self) -> Vec4

Returns a vector containing the sine for each element of self.

Source

pub fn sin_cos(self) -> (Vec4, Vec4)

Returns a tuple of two vectors containing the sine and cosine for each element of self.

Source

pub fn recip(self) -> Vec4

Returns a vector containing the reciprocal 1.0/n of each element of self.

Source

pub fn lerp(self, rhs: Vec4, s: f32) -> Vec4

Performs a linear interpolation between self and rhs based on the value s, using the form self * (1.0 - s) + rhs * s.

When s is 0.0, the result will be equal to self. When s is 1.0, the result will be equal to rhs. When s is outside of the range [0, 1], the result is linearly extrapolated.

The result is guaranteed to be self at s == 0.0 and rhs at s == 1.0, even when the values differ greatly in magnitude, but it is not monotonic in s for nearly equal inputs and may not preserve equal inputs exactly. Consider lerp_monotonic instead when interpolating between values that may be equal or nearly equal.

Source

pub fn lerp_monotonic(self, rhs: Vec4, s: f32) -> Vec4

Performs a linear interpolation between self and rhs based on the value s, using the monotonic form self + (rhs - self) * s.

When s is 0.0, the result will be equal to self. When s is 1.0, the result will be equal to rhs. When s is outside of the range [0, 1], the result is linearly extrapolated.

Prefer this over lerp when interpolating between values that may be equal or nearly equal: the result is monotonic in s and equal inputs are preserved exactly, avoiding the rounding jitter that lerp can introduce. The tradeoff is that rhs - self is evaluated first, so this is less accurate than lerp when self and rhs differ greatly in magnitude, and overflows to infinity when they have opposite signs and large magnitudes.

On SIMD back-ends the multiply and add are fused when the target supports it, which has a single rounding step and can be more accurate than a separate multiply and add.

Source

pub fn move_towards(self, rhs: Vec4, d: f32) -> Vec4

Moves towards rhs based on the value d.

When d is 0.0, the result will be equal to self. When d is equal to self.distance(rhs), the result will be equal to rhs. Will not go past rhs.

Source

pub fn midpoint(self, rhs: Vec4) -> Vec4

Calculates the midpoint between self and rhs.

The midpoint is the average of, or halfway point between, two vectors. a.midpoint(b) should yield the same result as a.lerp(b, 0.5) while being slightly cheaper to compute.

Source

pub fn abs_diff_eq(self, rhs: Vec4, max_abs_diff: f32) -> bool

Returns true if the absolute difference of all elements between self and rhs is less than or equal to max_abs_diff.

This can be used to compare if two vectors contain similar elements. It works best when comparing with a known value. The max_abs_diff that should be used used depends on the values being compared against.

For more see comparing floating point numbers.

Source

pub fn clamp_length(self, min: f32, max: f32) -> Vec4

Returns a vector with a length no less than min and no more than max.

§Panics

Will panic if min is greater than max, or if either min or max is negative, when glam_assert is enabled.

Source

pub fn clamp_length_max(self, max: f32) -> Vec4

Returns a vector with a length no more than max.

§Panics

Will panic if max is negative when glam_assert is enabled.

Source

pub fn clamp_length_min(self, min: f32) -> Vec4

Returns a vector with a length no less than min.

§Panics

Will panic if min is negative when glam_assert is enabled.

Source

pub fn mul_add(self, a: Vec4, b: Vec4) -> Vec4

Fused multiply-add. Computes (self * a) + b element-wise with only one rounding error, yielding a more accurate result than an unfused multiply-add.

Using mul_add may be more performant than an unfused multiply-add if the target architecture has a dedicated fma CPU instruction. However, this is not always true, and will be heavily dependant on designing algorithms with specific target hardware in mind.

Source

pub fn reflect(self, normal: Vec4) -> Vec4

Returns the reflection vector for a given incident vector self and surface normal normal.

normal must be normalized.

§Panics

Will panic if normal is not normalized when glam_assert is enabled.

Source

pub fn refract(self, normal: Vec4, eta: f32) -> Vec4

Returns the refraction direction for a given incident vector self, surface normal normal and ratio of indices of refraction, eta. When total internal reflection occurs, a zero vector will be returned.

self and normal must be normalized.

§Panics

Will panic if self or normal is not normalized when glam_assert is enabled.

Source

pub fn as_dvec4(self) -> DVec4

Available on crate feature f64 only.

Casts all elements of self to f64.

Source

pub fn as_i8vec4(self) -> I8Vec4

Available on crate feature i8 only.

Casts all elements of self to i8.

Source

pub fn as_u8vec4(self) -> U8Vec4

Available on crate feature u8 only.

Casts all elements of self to u8.

Source

pub fn as_i16vec4(self) -> I16Vec4

Available on crate feature i16 only.

Casts all elements of self to i16.

Source

pub fn as_u16vec4(self) -> U16Vec4

Available on crate feature u16 only.

Casts all elements of self to u16.

Source

pub fn as_ivec4(self) -> IVec4

Available on crate feature i32 only.

Casts all elements of self to i32.

Source

pub fn as_uvec4(self) -> UVec4

Available on crate feature u32 only.

Casts all elements of self to u32.

Source

pub fn as_i64vec4(self) -> I64Vec4

Available on crate feature i64 only.

Casts all elements of self to i64.

Source

pub fn as_u64vec4(self) -> U64Vec4

Available on crate feature u64 only.

Casts all elements of self to u64.

Trait Implementations§

Source§

impl AbsDiffEq for Vec4

Source§

type Epsilon = <f32 as AbsDiffEq>::Epsilon

Used for specifying relative comparisons.
Source§

fn default_epsilon() -> <Vec4 as AbsDiffEq>::Epsilon

The default tolerance to use when testing values that are close together. Read more
Source§

fn abs_diff_eq( &self, other: &Vec4, epsilon: <Vec4 as AbsDiffEq>::Epsilon, ) -> bool

A test for equality that uses the absolute difference to compute the approximate equality of two numbers.
Source§

fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool

The inverse of AbsDiffEq::abs_diff_eq.
Source§

impl Add for Vec4

Source§

type Output = Vec4

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Vec4) -> Vec4

Performs the + operation. Read more
Source§

impl Add<&Vec4> for Vec4

Source§

type Output = Vec4

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Vec4) -> Vec4

Performs the + operation. Read more
Source§

impl Add<&Vec4> for &Vec4

Source§

type Output = Vec4

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Vec4) -> Vec4

Performs the + operation. Read more
Source§

impl Add<&f32> for Vec4

Source§

type Output = Vec4

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &f32) -> Vec4

Performs the + operation. Read more
Source§

impl Add<&f32> for &Vec4

Source§

type Output = Vec4

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &f32) -> Vec4

Performs the + operation. Read more
Source§

impl Add<Vec4> for &Vec4

Source§

type Output = Vec4

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Vec4) -> Vec4

Performs the + operation. Read more
Source§

impl Add<f32> for Vec4

Source§

type Output = Vec4

The resulting type after applying the + operator.
Source§

fn add(self, rhs: f32) -> Vec4

Performs the + operation. Read more
Source§

impl Add<f32> for &Vec4

Source§

type Output = Vec4

The resulting type after applying the + operator.
Source§

fn add(self, rhs: f32) -> Vec4

Performs the + operation. Read more
Source§

impl AddAssign for Vec4

Source§

fn add_assign(&mut self, rhs: Vec4)

Performs the += operation. Read more
Source§

impl AddAssign<&Vec4> for Vec4

Source§

fn add_assign(&mut self, rhs: &Vec4)

Performs the += operation. Read more
Source§

impl AddAssign<&f32> for Vec4

Source§

fn add_assign(&mut self, rhs: &f32)

Performs the += operation. Read more
Source§

impl AddAssign<f32> for Vec4

Source§

fn add_assign(&mut self, rhs: f32)

Performs the += operation. Read more
Source§

impl Animatable for Vec4

Source§

fn interpolate(a: &Vec4, b: &Vec4, t: f32) -> Vec4

Interpolates between a and b with an interpolation factor of time. Read more
Source§

fn blend(inputs: impl Iterator<Item = BlendInput<Vec4>>) -> Vec4

Blends one or more values together. Read more
Source§

impl AsMut<[f32; 4]> for Vec4

Source§

fn as_mut(&mut self) -> &mut [f32; 4]

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsMutVectorParts<f32, 4> for Vec4
where Vec4: AsMut<[f32; 4]>, f32: VectorScalar,

Source§

fn as_mut_parts(&mut self) -> &mut [f32; 4]

Source§

impl AsRef<[f32; 4]> for Vec4

Source§

fn as_ref(&self) -> &[f32; 4]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRefVectorParts<f32, 4> for Vec4
where Vec4: AsRef<[f32; 4]>, f32: VectorScalar,

Source§

fn as_ref_parts(&self) -> &[f32; 4]

Source§

impl Clone for Vec4

Source§

fn clone(&self) -> Vec4

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Vec4

Source§

impl CreateFrom for Vec4

Source§

fn create_from<B>(reader: &mut Reader<B>) -> Vec4
where B: BufferRef,

Source§

impl Debug for Vec4

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for Vec4

Source§

fn default() -> Vec4

Returns the “default value” for a type. Read more
Source§

impl Deref for Vec4

Source§

type Target = Vec4<f32>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<Vec4 as Deref>::Target

Dereferences the value.
Source§

impl DerefMut for Vec4

Source§

fn deref_mut(&mut self) -> &mut <Vec4 as Deref>::Target

Mutably dereferences the value.
Source§

impl<'de> Deserialize<'de> for Vec4

Deserialize expects a sequence of 4 values.

Source§

fn deserialize<D>( deserializer: D, ) -> Result<Vec4, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Vec4

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Div for Vec4

Source§

type Output = Vec4

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Vec4) -> Vec4

Performs the / operation. Read more
Source§

impl Div<&Vec4> for Vec4

Source§

type Output = Vec4

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Vec4) -> Vec4

Performs the / operation. Read more
Source§

impl Div<&Vec4> for &Vec4

Source§

type Output = Vec4

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Vec4) -> Vec4

Performs the / operation. Read more
Source§

impl Div<&f32> for Vec4

Source§

type Output = Vec4

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &f32) -> Vec4

Performs the / operation. Read more
Source§

impl Div<&f32> for &Vec4

Source§

type Output = Vec4

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &f32) -> Vec4

Performs the / operation. Read more
Source§

impl Div<Vec4> for &Vec4

Source§

type Output = Vec4

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Vec4) -> Vec4

Performs the / operation. Read more
Source§

impl Div<f32> for Vec4

Source§

type Output = Vec4

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f32) -> Vec4

Performs the / operation. Read more
Source§

impl Div<f32> for &Vec4

Source§

type Output = Vec4

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f32) -> Vec4

Performs the / operation. Read more
Source§

impl DivAssign for Vec4

Source§

fn div_assign(&mut self, rhs: Vec4)

Performs the /= operation. Read more
Source§

impl DivAssign<&Vec4> for Vec4

Source§

fn div_assign(&mut self, rhs: &Vec4)

Performs the /= operation. Read more
Source§

impl DivAssign<&f32> for Vec4

Source§

fn div_assign(&mut self, rhs: &f32)

Performs the /= operation. Read more
Source§

impl DivAssign<f32> for Vec4

Source§

fn div_assign(&mut self, rhs: f32)

Performs the /= operation. Read more
Source§

impl EaseVectorSpace for Vec4

Source§

impl From<(Vec2, Vec2)> for Vec4

Source§

fn from(_: (Vec2, Vec2)) -> Vec4

Converts to this type from the input type.
Source§

impl From<(Vec2, f32, f32)> for Vec4

Source§

fn from(_: (Vec2, f32, f32)) -> Vec4

Converts to this type from the input type.
Source§

impl From<(Vec3, f32)> for Vec4

Source§

fn from(_: (Vec3, f32)) -> Vec4

Converts to this type from the input type.
Source§

impl From<(Vec3A, f32)> for Vec4

Source§

fn from(_: (Vec3A, f32)) -> Vec4

Converts to this type from the input type.
Source§

impl From<(f32, Vec3)> for Vec4

Source§

fn from(_: (f32, Vec3)) -> Vec4

Converts to this type from the input type.
Source§

impl From<(f32, Vec3A)> for Vec4

Source§

fn from(_: (f32, Vec3A)) -> Vec4

Converts to this type from the input type.
Source§

impl From<(f32, f32, f32, f32)> for Vec4

Source§

fn from(t: (f32, f32, f32, f32)) -> Vec4

Converts to this type from the input type.
Source§

impl From<BVec4> for Vec4

Source§

fn from(v: BVec4) -> Vec4

Converts to this type from the input type.
Source§

impl From<BVec4A> for Vec4

Available on non-crate feature scalar-math only.
Source§

fn from(v: BVec4A) -> Vec4

Converts to this type from the input type.
Source§

impl From<Dir4> for Vec4

Source§

fn from(value: Dir4) -> Vec4

Converts to this type from the input type.
Source§

impl From<Quat> for Vec4

Source§

fn from(q: Quat) -> Vec4

Converts to this type from the input type.
Source§

impl From<Vec4> for DVec4

Source§

fn from(v: Vec4) -> DVec4

Converts to this type from the input type.
Source§

impl From<[f32; 4]> for Vec4

Source§

fn from(a: [f32; 4]) -> Vec4

Converts to this type from the input type.
Source§

impl From<__m128> for Vec4

Source§

fn from(t: __m128) -> Vec4

Converts to this type from the input type.
Source§

impl FromArg for Vec4

Source§

type This<'from_arg> = Vec4

The type to convert into. Read more
Source§

fn from_arg(arg: Arg<'_>) -> Result<<Vec4 as FromArg>::This<'_>, ArgError>

Creates an item from an argument. Read more
Source§

impl FromReflect for Vec4

Source§

fn from_reflect(reflect: &(dyn PartialReflect + 'static)) -> Option<Vec4>

Constructs a concrete instance of Self from a reflected value.
Source§

fn take_from_reflect( reflect: Box<dyn PartialReflect>, ) -> Result<Self, Box<dyn PartialReflect>>

Attempts to downcast the given value to Self using, constructing the value using from_reflect if that fails. Read more
Source§

impl FromVectorParts<f32, 4> for Vec4
where Vec4: From<[f32; 4]>, f32: VectorScalar,

Source§

fn from_parts(parts: [f32; 4]) -> Vec4

Source§

impl GetOwnership for Vec4

Source§

fn ownership() -> Ownership

Returns the ownership of Self.
Source§

impl GetTypeRegistration for Vec4

Source§

fn get_type_registration() -> TypeRegistration

Returns the default TypeRegistration for this type.
Source§

fn register_type_dependencies(registry: &mut TypeRegistry)

Registers other types needed by this type. Read more
Source§

impl Index<usize> for Vec4

Source§

type Output = f32

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &<Vec4 as Index<usize>>::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl IndexMut<usize> for Vec4

Source§

fn index_mut(&mut self, index: usize) -> &mut <Vec4 as Index<usize>>::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl IntoReturn for Vec4

Source§

fn into_return<'into_return>(self) -> Return<'into_return>
where Vec4: 'into_return,

Converts Self into a Return value.
Source§

impl Mul for Vec4

Source§

type Output = Vec4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vec4) -> Vec4

Performs the * operation. Read more
Source§

impl Mul<&Vec4> for Mat4

Source§

type Output = Vec4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Vec4) -> Vec4

Performs the * operation. Read more
Source§

impl Mul<&Vec4> for &Mat4

Source§

type Output = Vec4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Vec4) -> Vec4

Performs the * operation. Read more
Source§

impl Mul<&Vec4> for Vec4

Source§

type Output = Vec4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Vec4) -> Vec4

Performs the * operation. Read more
Source§

impl Mul<&Vec4> for &Vec4

Source§

type Output = Vec4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Vec4) -> Vec4

Performs the * operation. Read more
Source§

impl Mul<&f32> for Vec4

Source§

type Output = Vec4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &f32) -> Vec4

Performs the * operation. Read more
Source§

impl Mul<&f32> for &Vec4

Source§

type Output = Vec4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &f32) -> Vec4

Performs the * operation. Read more
Source§

impl Mul<Vec4> for Mat4

Source§

type Output = Vec4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vec4) -> <Mat4 as Mul<Vec4>>::Output

Performs the * operation. Read more
Source§

impl Mul<Vec4> for &Mat4

Source§

type Output = Vec4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vec4) -> Vec4

Performs the * operation. Read more
Source§

impl Mul<Vec4> for &Vec4

Source§

type Output = Vec4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vec4) -> Vec4

Performs the * operation. Read more
Source§

impl Mul<f32> for Vec4

Source§

type Output = Vec4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f32) -> Vec4

Performs the * operation. Read more
Source§

impl Mul<f32> for &Vec4

Source§

type Output = Vec4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f32) -> Vec4

Performs the * operation. Read more
Source§

impl MulAssign for Vec4

Source§

fn mul_assign(&mut self, rhs: Vec4)

Performs the *= operation. Read more
Source§

impl MulAssign<&Vec4> for Vec4

Source§

fn mul_assign(&mut self, rhs: &Vec4)

Performs the *= operation. Read more
Source§

impl MulAssign<&f32> for Vec4

Source§

fn mul_assign(&mut self, rhs: &f32)

Performs the *= operation. Read more
Source§

impl MulAssign<f32> for Vec4

Source§

fn mul_assign(&mut self, rhs: f32)

Performs the *= operation. Read more
Source§

impl Neg for Vec4

Source§

type Output = Vec4

The resulting type after applying the - operator.
Source§

fn neg(self) -> Vec4

Performs the unary - operation. Read more
Source§

impl Neg for &Vec4

Source§

type Output = Vec4

The resulting type after applying the - operator.
Source§

fn neg(self) -> Vec4

Performs the unary - operation. Read more
Source§

impl NormedVectorSpace for Vec4

Source§

fn norm(self) -> f32

The size of this element. The return value should always be nonnegative.
Source§

fn norm_squared(self) -> f32

The squared norm of this element. Computing this is often faster than computing NormedVectorSpace::norm.
Source§

fn distance(self, rhs: Self) -> Self::Scalar

The distance between this element and another, as determined by the norm.
Source§

fn distance_squared(self, rhs: Self) -> Self::Scalar

The squared distance between this element and another, as determined by the norm. Note that this is often faster to compute in practice than NormedVectorSpace::distance.
Source§

impl PartialEq for Vec4

Source§

fn eq(&self, rhs: &Vec4) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialReflect for Vec4

Source§

fn get_represented_type_info(&self) -> Option<&'static TypeInfo>

Returns the TypeInfo of the type represented by this value. Read more
Source§

fn try_apply( &mut self, value: &(dyn PartialReflect + 'static), ) -> Result<(), ApplyError>

Tries to apply a reflected value to this value. Read more
Source§

fn reflect_kind(&self) -> ReflectKind

Returns a zero-sized enumeration of “kinds” of type. Read more
Source§

fn reflect_ref(&self) -> ReflectRef<'_>

Returns an immutable enumeration of “kinds” of type. Read more
Source§

fn reflect_mut(&mut self) -> ReflectMut<'_>

Returns a mutable enumeration of “kinds” of type. Read more
Source§

fn reflect_owned(self: Box<Vec4>) -> ReflectOwned

Returns an owned enumeration of “kinds” of type. Read more
Source§

fn try_into_reflect( self: Box<Vec4>, ) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>

Attempts to cast this type to a boxed, fully-reflected value.
Source§

fn try_as_reflect(&self) -> Option<&(dyn Reflect + 'static)>

Attempts to cast this type to a fully-reflected value.
Source§

fn try_as_reflect_mut(&mut self) -> Option<&mut (dyn Reflect + 'static)>

Attempts to cast this type to a mutable, fully-reflected value.
Source§

fn into_partial_reflect(self: Box<Vec4>) -> Box<dyn PartialReflect>

Casts this type to a boxed, reflected value. Read more
Source§

fn as_partial_reflect(&self) -> &(dyn PartialReflect + 'static)

Casts this type to a reflected value. Read more
Source§

fn as_partial_reflect_mut(&mut self) -> &mut (dyn PartialReflect + 'static)

Casts this type to a mutable, reflected value. Read more
Source§

fn reflect_partial_eq( &self, value: &(dyn PartialReflect + 'static), ) -> Option<bool>

Returns a “partial equality” comparison result. Read more
Source§

fn reflect_partial_cmp( &self, value: &(dyn PartialReflect + 'static), ) -> Option<Ordering>

Returns a “partial comparison” result. Read more
Source§

fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Debug formatter for the value. Read more
Source§

fn reflect_clone(&self) -> Result<Box<dyn Reflect>, ReflectCloneError>

Attempts to clone Self using reflection. Read more
Source§

fn apply(&mut self, value: &(dyn PartialReflect + 'static))

Applies a reflected value to this value. Read more
Source§

fn to_dynamic(&self) -> Result<Box<dyn PartialReflect>, ReflectCloneError>

Converts this reflected value into its dynamic representation based on its kind. Read more
Source§

fn reflect_clone_and_take<T>(&self) -> Result<T, ReflectCloneError>
where T: 'static, Self: Sized + TypePath,

For a type implementing PartialReflect, combines reflect_clone and take in a useful fashion, automatically constructing an appropriate ReflectCloneError if the downcast fails.
Source§

fn reflect_hash(&self) -> Option<u64>

Returns a hash of the value (which includes the type). Read more
Source§

fn is_dynamic(&self) -> bool

Indicates whether or not this type is a dynamic type. Read more
Source§

impl Pod for Vec4

Source§

impl Product for Vec4

Source§

fn product<I>(iter: I) -> Vec4
where I: Iterator<Item = Vec4>,

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl<'a> Product<&'a Vec4> for Vec4

Source§

fn product<I>(iter: I) -> Vec4
where I: Iterator<Item = &'a Vec4>,

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl ReadFrom for Vec4

Source§

fn read_from<B>(&mut self, reader: &mut Reader<B>)
where B: BufferRef,

Source§

impl Reflect for Vec4

Source§

fn into_any(self: Box<Vec4>) -> Box<dyn Any>

Returns the value as a Box<dyn Any>. Read more
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Returns the value as a &dyn Any. Read more
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Returns the value as a &mut dyn Any. Read more
Source§

fn into_reflect(self: Box<Vec4>) -> Box<dyn Reflect>

Casts this type to a boxed, fully-reflected value.
Source§

fn as_reflect(&self) -> &(dyn Reflect + 'static)

Casts this type to a fully-reflected value.
Source§

fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)

Casts this type to a mutable, fully-reflected value.
Source§

fn set(&mut self, value: Box<dyn Reflect>) -> Result<(), Box<dyn Reflect>>

Performs a type-checked assignment of a reflected value to this value. Read more
Source§

impl RelativeEq for Vec4

Source§

fn default_max_relative() -> <Vec4 as AbsDiffEq>::Epsilon

The default relative tolerance for testing values that are far-apart. Read more
Source§

fn relative_eq( &self, other: &Vec4, epsilon: <Vec4 as AbsDiffEq>::Epsilon, max_relative: <Vec4 as AbsDiffEq>::Epsilon, ) -> bool

A test for equality that uses a relative comparison if the values are far apart.
Source§

fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool

The inverse of RelativeEq::relative_eq.
Source§

impl Rem for Vec4

Source§

type Output = Vec4

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Vec4) -> Vec4

Performs the % operation. Read more
Source§

impl Rem<&Vec4> for Vec4

Source§

type Output = Vec4

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &Vec4) -> Vec4

Performs the % operation. Read more
Source§

impl Rem<&Vec4> for &Vec4

Source§

type Output = Vec4

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &Vec4) -> Vec4

Performs the % operation. Read more
Source§

impl Rem<&f32> for Vec4

Source§

type Output = Vec4

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &f32) -> Vec4

Performs the % operation. Read more
Source§

impl Rem<&f32> for &Vec4

Source§

type Output = Vec4

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &f32) -> Vec4

Performs the % operation. Read more
Source§

impl Rem<Vec4> for &Vec4

Source§

type Output = Vec4

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Vec4) -> Vec4

Performs the % operation. Read more
Source§

impl Rem<f32> for Vec4

Source§

type Output = Vec4

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: f32) -> Vec4

Performs the % operation. Read more
Source§

impl Rem<f32> for &Vec4

Source§

type Output = Vec4

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: f32) -> Vec4

Performs the % operation. Read more
Source§

impl RemAssign for Vec4

Source§

fn rem_assign(&mut self, rhs: Vec4)

Performs the %= operation. Read more
Source§

impl RemAssign<&Vec4> for Vec4

Source§

fn rem_assign(&mut self, rhs: &Vec4)

Performs the %= operation. Read more
Source§

impl RemAssign<&f32> for Vec4

Source§

fn rem_assign(&mut self, rhs: &f32)

Performs the %= operation. Read more
Source§

impl RemAssign<f32> for Vec4

Source§

fn rem_assign(&mut self, rhs: f32)

Performs the %= operation. Read more
Source§

impl SampleUniform for Vec4

Source§

type Sampler = UniformVec4<UniformFloat<f32>>

The UniformSampler implementation supporting type X.
Source§

impl Serialize for Vec4

Serialize as a sequence of 4 values.

Source§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl ShaderSize for Vec4
where f32: ShaderSize,

Source§

const SHADER_SIZE: NonZero<u64> = _

Represents WGSL Size (equivalent to ShaderType::min_size)
Source§

impl ShaderType for Vec4
where f32: ShaderSize,

Source§

fn min_size() -> NonZero<u64>

Represents the minimum size of Self (equivalent to GPUBufferBindingLayout.minBindingSize) Read more
Source§

fn size(&self) -> NonZero<u64>

Returns the size of Self at runtime Read more
Source§

fn assert_uniform_compat()

Source§

impl Struct for Vec4

Source§

fn field(&self, name: &str) -> Option<&(dyn PartialReflect + 'static)>

Gets a reference to the value of the field named name as a &dyn PartialReflect.
Source§

fn field_mut( &mut self, name: &str, ) -> Option<&mut (dyn PartialReflect + 'static)>

Gets a mutable reference to the value of the field named name as a &mut dyn PartialReflect.
Source§

fn field_at(&self, index: usize) -> Option<&(dyn PartialReflect + 'static)>

Gets a reference to the value of the field with index index as a &dyn PartialReflect.
Source§

fn field_at_mut( &mut self, index: usize, ) -> Option<&mut (dyn PartialReflect + 'static)>

Gets a mutable reference to the value of the field with index index as a &mut dyn PartialReflect.
Source§

fn name_at(&self, index: usize) -> Option<&str>

Gets the name of the field with index index.
Source§

fn index_of_name(&self, name: &str) -> Option<usize>

Gets the index of the field with the given name.
Source§

fn field_len(&self) -> usize

Returns the number of fields in the struct.
Source§

fn iter_fields(&self) -> FieldIter<'_> ⓘ

Returns an iterator over the values of the reflectable fields for this struct.
Source§

fn to_dynamic_struct(&self) -> Result<DynamicStruct, ReflectCloneError>

Creates a new DynamicStruct from this struct. Read more
Source§

fn get_represented_struct_info(&self) -> Option<&'static StructInfo>

Will return None if TypeInfo is not available.
Source§

impl Sub for Vec4

Source§

type Output = Vec4

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Vec4) -> Vec4

Performs the - operation. Read more
Source§

impl Sub<&Vec4> for Vec4

Source§

type Output = Vec4

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Vec4) -> Vec4

Performs the - operation. Read more
Source§

impl Sub<&Vec4> for &Vec4

Source§

type Output = Vec4

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Vec4) -> Vec4

Performs the - operation. Read more
Source§

impl Sub<&f32> for Vec4

Source§

type Output = Vec4

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &f32) -> Vec4

Performs the - operation. Read more
Source§

impl Sub<&f32> for &Vec4

Source§

type Output = Vec4

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &f32) -> Vec4

Performs the - operation. Read more
Source§

impl Sub<Vec4> for &Vec4

Source§

type Output = Vec4

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Vec4) -> Vec4

Performs the - operation. Read more
Source§

impl Sub<f32> for Vec4

Source§

type Output = Vec4

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: f32) -> Vec4

Performs the - operation. Read more
Source§

impl Sub<f32> for &Vec4

Source§

type Output = Vec4

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: f32) -> Vec4

Performs the - operation. Read more
Source§

impl SubAssign for Vec4

Source§

fn sub_assign(&mut self, rhs: Vec4)

Performs the -= operation. Read more
Source§

impl SubAssign<&Vec4> for Vec4

Source§

fn sub_assign(&mut self, rhs: &Vec4)

Performs the -= operation. Read more
Source§

impl SubAssign<&f32> for Vec4

Source§

fn sub_assign(&mut self, rhs: &f32)

Performs the -= operation. Read more
Source§

impl SubAssign<f32> for Vec4

Source§

fn sub_assign(&mut self, rhs: f32)

Performs the -= operation. Read more
Source§

impl Sum for Vec4

Source§

fn sum<I>(iter: I) -> Vec4
where I: Iterator<Item = Vec4>,

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl<'a> Sum<&'a Vec4> for Vec4

Source§

fn sum<I>(iter: I) -> Vec4
where I: Iterator<Item = &'a Vec4>,

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl TryFrom<Vec4> for Dir4

Source§

type Error = InvalidDirectionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Vec4) -> Result<Dir4, <Dir4 as TryFrom<Vec4>>::Error>

Performs the conversion.
Source§

impl TypePath for Vec4

Source§

fn type_path() -> &'static str

Returns the fully qualified path of the underlying type. Read more
Source§

fn short_type_path() -> &'static str

Returns a short, pretty-print enabled path to the type. Read more
Source§

fn type_ident() -> Option<&'static str>

Returns the name of the type, or None if it is anonymous. Read more
Source§

fn crate_name() -> Option<&'static str>

Returns the name of the crate the type is in, or None if it is anonymous. Read more
Source§

fn module_path() -> Option<&'static str>

Returns the path to the module the type is in, or None if it is anonymous. Read more
Source§

impl Typed for Vec4

Source§

fn type_info() -> &'static TypeInfo

Returns the compile-time info for the underlying type.
Source§

impl UlpsEq for Vec4

Source§

fn default_max_ulps() -> u32

The default ULPs to tolerate when testing values that are far-apart. Read more
Source§

fn ulps_eq( &self, other: &Vec4, epsilon: <Vec4 as AbsDiffEq>::Epsilon, max_ulps: u32, ) -> bool

A test for equality that uses units in the last place (ULP) if the values are far apart.
Source§

fn ulps_ne(&self, other: &Rhs, epsilon: Self::Epsilon, max_ulps: u32) -> bool

The inverse of UlpsEq::ulps_eq.
Source§

impl Vec4Swizzles for Vec4

Source§

type Vec2 = Vec2

Source§

type Vec3 = Vec3

Source§

fn xx(self) -> Vec2

Source§

fn xy(self) -> Vec2

Source§

fn with_xy(self, rhs: Vec2) -> Vec4

Source§

fn xz(self) -> Vec2

Source§

fn with_xz(self, rhs: Vec2) -> Vec4

Source§

fn xw(self) -> Vec2

Source§

fn with_xw(self, rhs: Vec2) -> Vec4

Source§

fn yx(self) -> Vec2

Source§

fn with_yx(self, rhs: Vec2) -> Vec4

Source§

fn yy(self) -> Vec2

Source§

fn yz(self) -> Vec2

Source§

fn with_yz(self, rhs: Vec2) -> Vec4

Source§

fn yw(self) -> Vec2

Source§

fn with_yw(self, rhs: Vec2) -> Vec4

Source§

fn zx(self) -> Vec2

Source§

fn with_zx(self, rhs: Vec2) -> Vec4

Source§

fn zy(self) -> Vec2

Source§

fn with_zy(self, rhs: Vec2) -> Vec4

Source§

fn zz(self) -> Vec2

Source§

fn zw(self) -> Vec2

Source§

fn with_zw(self, rhs: Vec2) -> Vec4

Source§

fn wx(self) -> Vec2

Source§

fn with_wx(self, rhs: Vec2) -> Vec4

Source§

fn wy(self) -> Vec2

Source§

fn with_wy(self, rhs: Vec2) -> Vec4

Source§

fn wz(self) -> Vec2

Source§

fn with_wz(self, rhs: Vec2) -> Vec4

Source§

fn ww(self) -> Vec2

Source§

fn xxx(self) -> Vec3

Source§

fn xxy(self) -> Vec3

Source§

fn xxz(self) -> Vec3

Source§

fn xxw(self) -> Vec3

Source§

fn xyx(self) -> Vec3

Source§

fn xyy(self) -> Vec3

Source§

fn xyz(self) -> Vec3

Source§

fn with_xyz(self, rhs: Vec3) -> Vec4

Source§

fn xyw(self) -> Vec3

Source§

fn with_xyw(self, rhs: Vec3) -> Vec4

Source§

fn xzx(self) -> Vec3

Source§

fn xzy(self) -> Vec3

Source§

fn with_xzy(self, rhs: Vec3) -> Vec4

Source§

fn xzz(self) -> Vec3

Source§

fn xzw(self) -> Vec3

Source§

fn with_xzw(self, rhs: Vec3) -> Vec4

Source§

fn xwx(self) -> Vec3

Source§

fn xwy(self) -> Vec3

Source§

fn with_xwy(self, rhs: Vec3) -> Vec4

Source§

fn xwz(self) -> Vec3

Source§

fn with_xwz(self, rhs: Vec3) -> Vec4

Source§

fn xww(self) -> Vec3

Source§

fn yxx(self) -> Vec3

Source§

fn yxy(self) -> Vec3

Source§

fn yxz(self) -> Vec3

Source§

fn with_yxz(self, rhs: Vec3) -> Vec4

Source§

fn yxw(self) -> Vec3

Source§

fn with_yxw(self, rhs: Vec3) -> Vec4

Source§

fn yyx(self) -> Vec3

Source§

fn yyy(self) -> Vec3

Source§

fn yyz(self) -> Vec3

Source§

fn yyw(self) -> Vec3

Source§

fn yzx(self) -> Vec3

Source§

fn with_yzx(self, rhs: Vec3) -> Vec4

Source§

fn yzy(self) -> Vec3

Source§

fn yzz(self) -> Vec3

Source§

fn yzw(self) -> Vec3

Source§

fn with_yzw(self, rhs: Vec3) -> Vec4

Source§

fn ywx(self) -> Vec3

Source§

fn with_ywx(self, rhs: Vec3) -> Vec4

Source§

fn ywy(self) -> Vec3

Source§

fn ywz(self) -> Vec3

Source§

fn with_ywz(self, rhs: Vec3) -> Vec4

Source§

fn yww(self) -> Vec3

Source§

fn zxx(self) -> Vec3

Source§

fn zxy(self) -> Vec3

Source§

fn with_zxy(self, rhs: Vec3) -> Vec4

Source§

fn zxz(self) -> Vec3

Source§

fn zxw(self) -> Vec3

Source§

fn with_zxw(self, rhs: Vec3) -> Vec4

Source§

fn zyx(self) -> Vec3

Source§

fn with_zyx(self, rhs: Vec3) -> Vec4

Source§

fn zyy(self) -> Vec3

Source§

fn zyz(self) -> Vec3

Source§

fn zyw(self) -> Vec3

Source§

fn with_zyw(self, rhs: Vec3) -> Vec4

Source§

fn zzx(self) -> Vec3

Source§

fn zzy(self) -> Vec3

Source§

fn zzz(self) -> Vec3

Source§

fn zzw(self) -> Vec3

Source§

fn zwx(self) -> Vec3

Source§

fn with_zwx(self, rhs: Vec3) -> Vec4

Source§

fn zwy(self) -> Vec3

Source§

fn with_zwy(self, rhs: Vec3) -> Vec4

Source§

fn zwz(self) -> Vec3

Source§

fn zww(self) -> Vec3

Source§

fn wxx(self) -> Vec3

Source§

fn wxy(self) -> Vec3

Source§

fn with_wxy(self, rhs: Vec3) -> Vec4

Source§

fn wxz(self) -> Vec3

Source§

fn with_wxz(self, rhs: Vec3) -> Vec4

Source§

fn wxw(self) -> Vec3

Source§

fn wyx(self) -> Vec3

Source§

fn with_wyx(self, rhs: Vec3) -> Vec4

Source§

fn wyy(self) -> Vec3

Source§

fn wyz(self) -> Vec3

Source§

fn with_wyz(self, rhs: Vec3) -> Vec4

Source§

fn wyw(self) -> Vec3

Source§

fn wzx(self) -> Vec3

Source§

fn with_wzx(self, rhs: Vec3) -> Vec4

Source§

fn wzy(self) -> Vec3

Source§

fn with_wzy(self, rhs: Vec3) -> Vec4

Source§

fn wzz(self) -> Vec3

Source§

fn wzw(self) -> Vec3

Source§

fn wwx(self) -> Vec3

Source§

fn wwy(self) -> Vec3

Source§

fn wwz(self) -> Vec3

Source§

fn www(self) -> Vec3

Source§

fn xxxx(self) -> Vec4

Source§

fn xxxy(self) -> Vec4

Source§

fn xxxz(self) -> Vec4

Source§

fn xxxw(self) -> Vec4

Source§

fn xxyx(self) -> Vec4

Source§

fn xxyy(self) -> Vec4

Source§

fn xxyz(self) -> Vec4

Source§

fn xxyw(self) -> Vec4

Source§

fn xxzx(self) -> Vec4

Source§

fn xxzy(self) -> Vec4

Source§

fn xxzz(self) -> Vec4

Source§

fn xxzw(self) -> Vec4

Source§

fn xxwx(self) -> Vec4

Source§

fn xxwy(self) -> Vec4

Source§

fn xxwz(self) -> Vec4

Source§

fn xxww(self) -> Vec4

Source§

fn xyxx(self) -> Vec4

Source§

fn xyxy(self) -> Vec4

Source§

fn xyxz(self) -> Vec4

Source§

fn xyxw(self) -> Vec4

Source§

fn xyyx(self) -> Vec4

Source§

fn xyyy(self) -> Vec4

Source§

fn xyyz(self) -> Vec4

Source§

fn xyyw(self) -> Vec4

Source§

fn xyzx(self) -> Vec4

Source§

fn xyzy(self) -> Vec4

Source§

fn xyzz(self) -> Vec4

Source§

fn xywx(self) -> Vec4

Source§

fn xywy(self) -> Vec4

Source§

fn xywz(self) -> Vec4

Source§

fn xyww(self) -> Vec4

Source§

fn xzxx(self) -> Vec4

Source§

fn xzxy(self) -> Vec4

Source§

fn xzxz(self) -> Vec4

Source§

fn xzxw(self) -> Vec4

Source§

fn xzyx(self) -> Vec4

Source§

fn xzyy(self) -> Vec4

Source§

fn xzyz(self) -> Vec4

Source§

fn xzyw(self) -> Vec4

Source§

fn xzzx(self) -> Vec4

Source§

fn xzzy(self) -> Vec4

Source§

fn xzzz(self) -> Vec4

Source§

fn xzzw(self) -> Vec4

Source§

fn xzwx(self) -> Vec4

Source§

fn xzwy(self) -> Vec4

Source§

fn xzwz(self) -> Vec4

Source§

fn xzww(self) -> Vec4

Source§

fn xwxx(self) -> Vec4

Source§

fn xwxy(self) -> Vec4

Source§

fn xwxz(self) -> Vec4

Source§

fn xwxw(self) -> Vec4

Source§

fn xwyx(self) -> Vec4

Source§

fn xwyy(self) -> Vec4

Source§

fn xwyz(self) -> Vec4

Source§

fn xwyw(self) -> Vec4

Source§

fn xwzx(self) -> Vec4

Source§

fn xwzy(self) -> Vec4

Source§

fn xwzz(self) -> Vec4

Source§

fn xwzw(self) -> Vec4

Source§

fn xwwx(self) -> Vec4

Source§

fn xwwy(self) -> Vec4

Source§

fn xwwz(self) -> Vec4

Source§

fn xwww(self) -> Vec4

Source§

fn yxxx(self) -> Vec4

Source§

fn yxxy(self) -> Vec4

Source§

fn yxxz(self) -> Vec4

Source§

fn yxxw(self) -> Vec4

Source§

fn yxyx(self) -> Vec4

Source§

fn yxyy(self) -> Vec4

Source§

fn yxyz(self) -> Vec4

Source§

fn yxyw(self) -> Vec4

Source§

fn yxzx(self) -> Vec4

Source§

fn yxzy(self) -> Vec4

Source§

fn yxzz(self) -> Vec4

Source§

fn yxzw(self) -> Vec4

Source§

fn yxwx(self) -> Vec4

Source§

fn yxwy(self) -> Vec4

Source§

fn yxwz(self) -> Vec4

Source§

fn yxww(self) -> Vec4

Source§

fn yyxx(self) -> Vec4

Source§

fn yyxy(self) -> Vec4

Source§

fn yyxz(self) -> Vec4

Source§

fn yyxw(self) -> Vec4

Source§

fn yyyx(self) -> Vec4

Source§

fn yyyy(self) -> Vec4

Source§

fn yyyz(self) -> Vec4

Source§

fn yyyw(self) -> Vec4

Source§

fn yyzx(self) -> Vec4

Source§

fn yyzy(self) -> Vec4

Source§

fn yyzz(self) -> Vec4

Source§

fn yyzw(self) -> Vec4

Source§

fn yywx(self) -> Vec4

Source§

fn yywy(self) -> Vec4

Source§

fn yywz(self) -> Vec4

Source§

fn yyww(self) -> Vec4

Source§

fn yzxx(self) -> Vec4

Source§

fn yzxy(self) -> Vec4

Source§

fn yzxz(self) -> Vec4

Source§

fn yzxw(self) -> Vec4

Source§

fn yzyx(self) -> Vec4

Source§

fn yzyy(self) -> Vec4

Source§

fn yzyz(self) -> Vec4

Source§

fn yzyw(self) -> Vec4

Source§

fn yzzx(self) -> Vec4

Source§

fn yzzy(self) -> Vec4

Source§

fn yzzz(self) -> Vec4

Source§

fn yzzw(self) -> Vec4

Source§

fn yzwx(self) -> Vec4

Source§

fn yzwy(self) -> Vec4

Source§

fn yzwz(self) -> Vec4

Source§

fn yzww(self) -> Vec4

Source§

fn ywxx(self) -> Vec4

Source§

fn ywxy(self) -> Vec4

Source§

fn ywxz(self) -> Vec4

Source§

fn ywxw(self) -> Vec4

Source§

fn ywyx(self) -> Vec4

Source§

fn ywyy(self) -> Vec4

Source§

fn ywyz(self) -> Vec4

Source§

fn ywyw(self) -> Vec4

Source§

fn ywzx(self) -> Vec4

Source§

fn ywzy(self) -> Vec4

Source§

fn ywzz(self) -> Vec4

Source§

fn ywzw(self) -> Vec4

Source§

fn ywwx(self) -> Vec4

Source§

fn ywwy(self) -> Vec4

Source§

fn ywwz(self) -> Vec4

Source§

fn ywww(self) -> Vec4

Source§

fn zxxx(self) -> Vec4

Source§

fn zxxy(self) -> Vec4

Source§

fn zxxz(self) -> Vec4

Source§

fn zxxw(self) -> Vec4

Source§

fn zxyx(self) -> Vec4

Source§

fn zxyy(self) -> Vec4

Source§

fn zxyz(self) -> Vec4

Source§

fn zxyw(self) -> Vec4

Source§

fn zxzx(self) -> Vec4

Source§

fn zxzy(self) -> Vec4

Source§

fn zxzz(self) -> Vec4

Source§

fn zxzw(self) -> Vec4

Source§

fn zxwx(self) -> Vec4

Source§

fn zxwy(self) -> Vec4

Source§

fn zxwz(self) -> Vec4

Source§

fn zxww(self) -> Vec4

Source§

fn zyxx(self) -> Vec4

Source§

fn zyxy(self) -> Vec4

Source§

fn zyxz(self) -> Vec4

Source§

fn zyxw(self) -> Vec4

Source§

fn zyyx(self) -> Vec4

Source§

fn zyyy(self) -> Vec4

Source§

fn zyyz(self) -> Vec4

Source§

fn zyyw(self) -> Vec4

Source§

fn zyzx(self) -> Vec4

Source§

fn zyzy(self) -> Vec4

Source§

fn zyzz(self) -> Vec4

Source§

fn zyzw(self) -> Vec4

Source§

fn zywx(self) -> Vec4

Source§

fn zywy(self) -> Vec4

Source§

fn zywz(self) -> Vec4

Source§

fn zyww(self) -> Vec4

Source§

fn zzxx(self) -> Vec4

Source§

fn zzxy(self) -> Vec4

Source§

fn zzxz(self) -> Vec4

Source§

fn zzxw(self) -> Vec4

Source§

fn zzyx(self) -> Vec4

Source§

fn zzyy(self) -> Vec4

Source§

fn zzyz(self) -> Vec4

Source§

fn zzyw(self) -> Vec4

Source§

fn zzzx(self) -> Vec4

Source§

fn zzzy(self) -> Vec4

Source§

fn zzzz(self) -> Vec4

Source§

fn zzzw(self) -> Vec4

Source§

fn zzwx(self) -> Vec4

Source§

fn zzwy(self) -> Vec4

Source§

fn zzwz(self) -> Vec4

Source§

fn zzww(self) -> Vec4

Source§

fn zwxx(self) -> Vec4

Source§

fn zwxy(self) -> Vec4

Source§

fn zwxz(self) -> Vec4

Source§

fn zwxw(self) -> Vec4

Source§

fn zwyx(self) -> Vec4

Source§

fn zwyy(self) -> Vec4

Source§

fn zwyz(self) -> Vec4

Source§

fn zwyw(self) -> Vec4

Source§

fn zwzx(self) -> Vec4

Source§

fn zwzy(self) -> Vec4

Source§

fn zwzz(self) -> Vec4

Source§

fn zwzw(self) -> Vec4

Source§

fn zwwx(self) -> Vec4

Source§

fn zwwy(self) -> Vec4

Source§

fn zwwz(self) -> Vec4

Source§

fn zwww(self) -> Vec4

Source§

fn wxxx(self) -> Vec4

Source§

fn wxxy(self) -> Vec4

Source§

fn wxxz(self) -> Vec4

Source§

fn wxxw(self) -> Vec4

Source§

fn wxyx(self) -> Vec4

Source§

fn wxyy(self) -> Vec4

Source§

fn wxyz(self) -> Vec4

Source§

fn wxyw(self) -> Vec4

Source§

fn wxzx(self) -> Vec4

Source§

fn wxzy(self) -> Vec4

Source§

fn wxzz(self) -> Vec4

Source§

fn wxzw(self) -> Vec4

Source§

fn wxwx(self) -> Vec4

Source§

fn wxwy(self) -> Vec4

Source§

fn wxwz(self) -> Vec4

Source§

fn wxww(self) -> Vec4

Source§

fn wyxx(self) -> Vec4

Source§

fn wyxy(self) -> Vec4

Source§

fn wyxz(self) -> Vec4

Source§

fn wyxw(self) -> Vec4

Source§

fn wyyx(self) -> Vec4

Source§

fn wyyy(self) -> Vec4

Source§

fn wyyz(self) -> Vec4

Source§

fn wyyw(self) -> Vec4

Source§

fn wyzx(self) -> Vec4

Source§

fn wyzy(self) -> Vec4

Source§

fn wyzz(self) -> Vec4

Source§

fn wyzw(self) -> Vec4

Source§

fn wywx(self) -> Vec4

Source§

fn wywy(self) -> Vec4

Source§

fn wywz(self) -> Vec4

Source§

fn wyww(self) -> Vec4

Source§

fn wzxx(self) -> Vec4

Source§

fn wzxy(self) -> Vec4

Source§

fn wzxz(self) -> Vec4

Source§

fn wzxw(self) -> Vec4

Source§

fn wzyx(self) -> Vec4

Source§

fn wzyy(self) -> Vec4

Source§

fn wzyz(self) -> Vec4

Source§

fn wzyw(self) -> Vec4

Source§

fn wzzx(self) -> Vec4

Source§

fn wzzy(self) -> Vec4

Source§

fn wzzz(self) -> Vec4

Source§

fn wzzw(self) -> Vec4

Source§

fn wzwx(self) -> Vec4

Source§

fn wzwy(self) -> Vec4

Source§

fn wzwz(self) -> Vec4

Source§

fn wzww(self) -> Vec4

Source§

fn wwxx(self) -> Vec4

Source§

fn wwxy(self) -> Vec4

Source§

fn wwxz(self) -> Vec4

Source§

fn wwxw(self) -> Vec4

Source§

fn wwyx(self) -> Vec4

Source§

fn wwyy(self) -> Vec4

Source§

fn wwyz(self) -> Vec4

Source§

fn wwyw(self) -> Vec4

Source§

fn wwzx(self) -> Vec4

Source§

fn wwzy(self) -> Vec4

Source§

fn wwzz(self) -> Vec4

Source§

fn wwzw(self) -> Vec4

Source§

fn wwwx(self) -> Vec4

Source§

fn wwwy(self) -> Vec4

Source§

fn wwwz(self) -> Vec4

Source§

fn wwww(self) -> Vec4

Source§

fn xyzw(self) -> Self

Source§

impl VectorSpace for Vec4

Source§

const ZERO: Vec4 = Vec4::ZERO

The zero vector, which is the identity of addition for the vector space type.
Source§

type Scalar = f32

The scalar type of this vector space.
Source§

fn lerp(self, rhs: Self, t: Self::Scalar) -> Self

Perform vector space linear interpolation between this element and another, based on the parameter t. When t is 0, self is recovered. When t is 1, rhs is recovered. Read more
Source§

impl WriteInto for Vec4

Source§

fn write_into<B>(&self, writer: &mut Writer<B>)
where B: BufferMut,

Source§

impl Zeroable for Vec4

Source§

fn zeroed() -> Self

Auto Trait Implementations§

§

impl Freeze for Vec4

§

impl RefUnwindSafe for Vec4

§

impl Send for Vec4

§

impl Sync for Vec4

§

impl Unpin for Vec4

§

impl UnsafeUnpin for Vec4

§

impl UnwindSafe for Vec4

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyBitPattern for T
where T: Pod,

Source§

impl<T, U> AsBindGroupShaderType<U> for T
where U: ShaderType, &'a T: for<'a> Into<U>,

Source§

fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U

Return the T ShaderType for self. When used in AsBindGroup derives, it is safe to assume that all images in self exist.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Brush for T
where T: Clone + PartialEq + Default + Debug,

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CheckedBitPattern for T
where T: AnyBitPattern,

Source§

type Bits = T

Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
Source§

fn is_valid_bit_pattern(_bits: &T) -> bool

If this function returns true, then it must be valid to reinterpret bits as &Self.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ConditionalSend for T
where T: Send,

Source§

impl<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> DynamicTypePath for T
where T: TypePath,

Source§

impl<T> DynamicTyped for T
where T: Typed,

Source§

impl<V> Ease for V
where V: EaseVectorSpace,

Source§

fn interpolating_curve_unbounded(start: V, end: V) -> impl Curve<V>

Given start and end values, produce a curve with unlimited domain that: Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T> FromTemplate for T
where T: Clone + Default + Unpin,

Source§

type Template = T

The Template for this type.
Source§

impl<T> FromWorld for T
where T: Default,

Source§

fn from_world(_world: &mut World) -> T

Creates Self using default().

Source§

impl<S> GetField for S
where S: Struct,

Source§

fn get_field<T>(&self, name: &str) -> Option<&T>
where T: Reflect,

Gets a reference to the value of the field named name, downcast to T.
Source§

fn get_field_mut<T>(&mut self, name: &str) -> Option<&mut T>
where T: Reflect,

Gets a mutable reference to the value of the field named name, downcast to T.
Source§

impl<T> GetPath for T
where T: Reflect + ?Sized,

Source§

fn reflect_path<'p>( &self, path: impl ReflectPath<'p>, ) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>

Returns a reference to the value specified by path. Read more
Source§

fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>

Returns a mutable reference to the value specified by path. Read more
Source§

fn path<'p, T>( &self, path: impl ReflectPath<'p>, ) -> Result<&T, ReflectPathError<'p>>
where T: Reflect,

Returns a statically typed reference to the value specified by path. Read more
Source§

fn path_mut<'p, T>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut T, ReflectPathError<'p>>
where T: Reflect,

Returns a statically typed mutable reference to the value specified by path. Read more
Source§

impl<T> GpuArrayBufferable for T

Source§

impl<V> HasTangent for V
where V: VectorSpace,

Source§

type Tangent = V

The tangent type.
Source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

impl<T> HitDataExtra for T
where T: Send + Sync + Debug + Any + 'static,

Source§

impl<T> Identity for T
where T: ?Sized,

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
Source§

impl<T> InitializeFromFunction<T> for T

Source§

fn initialize_from_function(f: fn() -> T) -> T

Create an instance of this type from an initialization function
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Interleave for T
where T: Pod,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoResult<T> for T

Source§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<A> Is for A
where A: Any,

Source§

fn is<T>() -> bool
where T: Any,

Checks if the current type “is” another type, using a TypeId equality comparison. This is most useful in the context of generic logic. Read more
Source§

impl<T> NoUninit for T
where T: Pod,

Source§

impl<T> NoneValue for T
where T: Default,

Source§

type NoneType = T

Source§

fn null_value() -> T

The none-equivalent value.
Source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

Source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,

Source§

impl<G> PatchFromTemplate for G
where G: FromTemplate,

Source§

type Template = <G as FromTemplate>::Template

The Template that will be patched.
Source§

fn patch<F>(func: F) -> TemplatePatch<F, <G as PatchFromTemplate>::Template>
where F: FnOnce(&mut <G as PatchFromTemplate>::Template, &mut ResolveContext<'_>),

Takes a “patch function” func, and turns it into a TemplatePatch.
Source§

impl<T> PatchTemplate for T
where T: Template,

Source§

fn patch_template<F>(func: F) -> TemplatePatch<F, T>
where F: FnOnce(&mut T, &mut ResolveContext<'_>),

Takes a “patch function” func that patches this Template, and turns it into a TemplatePatch.
Source§

impl<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, Base> RefNum<Base> for T
where T: NumOps<Base, Base> + for<'r> NumOps<&'r Base, Base>,

Source§

impl<T> Reflectable for T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<Borrowed> SampleBorrow<Borrowed> for Borrowed
where Borrowed: SampleUniform,

Source§

fn borrow(&self) -> &Borrowed

Immutably borrows from an owned value. See Borrow::borrow
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T> Settings for T
where T: 'static + Send + Sync,

Source§

impl<Ret> SpawnIfAsync<(), Ret> for Ret

Source§

fn spawn(self) -> Ret

Spawn the value into the dioxus runtime if it is an async block
Source§

impl<V> StableInterpolate for V
where V: NormedVectorSpace<Scalar = f32>,

Source§

fn interpolate_stable(&self, other: &V, t: f32) -> V

Interpolate between this value and the other given value using the parameter t. At t = 0.0, a value equivalent to self is recovered, while t = 1.0 recovers a value equivalent to other, with intermediate values interpolating between the two. See the trait-level documentation for details.
Source§

fn interpolate_stable_assign(&mut self, other: &Self, t: f32)

A version of interpolate_stable that assigns the result to self for convenience. Read more
Source§

fn smooth_nudge(&mut self, target: &Self, decay_rate: f32, delta: f32)

Smoothly nudge this value towards the target at a given decay rate. The decay_rate parameter controls how fast the distance between self and target decays relative to the units of delta; the intended usage is for decay_rate to generally remain fixed, while delta is something like delta_time from an updating system. This produces a smooth following of the target that is independent of framerate. Read more
Source§

impl<T, O> SuperFrom<T> for O
where O: From<T>,

Source§

fn super_from(input: T) -> O

Convert from a type to another type.
Source§

impl<T, O, M> SuperInto<O, M> for T
where O: SuperFrom<T, M>,

Source§

fn super_into(self) -> O

Convert from a type to another type.
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> Template for T
where T: Clone + Unpin,

Source§

type Output = T

The type of value produced by this Template.
Source§

fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>

Uses this template and the given entity context to produce a Template::Output.
Source§

fn clone_template(&self) -> T

Clones this template. See Clone.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T> ToSmolStr for T
where T: Display + ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> TryStableInterpolate for T

Source§

type Error = !

Error produced when the value cannot be interpolated.
Source§

fn try_interpolate_stable( &self, other: &T, t: f32, ) -> Result<T, <T as TryStableInterpolate>::Error>

Attempt to interpolate the value. This may fail if the two interpolation values have different units, or if the type is not interpolable.
Source§

fn try_interpolate_stable_assign( &mut self, other: &T, t: f32, ) -> Result<(), <T as TryStableInterpolate>::Error>

A version of try_interpolate_stable that assigns the result to self for convenience. On failure, self remains unchanged. Read more
Source§

fn try_smooth_nudge( &mut self, target: &Self, decay_rate: f32, delta: f32, ) -> Result<(), Self::Error>

Source§

impl<T> TypeData for T
where T: 'static + Send + Sync + Clone,

Source§

fn clone_type_data(&self) -> Box<dyn TypeData>

Creates a type-erased clone of self.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more