Box2

THREE.Box2
class Box2(val min: UndefOr[Vector2], val max: UndefOr[Vector2]) extends Object

Represents an axis-aligned bounding box (AABB) in 2D space.

Attributes

Graph
Supertypes
class Object
trait Any
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def clampPoint(point: Vector2, target: Vector2): Vector2

Clamps the given point within the bounds of this box.

Clamps the given point within the bounds of this box.

Attributes

def containsBox(box: Box2): Boolean

Returns true if this bounding box includes the entirety of the given bounding box.

Returns true if this bounding box includes the entirety of the given bounding box.

Attributes

def containsPoint(point: Vector2): Boolean

Returns true if the given point lies within or on the boundaries of this box.

Returns true if the given point lies within or on the boundaries of this box.

Attributes

def copy(box: Box2): this.type

Copies the values of the given box to this instance.

Copies the values of the given box to this instance.

Attributes

def distanceToPoint(point: Vector2): Double

Returns the euclidean distance from any edge of this box to the specified point.

Returns the euclidean distance from any edge of this box to the specified point.

Attributes

def equals(box: Box2): Boolean

Returns true if this bounding box is equal with the given one.

Returns true if this bounding box is equal with the given one.

Attributes

def expandByPoint(point: Vector2): this.type

Expands the boundaries of this box to include the given point.

Expands the boundaries of this box to include the given point.

Attributes

def expandByScalar(scalar: Double): this.type

Expands each dimension of the box by the given scalar.

Expands each dimension of the box by the given scalar.

Attributes

def expandByVector(vector: Vector2): this.type

Expands this box equilaterally by the given vector.

Expands this box equilaterally by the given vector.

Attributes

def getCenter(target: Vector2): Vector2

Returns the center point of this box.

Returns the center point of this box.

Attributes

def getParameter(point: Vector2, target: Vector2): Vector2

Returns a point as a proportion of this box's width and height.

Returns a point as a proportion of this box's width and height.

Attributes

def getSize(target: Vector2): Vector2

Returns the dimensions of this box.

Returns the dimensions of this box.

Attributes

def intersect(box: Box2): this.type

Computes the intersection of this bounding box and the given one.

Computes the intersection of this bounding box and the given one.

Attributes

def intersectsBox(box: Box2): Boolean

Returns true if the given bounding box intersects with this bounding box.

Returns true if the given bounding box intersects with this bounding box.

Attributes

def isEmpty(): Boolean

Returns true if this box includes zero points within its bounds.

Returns true if this box includes zero points within its bounds.

Attributes

def jsClone(): Box2

Returns a new box with copied values from this instance.

Returns a new box with copied values from this instance.

Attributes

def makeEmpty(): this.type

Makes this box empty which means in encloses a zero space in 2D.

Makes this box empty which means in encloses a zero space in 2D.

Attributes

def set(min: Vector2, max: Vector2): this.type

Sets the lower and upper boundaries of this box. Please note that this method only copies the values from the given objects.

Sets the lower and upper boundaries of this box. Please note that this method only copies the values from the given objects.

Attributes

def setFromCenterAndSize(center: Vector2, size: Vector2): this.type

Centers this box on the given center vector and sets this box's width and height to the given size values.

Centers this box on the given center vector and sets this box's width and height to the given size values.

Attributes

def setFromPoints(points: Array[Vector2]): this.type

Sets the upper and lower bounds of this box so it encloses the position data in the given array.

Sets the upper and lower bounds of this box so it encloses the position data in the given array.

Attributes

def translate(offset: Vector2): this.type

Adds the given offset to both the upper and lower bounds of this bounding box.

Adds the given offset to both the upper and lower bounds of this bounding box.

Attributes

def union(box: Box2): this.type

Computes the union of this box and another and the given one.

Computes the union of this box and another and the given one.

Attributes

Inherited methods

def hasOwnProperty(v: String): Boolean

Attributes

Inherited from:
Object
def isPrototypeOf(v: Object): Boolean

Attributes

Inherited from:
Object
def propertyIsEnumerable(v: String): Boolean

Attributes

Inherited from:
Object
def toLocaleString(): String

Attributes

Inherited from:
Object
def valueOf(): Any

Attributes

Inherited from:
Object

Concrete fields

val isBox2: Boolean

This flag can be used for type testing.

This flag can be used for type testing.

Attributes

val max: UndefOr[Vector2]
val min: UndefOr[Vector2]