rapier2d/utils/
component_mul.rs1use crate::math::Vector;
4#[cfg(not(target_arch = "spirv"))]
5use crate::utils::SimdRealCopy;
6#[cfg(not(target_arch = "spirv"))]
7use na::{Vector2, Vector3};
8
9pub trait ComponentMul: Sized {
11 fn component_mul(&self, other: &Self) -> Self;
13}
14
15impl ComponentMul for Vector {
16 #[inline]
17 fn component_mul(&self, other: &Self) -> Self {
18 *self * *other
19 }
20}
21
22#[cfg(not(target_arch = "spirv"))]
24impl<N: SimdRealCopy> ComponentMul for Vector2<N> {
25 #[inline]
26 fn component_mul(&self, other: &Self) -> Self {
27 nalgebra::Vector2::component_mul(self, other)
28 }
29}
30
31#[cfg(not(target_arch = "spirv"))]
32impl<N: SimdRealCopy> ComponentMul for Vector3<N> {
33 #[inline]
34 fn component_mul(&self, other: &Self) -> Self {
35 nalgebra::Vector3::component_mul(self, other)
36 }
37}