Struct graphene::Ray[][src]

pub struct Ray(_);
Expand description

A ray emitted from an origin in a given direction.

The contents of the graphene_ray_t structure are private, and should not be modified directly.

Implementations

Computes the point on the given Ray that is closest to the given point p.

p

a Point3D

Returns

res

return location for the closest point3d

Retrieves the direction of the given Ray.

Returns

direction

return location for the direction

Computes the distance of the origin of the given Ray from the given plane.

If the ray does not intersect the plane, this function returns INFINITY.

p

a Plane

Returns

the distance of the origin of the ray from the plane

Computes the distance of the closest approach between the given Ray self and the point p.

The closest approach to a ray from a point is the distance between the point and the projection of the point on the ray itself.

p

a Point3D

Returns

the distance of the point

Retrieves the origin of the given Ray.

Returns

origin

return location for the origin

Retrieves the coordinates of a point at the distance t along the given Ray.

t

the distance along the ray

Returns

position

return location for the position

Initializes the given Ray using the given origin and direction values.

origin

the origin of the ray

direction

the direction vector

Returns

the initialized ray

Initializes the given Ray using the origin and direction values of another Ray.

src

a Ray

Returns

the initialized ray

Initializes the given Ray using the given vectors.

origin

a Vec3

direction

a Vec3

Returns

the initialized ray

Intersects the given Ray self with the given Box b.

b

a Box

Returns

the type of intersection

t_out

the distance of the point on the ray that intersects the box

Intersects the given Ray self with the given Sphere s.

s

a Sphere

Returns

the type of intersection

t_out

the distance of the point on the ray that intersects the sphere

Intersects the given Ray self with the given Triangle t.

t

a Triangle

Returns

the type of intersection

t_out

the distance of the point on the ray that intersects the triangle

Checks whether the given Ray self intersects the given Box b.

See also: intersect_box()

b

a Box

Returns

true if the ray intersects the box

Checks if the given Ray self intersects the given Sphere s.

See also: intersect_sphere()

s

a Sphere

Returns

true if the ray intersects the sphere

Checks whether the given Ray self intersects the given Triangle b.

See also: intersect_triangle()

t

a Triangle

Returns

true if the ray intersects the triangle

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Returns the type identifier of Self.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.