alloy::math::mat

Struct Col4

source
pub struct Col4(/* private fields */);
Expand description

A column of a 4x4 matrix.

Implementations§

source§

impl Col4

source

pub const fn to_vector4(&self) -> Vector4

Converts the column into a 4D owning vector.

source§

impl Col4

source

pub fn set_vec4(&mut self, vec: &Vec4)

Sets the column to the content of the other vector.

§Parameters
  • vec - The vector to set the column to.
source§

impl Col4

source

pub const unsafe fn index_unchecked(&self, index: usize) -> &f32

Returns the value at the specified index without doing any bounds checking.

§Safety

This function is unsafe because it does not check that the index is less than the length of the column.

§Parameters
  • index - The index of the value to return.
source

pub unsafe fn index_mut_unchecked(&mut self, index: usize) -> &mut f32

Returns a mutable reference to the value at the specified index without doing any bounds checking.

§Safety

This function is unsafe because it does not check that the index is less than the length of the column.

§Parameters
  • index - The index of the value to return.

Methods from Deref<Target = StridedSlice<f32, 4>>§

source

pub fn len(&self) -> usize

Returns the number of elements in the strided slice.

source

pub fn is_empty(&self) -> bool

Returns true if the slice has a length of 0.

source

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the slice’s buffer.

The caller must ensure that the slice outlives the pointer this function returns, or else it will end up pointing to garbage.

The caller must also ensure that the memory the pointer (non-transitively) points to is never written to (except inside an UnsafeCell) using this pointer or any pointer derived from it. If you need to mutate the contents of the slice, use [as_mut_ptr].

Modifying the container referenced by this slice may cause its buffer to be reallocated, which would also make any pointers to it invalid.

source

pub fn as_mut_ptr(&mut self) -> *mut T

Returns an unsafe mutable pointer to the slice’s buffer.

The caller must ensure that the slice outlives the pointer this function returns, or else it will end up pointing to garbage.

Modifying the container referenced by this slice may cause its buffer to be reallocated, which would also make any pointers to it invalid.

source

pub fn first(&self) -> Option<&T>

Returns a reference to the first element of the slice, or None if it is empty.

source

pub fn first_mut(&mut self) -> Option<&mut T>

Returns a mutable pointer to the first element of the slice, or None if it is empty.

source

pub fn last(&self) -> Option<&T>

Returns a reference to the last item in the slice, or None if it is empty.

source

pub fn last_mut(&mut self) -> Option<&mut T>

Returns a mutable pointer to the last item in the slice.

source

pub fn iter(&self) -> impl Iterator<Item = &T>

Returns an iterator over the slice.

source

pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut T>

Returns a mutable iterator over the slice.

source

pub unsafe fn index_unchecked(&self, index: usize) -> &T

Retrieves the value at the given index without doing proper bounds checking.

§Parameters
  • index - the index to access
§Safety

index must be within the reachable bounds of the slice, or the result is undefined behavior.

source

pub unsafe fn index_mut_unchecked(&mut self, index: usize) -> &mut T

Retrieves the a mutable reference to the given index without doing proper bounds checking.

§Parameters
  • index - the index to access
§Safety

index must be within the reachable bounds of the slice, or the result is undefined behavior.

Trait Implementations§

source§

impl Deref for Col4

source§

type Target = StridedSlice<f32, 4>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Col4

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Dot<Col4> for Vec4

source§

type Output = f32

The output of this operation. Read more
source§

fn dot(&self, other: &Col4) -> Self::Output

Performs the dot-product between two values, and returns the output value. Read more
source§

impl Dot<Vec4> for Col4

source§

type Output = f32

The output of this operation. Read more
source§

fn dot(&self, other: &Vec4) -> Self::Output

Performs the dot-product between two values, and returns the output value. Read more
source§

impl Dot for Col4

source§

type Output = f32

The output of this operation. Read more
source§

fn dot(&self, other: &Self) -> Self::Output

Performs the dot-product between two values, and returns the output value. Read more
source§

impl Index<Range<usize>> for Col4

source§

type Output = Col4

The returned type after indexing.
source§

fn index(&self, index: Range<usize>) -> &Self::Output

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

impl Index<RangeFrom<usize>> for Col4

source§

type Output = Col4

The returned type after indexing.
source§

fn index(&self, index: RangeFrom<usize>) -> &Self::Output

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

impl Index<RangeFull> for Col4

source§

type Output = Col4

The returned type after indexing.
source§

fn index(&self, _: RangeFull) -> &Self::Output

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

impl Index<RangeInclusive<usize>> for Col4

source§

type Output = Col4

The returned type after indexing.
source§

fn index(&self, index: RangeInclusive<usize>) -> &Self::Output

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

impl Index<RangeTo<usize>> for Col4

source§

type Output = Col4

The returned type after indexing.
source§

fn index(&self, index: RangeTo<usize>) -> &Self::Output

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

impl Index<RangeToInclusive<usize>> for Col4

source§

type Output = Col4

The returned type after indexing.
source§

fn index(&self, index: RangeToInclusive<usize>) -> &Self::Output

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

impl Index<usize> for Col4

source§

type Output = f32

The returned type after indexing.
source§

fn index(&self, index: usize) -> &Self::Output

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

impl IndexMut<Range<usize>> for Col4

source§

fn index_mut(&mut self, index: Range<usize>) -> &mut Self::Output

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

impl IndexMut<RangeFrom<usize>> for Col4

source§

fn index_mut(&mut self, index: RangeFrom<usize>) -> &mut Self::Output

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

impl IndexMut<RangeFull> for Col4

source§

fn index_mut(&mut self, _: RangeFull) -> &mut Self::Output

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

impl IndexMut<RangeInclusive<usize>> for Col4

source§

fn index_mut(&mut self, index: RangeInclusive<usize>) -> &mut Self::Output

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

impl IndexMut<RangeTo<usize>> for Col4

source§

fn index_mut(&mut self, index: RangeTo<usize>) -> &mut Self::Output

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

impl IndexMut<RangeToInclusive<usize>> for Col4

source§

fn index_mut(&mut self, index: RangeToInclusive<usize>) -> &mut Self::Output

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

impl IndexMut<usize> for Col4

source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

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

Auto Trait Implementations§

§

impl Freeze for Col4

§

impl RefUnwindSafe for Col4

§

impl Send for Col4

§

impl !Sized for Col4

§

impl Sync for Col4

§

impl Unpin for Col4

§

impl UnwindSafe for Col4

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> 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