containsPoint method

bool containsPoint(
  1. Vector3 point
)

Returns true if the given point is inside this OBB.

Implementation

bool containsPoint(Vector3 point ) {
	_v1.subVectors( point, center );
	rotation.extractBasis( _xAxis, _yAxis, _zAxis );

	// project v1 onto each axis and check if these points lie inside the OBB
	return _v1.dot( _xAxis ).abs() <= halfSizes.x &&
			_v1.dot( _yAxis ).abs() <= halfSizes.y &&
			_v1.dot( _zAxis ).abs() <= halfSizes.z;
}