[−][src]Struct mgf::Ray
A point and a direction with infinite distance.
Fields
p: Point3<f32>
The origin of the ray.
d: Vector3<f32>
The direction of the ray. Does not need to be normalized.
Methods
impl Ray
[src]
pub fn new(origin: Point3<f32>, dir: Vector3<f32>) -> Self
[src]
Create a new ray.
pub fn clamp(&self, t: f32) -> Segment
[src]
Clamp a ray's distance to create a segment.
Trait Implementations
impl Add<Vector3<f32>> for Ray
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, v: Vector3<f32>) -> Self
[src]
impl AddAssign<Vector3<f32>> for Ray
[src]
fn add_assign(&mut self, v: Vector3<f32>)
[src]
impl Clone for Ray
[src]
impl Copy for Ray
[src]
impl Debug for Ray
[src]
impl<'de> Deserialize<'de> for Ray
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl From<Segment> for Ray
[src]
impl Particle for Ray
[src]
A ray represents a point particle traveling in a direction with infinite velocity.
const DT: f32
[src]
fn pos(&self) -> Point3<f32>
[src]
fn dir(&self) -> Vector3<f32>
[src]
fn rotate_around<R: Rotation3<f32>>(&self, c: Point3<f32>, r: R) -> Self
[src]
impl Serialize for Ray
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl Shape for Ray
[src]
fn center(&self) -> Point3<f32>
[src]
fn closest_point(&self, to: Point3<f32>) -> Point3<f32>
[src]
fn set_pos(&mut self, p: Point3<f32>)
[src]
impl Sub<Vector3<f32>> for Ray
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, v: Vector3<f32>) -> Self
[src]
impl SubAssign<Vector3<f32>> for Ray
[src]
fn sub_assign(&mut self, v: Vector3<f32>)
[src]
Auto Trait Implementations
impl RefUnwindSafe for Ray
impl Send for Ray
impl Sync for Ray
impl Unpin for Ray
impl UnwindSafe for Ray
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,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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>,