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