Struct graphene::Point3D[][src]

pub struct Point3D(_);
Expand description

A point with three components: X, Y, and Z.

Implementations

Computes the cross product of the two given Point3D.

b

a Point3D

Returns

res

return location for the cross product

Computes the distance between the two given Point3D.

b

a Point3D

Returns

the distance between two points

delta

return location for the distance components on the X, Y, and Z axis

Computes the dot product of the two given Point3D.

b

a Point3D

Returns

the value of the dot product

Initializes a Point3D with the given coordinates.

x

the X coordinate of the point

y

the Y coordinate of the point

z

the Z coordinate of the point

Returns

the initialized Point3D

Initializes a Point3D using the coordinates of another Point3D.

src

a Point3D

Returns

the initialized point

Initializes a Point3D using the components of a Vec3.

v

a Vec3

Returns

the initialized Point3D

Linearly interpolates each component of self and b using the provided factor, and places the result in res.

b

a Point3D

factor

the interpolation factor

Returns

res

the return location for the interpolated Point3D

Computes the length of the vector represented by the coordinates of the given Point3D.

Returns

the length of the vector represented by the point

Checks whether the two points are near each other, within an epsilon factor.

b

a Point3D

epsilon

fuzzyness factor

Returns

true if the points are near each other

Computes the normalization of the vector represented by the coordinates of the given Point3D.

Returns

res

return location for the normalized Point3D

Normalizes the coordinates of a Point3D using the given viewport and clipping planes.

The coordinates of the resulting Point3D will be in the [ -1, 1 ] range.

viewport

a Rect representing a viewport

z_near

the coordinate of the near clipping plane, or 0 for the default near clipping plane

z_far

the coordinate of the far clipping plane, or 1 for the default far clipping plane

Returns

res

the return location for the normalized Point3D

Scales the coordinates of the given Point3D by the given factor.

factor

the scaling factor

Returns

res

return location for the scaled point

Stores the coordinates of a Point3D into a Vec3.

Returns

v

return location for a Vec3

Retrieves a constant point with all three coordinates set to 0.

Returns

a zero point

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.