unreal.OrientedBox

class unreal.OrientedBox(origin: Vector = Ellipsis, orientation: Rotator = Ellipsis, extent: Vector = Ellipsis)

Bases: StructBase

Structure for arbitrarily oriented boxes (i.e. not necessarily axis-aligned). note: The full C++ class is located here: EngineSourceRuntimeCorePublicMathOrientedBox.h

C++ Source:

  • Module: CoreUObject

  • File: NoExportTypes.h

Editor Properties: (see get_editor_property/set_editor_property)

  • axis_x (Vector): [Read-Write] Holds the x-axis vector of the box. Must be a unit vector.

  • axis_y (Vector): [Read-Write] Holds the y-axis vector of the box. Must be a unit vector.

  • axis_z (Vector): [Read-Write] Holds the z-axis vector of the box. Must be a unit vector.

  • center (Vector): [Read-Write] Holds the center of the box.

  • extent_x (double): [Read-Write] Holds the extent of the box along its x-axis.

  • extent_y (double): [Read-Write] Holds the extent of the box along its y-axis.

  • extent_z (double): [Read-Write] Holds the extent of the box along its z-axis.

property axis_x: Vector

[Read-Only] Holds the x-axis vector of the box. Must be a unit vector.

Type:

(Vector)

property axis_y: Vector

[Read-Only] Holds the y-axis vector of the box. Must be a unit vector.

Type:

(Vector)

property axis_z: Vector

[Read-Only] Holds the z-axis vector of the box. Must be a unit vector.

Type:

(Vector)

property center: Vector

[Read-Write] Holds the center of the box.

Type:

(Vector)

convert_oriented_box_to_axis_aligned_box() Box

Find the bounding Box enclosing the input Oriented Box.

Return type:

Box

property extent_x: float

[Read-Write] Holds the extent of the box along its x-axis.

Type:

(double)

property extent_y: float

[Read-Write] Holds the extent of the box along its y-axis.

Type:

(double)

property extent_z: float

[Read-Write] Holds the extent of the box along its z-axis.

Type:

(double)

find_closest_point_on_oriented_box(point) -> (Vector, is_inside_or_on=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

Parameters:

point (Vector)

Returns:

is_inside_or_on (bool): if the Point is inside or on the Box, this will return as true, otherwise false

Return type:

bool

get_expanded_oriented_box(expand_by, min_extent=0.000000) OrientedBox

Get the Oriented Box with extents expanded by the ExpandBy vector Can also shrink the box if negative ExpandBy values are provided, but will clamp to Max(0, MinExtent)

Parameters:
  • expand_by (Vector)

  • min_extent (double)

Return type:

OrientedBox

get_oriented_box_corner(corner_index) Vector

Get the position of a corner of the Oriented Box. Corners are indexed from 0 to 7: Corner 0 is in the negative direction along each axis, 1/2/3 are along +Z/+Y/+X from the corner 0, 7 is the all-positive direction corner, and 4/5/6 are along -Z/-Y/-X from the corner 7.

Parameters:

corner_index (int32)

Return type:

Vector

get_oriented_box_face_center(face_index) -> (Vector, face_normal=Vector)

Get the position of the center of a face of the Oriented Box. Faces are indexed from 0 to 5, using an ordering where 0/1 are the negative then positive Z-axis faces, 2/3 are Y-axis faces, and 4/5 are X-axis faces

Parameters:

face_index (int32)

Returns:

face_normal (Vector): returned Normal vector of the identified face

Return type:

Vector

get_oriented_box_orientation() Rotator

Get the orientation of an Oriented Box

Return type:

Rotator

get_oriented_box_volume_area() -> (volume=double, surface_area=double)

Get the Volume and Surface Area of an Oriented Box

Returns:

volume (double):

surface_area (double):

Return type:

tuple

get_transformed_oriented_box(transform) OrientedBox

Apply the Transform to the Oriented Box

Parameters:

transform (Transform)

Return type:

OrientedBox

test_oriented_box_oriented_box_intersection(box2) bool

Test if two oriented boxes intersect

Parameters:

box2 (OrientedBox)

Return type:

bool

test_point_inside_or_on_oriented_box(point) bool

Test if a Point is inside or on the Box, returning true if so, otherwise false

Parameters:

point (Vector)

Return type:

bool