API Docs for: 1.4.0
Show:

Kiwi.Geom.AABB Class

Defined in: src\geom\AABB.ts:11
Module: Geom
Parent Module: Kiwi

An object representation of an axis-aligned bounding box.

Constructor

Kiwi.Geom.AABB

(
  • cx
  • cy
  • width
  • height
)
Kiwi.Geom.AABB

Defined in src\geom\AABB.ts:11

Parameters:

  • cx Number

    The centeral position on the x-axis.

  • cy Number

    The centeral position on the y-axis.

  • width Number

    The width of the box.

  • height Number

    The height of the box.

Returns:

Methods

draw

(
  • ctx
)
Kiwi.Geom.AABB public

Defined in src\geom\AABB.ts:97

Draws the object to a canvas context passed.

Parameters:

  • ctx CanvasRenderingContext2D

    The context you want this drawn to.

Returns:

fromRect

(
  • rect
)
Kiwi.Geom.AABB public

Gives the dimension of this AABB from a rectangle's.

Parameters:

Returns:

objType

() String public

Defined in src\geom\AABB.ts:33

Returns the type of this object

Returns:

String:

"AABB"

setPosition

(
  • cx
  • cy
)
Kiwi.Geom.AABB public

Sets the position of the object.

Parameters:

  • cx Number

    Its new x-axis location.

  • cy Number

    Its new y-axis location.

Returns:

setPositionPoint

(
  • pos
)
Kiwi.Geom.AABB public

Sets the position of the object by a point that you pass.

Parameters:

Returns:

toRect

() Kiwi.Geom.Rectangle public

Returns this object but as a new Rectangle.

Properties

cx

Number public

Defined in src\geom\AABB.ts:43

The centeral location of the box on the x-axis.

cy

Number public

Defined in src\geom\AABB.ts:51

The centeral location of the box on the y-axis.

halfHeight

Number public

Defined in src\geom\AABB.ts:67

Half of the height.

halfWidth

Number public

Defined in src\geom\AABB.ts:59

Half of the width.

height

Number public

Defined in src\geom\AABB.ts:75

Returns the full height. This is read only.

width

Number public

Defined in src\geom\AABB.ts:86

Returns the full width. This is read only.