[−][src]Struct geng::prelude::Vec4
4 dimensional vector.
Fields
x: T
x
coordinate of the vector
y: T
y
coordinate of the vector
z: T
z
coordinate of the vector
w: T
w
coordinate of the vector
Implementations
impl<T> Vec4<T>
[src]
pub fn xy(self) -> Vec2<T>
[src]
pub fn xyz(self) -> Vec3<T>
[src]
pub fn map<U, F>(self, f: F) -> Vec4<U> where
F: Fn(T) -> U,
[src]
F: Fn(T) -> U,
impl<T> Vec4<T> where
T: Num + Copy,
[src]
T: Num + Copy,
pub fn dot(a: Vec4<T>, b: Vec4<T>) -> T
[src]
Calculate dot product of two vectors.
Examples
use batbox::*; assert_eq!(Vec4::dot(vec4(1, 2, 3, 4), vec4(3, 4, 5, 6)), 50);
Methods from Deref<Target = [T; 4]>
pub fn as_slice(&self) -> &[T]ⓘ
[src]
array_methods
)Returns a slice containing the entire array. Equivalent to &s[..]
.
pub fn as_mut_slice(&mut self) -> &mut [T]ⓘ
[src]
array_methods
)Returns a mutable slice containing the entire array. Equivalent to
&mut s[..]
.
Trait Implementations
impl<T> Add<Vec4<T>> for Vec4<T> where
T: Add<T, Output = T>,
[src]
T: Add<T, Output = T>,
type Output = Vec4<T>
The resulting type after applying the +
operator.
pub fn add(self, rhs: Vec4<T>) -> Vec4<T>
[src]
impl<T> AddAssign<Vec4<T>> for Vec4<T> where
T: AddAssign<T>,
[src]
T: AddAssign<T>,
pub fn add_assign(&mut self, rhs: Vec4<T>)
[src]
impl<U> AsUniform for Vec4<U> where
[U; 4]: Uniform,
[src]
[U; 4]: Uniform,
impl<T> Clone for Vec4<T> where
T: Clone,
[src]
T: Clone,
impl<T> Copy for Vec4<T> where
T: Copy,
[src]
T: Copy,
impl<T> Debug for Vec4<T> where
T: Debug,
[src]
T: Debug,
impl<T> Deref for Vec4<T>
[src]
impl<T> DerefMut for Vec4<T>
[src]
impl<'de, T> Deserialize<'de> for Vec4<T> where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Vec4<T>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
__deserializer: __D
) -> Result<Vec4<T>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl<T> Display for Vec4<T> where
T: Display,
[src]
T: Display,
impl<T> Div<T> for Vec4<T> where
T: Copy + Div<T, Output = T>,
[src]
T: Copy + Div<T, Output = T>,
type Output = Vec4<T>
The resulting type after applying the /
operator.
pub fn div(self, rhs: T) -> Vec4<T>
[src]
impl<T> DivAssign<T> for Vec4<T> where
T: Copy + DivAssign<T>,
[src]
T: Copy + DivAssign<T>,
pub fn div_assign(&mut self, rhs: T)
[src]
impl<T> Eq for Vec4<T> where
T: Eq,
[src]
T: Eq,
impl<T> From<[T; 4]> for Vec4<T>
[src]
impl<T> Hash for Vec4<T> where
T: Hash,
[src]
T: Hash,
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T> Mul<T> for Vec4<T> where
T: Copy + Mul<T, Output = T>,
[src]
T: Copy + Mul<T, Output = T>,
type Output = Vec4<T>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: T) -> Vec4<T>
[src]
impl<T> Mul<Vec4<T>> for Mat4<T> where
T: Num + Copy,
[src]
T: Num + Copy,
type Output = Vec4<T>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Vec4<T>) -> Vec4<T>
[src]
impl Mul<Vec4<f32>> for f32
[src]
type Output = Vec4<f32>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Vec4<f32>) -> Vec4<f32>
[src]
impl Mul<Vec4<f64>> for f64
[src]
type Output = Vec4<f64>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Vec4<f64>) -> Vec4<f64>
[src]
impl Mul<Vec4<i16>> for i16
[src]
type Output = Vec4<i16>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Vec4<i16>) -> Vec4<i16>
[src]
impl Mul<Vec4<i32>> for i32
[src]
type Output = Vec4<i32>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Vec4<i32>) -> Vec4<i32>
[src]
impl Mul<Vec4<i64>> for i64
[src]
type Output = Vec4<i64>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Vec4<i64>) -> Vec4<i64>
[src]
impl Mul<Vec4<i8>> for i8
[src]
type Output = Vec4<i8>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Vec4<i8>) -> Vec4<i8>
[src]
impl Mul<Vec4<isize>> for isize
[src]
type Output = Vec4<isize>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Vec4<isize>) -> Vec4<isize>
[src]
impl Mul<Vec4<u16>> for u16
[src]
type Output = Vec4<u16>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Vec4<u16>) -> Vec4<u16>
[src]
impl Mul<Vec4<u32>> for u32
[src]
type Output = Vec4<u32>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Vec4<u32>) -> Vec4<u32>
[src]
impl Mul<Vec4<u64>> for u64
[src]
type Output = Vec4<u64>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Vec4<u64>) -> Vec4<u64>
[src]
impl Mul<Vec4<u8>> for u8
[src]
type Output = Vec4<u8>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Vec4<u8>) -> Vec4<u8>
[src]
impl Mul<Vec4<usize>> for usize
[src]
type Output = Vec4<usize>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Vec4<usize>) -> Vec4<usize>
[src]
impl<T> MulAssign<T> for Vec4<T> where
T: Copy + MulAssign<T>,
[src]
T: Copy + MulAssign<T>,
pub fn mul_assign(&mut self, rhs: T)
[src]
impl<T> Neg for Vec4<T> where
T: Neg<Output = T>,
[src]
T: Neg<Output = T>,
type Output = Vec4<T>
The resulting type after applying the -
operator.
pub fn neg(self) -> Vec4<T>
[src]
impl<T> PartialEq<Vec4<T>> for Vec4<T> where
T: PartialEq<T>,
[src]
T: PartialEq<T>,
impl<T> Serialize for Vec4<T> where
T: Serialize,
[src]
T: Serialize,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
impl<T> StructuralEq for Vec4<T>
[src]
impl<T> StructuralPartialEq for Vec4<T>
[src]
impl<T> Sub<Vec4<T>> for Vec4<T> where
T: Sub<T, Output = T>,
[src]
T: Sub<T, Output = T>,
type Output = Vec4<T>
The resulting type after applying the -
operator.
pub fn sub(self, rhs: Vec4<T>) -> Vec4<T>
[src]
impl<T> SubAssign<Vec4<T>> for Vec4<T> where
T: SubAssign<T>,
[src]
T: SubAssign<T>,
pub fn sub_assign(&mut self, rhs: Vec4<T>)
[src]
impl<T> Trans for Vec4<T> where
T: Trans,
[src]
T: Trans,
pub fn create_schema() -> Schema
[src]
pub fn write_to(&self, writer: &mut dyn Write) -> Result<(), Error>
[src]
pub fn read_from(reader: &mut dyn Read) -> Result<Vec4<T>, Error>
[src]
impl VertexAttribute for Vec4<f32>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Vec4<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Vec4<T> where
T: Send,
T: Send,
impl<T> Sync for Vec4<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Vec4<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Vec4<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut Tⓘ
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> Diff for T where
T: 'static + PartialEq<T> + Send + Copy + Sync + for<'de> Deserialize<'de> + Serialize + Trans,
[src]
T: 'static + PartialEq<T> + Send + Copy + Sync + for<'de> Deserialize<'de> + Serialize + Trans,
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
pub fn __clone_box(&self, Private) -> *mut ()
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Message for T where
T: 'static + Send + Debug + for<'de> Deserialize<'de> + Serialize,
[src]
T: 'static + Send + Debug + for<'de> Deserialize<'de> + Serialize,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a Tⓘ
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut Tⓘ
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Uniform for T where
T: AsUniform,
[src]
T: AsUniform,
pub fn apply(&self, gl: &Context, info: &UniformInfo)
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,