Struct mgf::Ray [−][src]
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]
impl Ray
pub fn new(origin: Point3<f32>, dir: Vector3<f32>) -> Self
[src]
pub fn new(origin: Point3<f32>, dir: Vector3<f32>) -> Self
Create a new ray.
pub fn clamp(&self, t: f32) -> Segment
[src]
pub fn clamp(&self, t: f32) -> Segment
Clamp a ray's distance to create a segment.
Trait Implementations
impl Copy for Ray
[src]
impl Copy for Ray
impl Clone for Ray
[src]
impl Clone for Ray
fn clone(&self) -> Ray
[src]
fn clone(&self) -> Ray
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Ray
[src]
impl Debug for Ray
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl From<Segment> for Ray
[src]
impl From<Segment> for Ray
impl Add<Vector3<f32>> for Ray
[src]
impl Add<Vector3<f32>> for Ray
type Output = Self
The resulting type after applying the +
operator.
fn add(self, v: Vector3<f32>) -> Self
[src]
fn add(self, v: Vector3<f32>) -> Self
Performs the +
operation.
impl Sub<Vector3<f32>> for Ray
[src]
impl Sub<Vector3<f32>> for Ray
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, v: Vector3<f32>) -> Self
[src]
fn sub(self, v: Vector3<f32>) -> Self
Performs the -
operation.
impl AddAssign<Vector3<f32>> for Ray
[src]
impl AddAssign<Vector3<f32>> for Ray
fn add_assign(&mut self, v: Vector3<f32>)
[src]
fn add_assign(&mut self, v: Vector3<f32>)
Performs the +=
operation.
impl SubAssign<Vector3<f32>> for Ray
[src]
impl SubAssign<Vector3<f32>> for Ray
fn sub_assign(&mut self, v: Vector3<f32>)
[src]
fn sub_assign(&mut self, v: Vector3<f32>)
Performs the -=
operation.
impl Shape for Ray
[src]
impl Shape for Ray
fn center(&self) -> Point3<f32>
[src]
fn center(&self) -> Point3<f32>
Returns the center of mass of the geometry, assuming a regular density.
fn closest_point(&self, to: Point3<f32>) -> Point3<f32>
[src]
fn closest_point(&self, to: Point3<f32>) -> Point3<f32>
Returns the closest point on the shape to the given point.
fn set_pos(&mut self, p: Point3<f32>)
[src]
fn set_pos(&mut self, p: Point3<f32>)
Sets the center of the shape to p.
impl Particle for Ray
[src]
impl Particle for Ray
A ray represents a point particle traveling in a direction with infinite velocity.
const DT: f32
DT: f32 = f32::INFINITY
The length of the time step.
fn pos(&self) -> Point3<f32>
[src]
fn pos(&self) -> Point3<f32>
The origin of the particle.
fn dir(&self) -> Vector3<f32>
[src]
fn dir(&self) -> Vector3<f32>
The direction of the particle.
fn rotate_around<R: Rotation3<f32>>(&self, c: Point3<f32>, r: R) -> Self
[src]
fn rotate_around<R: Rotation3<f32>>(&self, c: Point3<f32>, r: R) -> Self
Rotate this particle around the world space of an object.