BoundingSphere

class BoundingSphere(val centerWorldPosition: FloatArray = FloatArray(3), radius: Float = 0.0f)

Represents a BoundingSphere in 3D space defined by a center position and radius.

Parameters

centerWorldPosition

The center position of the BoundingSphere in world coordinates.

radius

The radius of the BoundingSphere.

Constructors

Link copied to clipboard
constructor(centerWorldPosition: FloatArray = FloatArray(3), radius: Float = 0.0f)

Properties

Link copied to clipboard

The transformed center position of the BoundingSphere in world coordinates.

Link copied to clipboard

The radius of the BoundingSphere.

Functions

Link copied to clipboard
fun hitTest(quaternion: Quaternion): Boolean

Performs a hit test with the given quaternion and the BoundingSphere.

fun hitTest(originWorldPosition: FloatArray, destWorldPosition: FloatArray): Boolean

Performs a hit test between the BoundingSphere and the ray defined by the origin & destination points.

Link copied to clipboard
fun isInside(worldPosition: FloatArray): Boolean

Returns true if the worldPosition is inside the BoundingSphere.

Link copied to clipboard

Returns true if the BoundingSphere intersects other.