API / geotoolkit3d / util / OrientedBoundingBox / OrientedBoundingBox
util.OrientedBoundingBox.OrientedBoundingBox
Represents an oriented bounding box (OBB) in 3D space.
It's different from axis-aligned bounding box i.e. THREE.Box3
Methods
Constructors
• new OrientedBoundingBox(center?, halfSize?, rotation?)
Oriented BoundingBox Constructor
| Name | Type | Description |
|---|---|---|
Optional center | Vector3 | the center point of this OBB |
Optional halfSize | Vector3 | positive halfwidth extents of the OBB along each axis |
Optional rotation | Matrix3 | the rotation of this OBB |
Methods
▸ clone(): OrientedBoundingBox
Copies the properties of the given OBB to this OBB
▸ containsPoint(point): boolean
Whether the given point lies within this OBB or not
| Name | Type | Description |
|---|---|---|
point | Vector3 | the point to test |
boolean
▸ copy(obb): OrientedBoundingBox
Copies the properties of the given OBB
| Name | Type | Description |
|---|---|---|
obb | OrientedBoundingBox | the obb to copy |
this
▸ equals(obb): boolean
Whether the given OBB is equal to this OBB or not
| Name | Type | Description |
|---|---|---|
obb | OrientedBoundingBox | the OBB to test |
boolean
▸ fromBox3(box3): OrientedBoundingBox
Define an OBB based on the given standard bounding box
| Name | Type | Description |
|---|---|---|
box3 | Box3 | standard bounding box |
this
▸ fromBox3WithTransformation(aabb, matrix): OrientedBoundingBox
Define this OBB based on the given AABB box and transformation matrix (essentially used when a AABB must receive a transformation/rotation, but we want to keep the box as small as possible for precision)
| Name | Type | Description |
|---|---|---|
aabb | Box3 | AABB box |
matrix | Matrix4 | matrix to transform the given AABB box. |
this
▸ getCenter(): Vector3
Get the center of this OBB
Vector3
center
▸ getClassName(): string
string
▸ getHalfSize(): Vector3
Get the half size of this OBB
Vector3
halfsize
▸ getRotation(): Matrix3
Get the rotation matrix of this OBB
Matrix3
rotation
▸ intersectsBox3(box3): boolean
Whether the given box3 intersects this OBB or not
| Name | Type | Description |
|---|---|---|
box3 | Box3 | the box3 to test |
boolean
▸ intersectsOrientedBoundingBox(obb, epsilon?): boolean
Return whether the given OBB intersects this OBB or not
| Name | Type | Description |
|---|---|---|
obb | OrientedBoundingBox | the OBB to test |
Optional epsilon | number | an optional numeric value to counteract arithmetic errors |
boolean
▸ intersectsPlane(plane): boolean
Whether the given plane intersects this OBB or not
| Name | Type | Description |
|---|---|---|
plane | Plane | the plane to test |
boolean
▸ set(center, halfSize, rotation): OrientedBoundingBox
Set center, halfSize, rotation for this OBB
| Name | Type | Description |
|---|---|---|
center | Vector3 | the center point of this OBB |
halfSize | Vector3 | positive halfwidth extents of the OBB along each axis |
rotation | Matrix3 | the rotation of this OBB |
this
▸ setCenter(center): OrientedBoundingBox
Set center for this OBB
| Name | Type | Description |
|---|---|---|
center | Vector3 | the center point of this OBB |
this
▸ setHalfSize(halfSize): OrientedBoundingBox
Set halfSize for this OBB
| Name | Type | Description |
|---|---|---|
halfSize | Vector3 | the center point of this OBB |
this
▸ setRotation(rotation): OrientedBoundingBox
Set rotation for this OBB
| Name | Type | Description |
|---|---|---|
rotation | Matrix3 | the rotation of this OBB |
this
▸ toThreeBox(target?): Box3
Set/create a THREE.Box3 from this orientedBoundingBox. The resulting THREE.Box3 might be bigger based on orientation.
| Name | Type | Description |
|---|---|---|
Optional target | Box3 | optional Box3 to set from this orientedBoundingBox. |
Box3
▸ Static getClassName(): string
string