Struct graphene::Plane[][src]

pub struct Plane(_);
Expand description

A 2D plane that extends infinitely in a 3D volume.

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

Implementations

Computes the distance of point from a Plane.

point

a Point3D

Returns

the distance of the given Point3D from the plane

Retrieves the distance along the normal vector of the given Plane from the origin.

Returns

the constant value of the plane

Retrieves the normal vector pointing towards the origin of the given Plane.

Returns

normal

return location for the normal vector

Initializes the given Plane using the given normal vector and constant values.

normal

a unit length normal vector defining the plane pointing towards the origin; if unset, we use the X axis by default

constant

the distance from the origin to the plane along the normal vector; the sign determines the half-space occupied by the plane

Returns

the initialized plane

Initializes the given Plane using the normal vector and constant of another Plane.

src

a Plane

Returns

the initialized plane

Initializes the given Plane using the given normal vector and an arbitrary co-planar point.

normal

a normal vector defining the plane pointing towards the origin

point

a Point3D

Returns

the initialized plane

Initializes the given Plane using the 3 provided co-planar points.

The winding order is counter-clockwise, and determines which direction the normal vector will point.

a

a Point3D

b

a Point3D

c

a Point3D

Returns

the initialized plane

Initializes the given Plane using the components of the given Vec4 vector.

src

a Vec4 containing the normal vector in its first three components, and the distance in its fourth component

Returns

the initialized plane

Negates the normal vector and constant of a Plane, effectively mirroring the plane across the origin.

Returns

res

return location for the negated plane

Normalizes the vector of the given Plane, and adjusts the constant accordingly.

Returns

res

return location for the normalized plane

Transforms a Plane self using the given matrix and normal_matrix.

If normal_matrix is None, a transformation matrix for the plane normal will be computed from matrix. If you are transforming multiple planes using the same matrix it’s recommended to compute the normal matrix beforehand to avoid incurring in the cost of recomputing it every time.

matrix

a Matrix

normal_matrix

a Matrix

Returns

res

the transformed plane

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.