unreal.Box
¶
- class unreal.Box(min: Vector = Ellipsis, max: Vector = Ellipsis)¶
Bases:
StructBase
A bounding box. note: The full C++ class is located here: EngineSourceRuntimeCorePublicMathBox.h
C++ Source:
Module: CoreUObject
File: NoExportTypes.h
Editor Properties: (see get_editor_property/set_editor_property)
is_valid
(bool): [Read-Write]max
(Vector): [Read-Write]min
(Vector): [Read-Write]
- find_box_box_intersection(box2) -> (Box, is_intersecting=bool)¶
Find the Box formed by the intersection of Box1 and Box2
- find_closest_point_on_box(point) -> (Vector, is_inside=bool)¶
Find the point on the faces of the Box that is closest to the input Point. If the Point is inside the Box, it is returned, ie points Inside do not project to the Box Faces
- get_box_box_distance(box2) double ¶
Calculate the minimum distance between Box1 and Box2
- Parameters:
box2 (Box) –
- Return type:
double
- get_box_center_size() -> (center=Vector, dimensions=Vector)¶
Get the Center point and X/Y/Z Dimensions of a Box (full dimensions, not Extents)
- Returns:
center (Vector):
dimensions (Vector):
- Return type:
tuple
- get_box_corner(corner_index) Vector ¶
Get the position of a corner of the Box. Corners are indexed from 0 to 7, using an ordering where 0 is the Min corner, 1/2/3 are +Z/+Y/+X from the Min corner, 7 is the Max corner, and 4/5/6 are -Z/-Y/-X from the Max corner.
- Parameters:
corner_index (int32) –
- Return type:
- get_box_face_center(face_index) -> (Vector, face_normal=Vector)¶
Get the position of the center of a face of the Box. Faces are indexed from 0 to 5, using an ordering where 0/1 are the MinZ/MaxZ faces, 2/3 are MinY/MaxY, and 4/5 are MinX/MaxX
- Parameters:
face_index (int32) –
- Returns:
face_normal (Vector): returned Normal vector of the identified face
- Return type:
- get_box_point_distance(point) double ¶
Calculate the minimum distance between the Box and the Point
- Parameters:
point (Vector) –
- Return type:
double
- get_box_volume_area() -> (volume=double, surface_area=double)¶
Get the Volume and Surface Area of a Box
- Returns:
volume (double):
surface_area (double):
- Return type:
tuple
- get_expanded_box(expand_by) Box ¶
Get the input Box expanded by adding the ExpandBy parameter to both the Min and Max. Dimensions will be clamped to the center point if any of ExpandBy are larger than half the box size
- get_transformed_box(transform) Box ¶
Apply the input Transform to the corners of the input Box, and return the new Box containing those points
- random_point_in_box_extents() Vector ¶
Returns a random point within the specified bounding box.
- Return type:
- test_box_sphere_intersection(sphere_center, sphere_radius) bool ¶
Check if the Box intersects a Sphere defined by the SphereCenter and SphereRadius