#[repr(transparent)]
pub struct Point3D { /* private fields */ }
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

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

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 components of a Vec3.

v

a Vec3

Returns

the initialized Point3D

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

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

This method tests for !=.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Ensures that the type has been registered with the type system.

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)

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

Returns a SendValue clone of self.

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.