Category:Physics Engine/Bounding Boxes

From Inspired-Lua Wiki
Revision as of 09:37, 18 July 2012 by Adriweb (talk | contribs)
Jump to navigation Jump to search

Bounding Boxes

A bounding box is a structure the contains the left, bottom, right, and top edges of a box. Its type is TI.cpBB.


BB
bb = physics.BB(l, b, r, t)


Parameter Type Description
l in number left
b in number bottom
r in number right
t in number top
bb out physics.BB A bounding box with boundaries left, bottom, right, and top


Returns a new bounding box with the given initial edges.

Introduced in platform.apiLevel = '2.0'


b
bottom = physics.BB:b()


Parameter Type Description
self in physics.BB The input bounding box
bottom out number The bottom edge of the bounding box


Returns the bottom edge of the bounding box.

Introduced in platform.apiLevel = '2.0'


clampVect
cvec = physics.BB:clampVect(vec)


Parameter Type Description
self in physics.BB The input bounding box
vec in physics.Vect A vector
cvec out physics.Vect A vector clamped to the bounding box


Returns a copy of vec clamped to the bounding box.

Introduced in platform.apiLevel = '2.0'


containsBB
bool = physics.BB:containsBB(other)


Parameter Type Description
self in physics.BB The input bounding box
other in physics.BB The other bounding box
bool out boolean True if self completely contains the other bounding box


Determines if a bouding box contains another bounding box.

Introduced in platform.apiLevel = '2.0'


containsVect
bool = physics.BB:containsVect(vec)


Parameter Type Description
self in physics.BB The input bounding box
vec in physics.Vect A vector
bool out boolean True if self contains vector vec


Determines if a bounding box contains a vector.

Introduced in platform.apiLevel = '2.0'


expand
bb = phyics.BB:expand(vec)


Parameter Type Description
self in physics.BB The input bounding box
vec in physics.Vect A vector
bb out physics.BB The bounding box self expanded to include vector vec


Returns the bounding box that contains both self and vec.

Introduced in platform.apiLevel = '2.0'


intersects
bool = physics.BB:intersects(other)


Parameter Type Description
self in physics.BB The input bounding box
other in physics.BB The other bounding box
bool out boolean True if self intersects the other bounding box


Determines if two bounding boxes intersect.

Introduced in platform.apiLevel = '2.0'


l
left = physics.BB:l()


Parameter Type Description
self in physics.BB The input bounding box
left out number The left edge of the bounding box


Returns the left edge of the bounding box.

Introduced in platform.apiLevel = '2.0'


merge
bb = physics.BB:merge(other)


Parameter Type Description
self in physics.BB The input bounding box
other in physics.BB The other bounding box
bb out physics.BB The bounding box that contains both self and the other bounding box


Returns the bounding box that contains both self and the other bounding box.

Introduced in platform.apiLevel = '2.0'


setb
self = physics.BB:setb(bottom)


Parameter Type Description
self in physics.BB The input bounding box
bottom in number The new value for the bottom edge of the bounding box
self out physics.BB The input bounding box is returned as the output


Sets the bottom edge of the bounding box to a new value. Returns self.

Introduced in platform.apiLevel = '2.0'


r
right = physics.BB:r()


Parameter Type Description
self in physics.BB The input bounding box
right out number The right edge of the bounding box


Returns the right edge of the bounding box.

Introduced in platform.apiLevel = '2.0'


setl
self = physics.BB:setl(left)


Parameter Type Description
self in physics.BB The input bounding box
left in number The new value for the left edge of the bounding box
self out physics.BB The input bounding box is returned as the output


Sets the left edge of the bounding box to a new value. Returns self.

Introduced in platform.apiLevel = '2.0'


setr
self = physics.BB:setr(right)


Parameter Type Description
self in physics.BB The input bounding box
right in number The new value for the right edge of the bounding box
self out physics.BB The input bounding box is returned as the output


Sets the right edge of the bounding box to a new value. Returns self.

Introduced in platform.apiLevel = '2.0'


sett
self = physics.BB:sett(top)


Parameter Type Description
self in physics.BB The input bounding box
top in number The new value for the top edge of the bounding box
self out physics.BB The input bounding box is returned as the output


Sets the top edge of the bounding box to a new value. Returns self.

Introduced in platform.apiLevel = '2.0'


t
top = physics.BB:t()


Parameter Type Description
self in physics.BB The input bounding box
top out number The top edge of the bounding box


Returns the top edge of the bounding box.

Introduced in platform.apiLevel = '2.0'


wrapVect
wvec = physics.BB:wrapVect(vec)


Parameter Type Description
self in physics.BB The input bounding box
vec in physics.Vect A vector
wvec out physics.Vect A vector wrapped to the bounding box


Returns a copy of vec wrapped to the bounding box.

Introduced in platform.apiLevel = '2.0'

This category currently contains no pages or media.