API Docs for: 1.1.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
  • cy Number
  • width Number
  • height Number

Returns:

Methods

draw

(
  • ctx
)
Kiwi.Geom.AABB public

Defined in src\geom\AABB.ts:95

Draws the object to a canvas

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:

The type of this object

setPosition

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

Sets the position of the object.

Parameters:

  • cx Number
  • cy Number

Returns:

setPositionPoint

(
  • pos
)
Kiwi.Geom.AABB public

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

Parameters:

  • pos Point

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

cy

Number public

Defined in src\geom\AABB.ts:51

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:85

Returns the full width. This is read only.