Kiwi.Geom.AABB Class
An object representation of an axis-aligned bounding box.
Constructor
Kiwi.Geom.AABB
(
Kiwi.Geom.AABB
-
cx
-
cy
-
width
-
height
Parameters:
-
cx
NumberThe centeral position on the x-axis.
-
cy
NumberThe centeral position on the y-axis.
-
width
NumberThe width of the box.
-
height
NumberThe height of the box.
Returns:
Item Index
Methods
Methods
draw
(
Kiwi.Geom.AABB
public
-
ctx
Draws the object to a canvas context passed.
Parameters:
-
ctx
CanvasRenderingContext2DThe context you want this drawn to.
Returns:
fromRect
(
Kiwi.Geom.AABB
public
-
rect
Gives the dimension of this AABB from a rectangle's.
Parameters:
-
rect
Kiwi.Geom.Rectangle
Returns:
objType
()
String
public
Returns the type of this object
Returns:
String:
"AABB"
setPosition
(
Kiwi.Geom.AABB
public
-
cx
-
cy
Sets the position of the object.
Parameters:
-
cx
NumberIts new x-axis location.
-
cy
NumberIts new y-axis location.
Returns:
setPositionPoint
(
Kiwi.Geom.AABB
public
-
pos
Sets the position of the object by a point that you pass.
Parameters:
-
pos
Kiwi.Geom.Point
Returns:
Properties
cx
Number
public
The centeral location of the box on the x-axis.
cy
Number
public
The centeral location of the box on the y-axis.
halfHeight
Number
public
Half of the height.
halfWidth
Number
public
Half of the width.
height
Number
public
Returns the full height. This is read only.
width
Number
public
Returns the full width. This is read only.