Struct graphene::Box[][src]

pub struct Box(_);
Expand description

A 3D box, described as the volume between a minimum and a maximum vertices.

Implementations

Checks whether the Box self contains the given Box b.

b

a Box

Returns

true if the box is contained in the given box

Checks whether self contains the given point.

point

the coordinates to check

Returns

true if the point is contained in the given box

Expands the dimensions of self to include the coordinates at point.

point

the coordinates of the point to include

Returns

res

return location for the expanded box

Expands the dimensions of self by the given scalar value.

If scalar is positive, the Box will grow; if scalar is negative, the Box will shrink.

scalar

a scalar value

Returns

res

return location for the expanded box

Expands the dimensions of self to include the coordinates of the given vector.

vec

the coordinates of the point to include, as a Vec3

Returns

res

return location for the expanded box

Computes the bounding Sphere capable of containing the given Box.

Returns

sphere

return location for the bounding sphere

Retrieves the coordinates of the center of a Box.

Returns

center

return location for the coordinates of the center

Retrieves the size of the self on the Z axis.

Returns

the depth of the box

Retrieves the size of the self on the Y axis.

Returns

the height of the box

Retrieves the coordinates of the maximum point of the given Box.

Returns

max

return location for the maximum point

Retrieves the coordinates of the minimum point of the given Box.

Returns

min

return location for the minimum point

Retrieves the size of the box on all three axes, and stores it into the given size vector.

Returns

size

return location for the size

Retrieves the size of the self on the X axis.

Returns

the width of the box

Initializes the given Box with two vertices.

min

the coordinates of the minimum vertex

max

the coordinates of the maximum vertex

Returns

the initialized Box

Initializes the given Box with the vertices of another Box.

src

a Box

Returns

the initialized Box

Initializes the given Box with two vertices stored inside Vec3.

min

the coordinates of the minimum vertex

max

the coordinates of the maximum vertex

Returns

the initialized Box

Intersects the two given Box.

If the two boxes do not intersect, res will contain a degenerate box initialized with empty().

b

a Box

Returns

true if the two boxes intersect

res

return location for the result

Unions the two given Box.

b

the box to union to self

Returns

res

return location for the result

A degenerate Box that can only be expanded.

The returned value is owned by Graphene and should not be modified or freed.

Returns

a Box

A degenerate Box that cannot be expanded.

The returned value is owned by Graphene and should not be modified or freed.

Returns

a Box

A Box with the minimum vertex set at (-1, -1, -1) and the maximum vertex set at (0, 0, 0).

The returned value is owned by Graphene and should not be modified or freed.

Returns

a Box

A Box with the minimum vertex set at (0, 0, 0) and the maximum vertex set at (1, 1, 1).

The returned value is owned by Graphene and should not be modified or freed.

Returns

a Box

A Box with the minimum vertex set at (-1, -1, -1) and the maximum vertex set at (1, 1, 1).

The returned value is owned by Graphene and should not be modified or freed.

Returns

a Box

A Box with both the minimum and maximum vertices set at (0, 0, 0).

The returned value is owned by Graphene and should not be modified or freed.

Returns

a Box

Computes the vertices of the given Box.

Returns

vertices

return location for an array of 8 Vec3

Initializes the given Box with the given array of vertices.

If n_points is 0, the returned box is initialized with empty().

points

an array of Point3D

Returns

the initialized Box

Initializes the given Box with the given array of vertices.

If n_vectors is 0, the returned box is initialized with empty().

vectors

an array of Vec3

Returns

the initialized Box

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.