Difference between revisions of "Category:Physics Engine/Bounding Boxes"

From Inspired-Lua Wiki
Jump to navigation Jump to search
(Created page with "A bounding box is a structure the contains the left, bottom, right, and top edges of a box. Its type is TI.cpBB. Category:Physics_Engine")
 
Line 1: Line 1:
 +
 +
=== Bounding Boxes ===
 +
 
A bounding box is a structure the contains the left, bottom, right, and top edges of a box.
 
A bounding box is a structure the contains the left, bottom, right, and top edges of a box.
 +
Its type is TI.cpBB.
 +
 +
----
 +
===== BB =====
 +
 +
 +
<!-- code start-->
 +
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">
 +
bb = physics.BB(l, b, r, t)
 +
</pre><!-- code end-->
 +
 +
 +
<!-- table start -->
 +
{| border=1  width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable"
 +
<!-- header row start -->
 +
! Parameter !! Type !! Description
 +
<!-- header row end -->
 +
|-
 +
|  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
 +
|}<!-- table end -->
 +
 +
<br/>
 +
Returns a new bounding box with the given initial edges.
 +
 +
Introduced in platform.apiLevel = '2.0'
 +
 +
----
 +
===== b =====
 +
 +
 +
<!-- code start-->
 +
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">
 +
bottom = physics.BB:b()
 +
</pre><!-- code end-->
 +
 +
 +
<!-- table start -->
 +
{| border=1  width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable"
 +
<!-- header row start -->
 +
! Parameter !! Type !! Description
 +
<!-- header row end -->
 +
|-
 +
|  self
 +
|  '''in''' physics.BB
 +
|  The input bounding box
 +
|-
 +
|  bottom
 +
|  '''out''' number
 +
|  The bottom edge of the bounding box
 +
|}<!-- table end -->
 +
 +
<br/>
 +
Returns the bottom edge of the bounding box.
 +
 +
Introduced in platform.apiLevel = '2.0'
 +
 +
----
 +
===== clampVect =====
 +
 +
 +
<!-- code start-->
 +
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">
 +
cvec = physics.BB:clampVect(vec)
 +
</pre><!-- code end-->
 +
 +
 +
<!-- table start -->
 +
{| border=1  width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable"
 +
<!-- header row start -->
 +
! Parameter !! Type !! Description
 +
<!-- header row end -->
 +
|-
 +
|  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
 +
|}<!-- table end -->
 +
 +
<br/>
 +
Returns a copy of ''vec'' clamped to the bounding box.
 +
 +
Introduced in platform.apiLevel = '2.0'
 +
 +
----
 +
===== containsBB =====
 +
 +
 +
<!-- code start-->
 +
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">
 +
bool = physics.BB:containsBB(other)
 +
</pre><!-- code end-->
 +
 +
 +
<!-- table start -->
 +
{| border=1  width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable"
 +
<!-- header row start -->
 +
! Parameter !! Type !! Description
 +
<!-- header row end -->
 +
|-
 +
|  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
 +
|}<!-- table end -->
 +
 +
<br/>
 +
Determines if a bouding box contains another bounding box.
 +
 +
Introduced in platform.apiLevel = '2.0'
 +
 +
----
 +
===== containsVect =====
 +
 +
 +
<!-- code start-->
 +
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">
 +
bool = physics.BB:containsVect(vec)
 +
</pre><!-- code end-->
 +
 +
 +
<!-- table start -->
 +
{| border=1  width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable"
 +
<!-- header row start -->
 +
! Parameter !! Type !! Description
 +
<!-- header row end -->
 +
|-
 +
|  self
 +
|  '''in''' physics.BB
 +
|  The input bounding box
 +
|-
 +
|  vec
 +
|  '''in''' physics.Vect
 +
|  A vector
 +
|-
 +
|  bool
 +
|  '''out''' boolean
 +
|  True if ''self'' contains vector ''vec''
 +
|}<!-- table end -->
 +
 +
<br/>
 +
Determines if a bounding box contains a [[#vector|vector]].
 +
 +
Introduced in platform.apiLevel = '2.0'
 +
 +
----
 +
===== expand =====
 +
 +
 +
<!-- code start-->
 +
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">
 +
bb = phyics.BB:expand(vec)
 +
</pre><!-- code end-->
 +
 +
 +
<!-- table start -->
 +
{| border=1  width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable"
 +
<!-- header row start -->
 +
! Parameter !! Type !! Description
 +
<!-- header row end -->
 +
|-
 +
|  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''
 +
|}<!-- table end -->
 +
 +
<br/>
 +
Returns the bounding box that contains both ''self'' and ''vec''.
 +
 +
Introduced in platform.apiLevel = '2.0'
 +
 +
----
 +
===== intersects =====
 +
 +
 +
<!-- code start-->
 +
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">
 +
bool = physics.BB:intersects(other)
 +
</pre><!-- code end-->
 +
 +
 +
<!-- table start -->
 +
{| border=1  width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable"
 +
<!-- header row start -->
 +
! Parameter !! Type !! Description
 +
<!-- header row end -->
 +
|-
 +
|  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
 +
|}<!-- table end -->
 +
 +
<br/>
 +
Determines if two bounding boxes intersect.
 +
 +
Introduced in platform.apiLevel = '2.0'
 +
 +
----
 +
===== l =====
 +
 +
 +
<!-- code start-->
 +
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">
 +
left = physics.BB:l()
 +
</pre><!-- code end-->
 +
 +
 +
<!-- table start -->
 +
{| border=1  width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable"
 +
<!-- header row start -->
 +
! Parameter !! Type !! Description
 +
<!-- header row end -->
 +
|-
 +
|  self
 +
|  '''in''' physics.BB
 +
|  The input bounding box
 +
|-
 +
|  left
 +
|  '''out''' number
 +
|  The left edge of the bounding box
 +
|}<!-- table end -->
 +
 +
<br/>
 +
Returns the left edge of the bounding box.
 +
 +
Introduced in platform.apiLevel = '2.0'
 +
 +
----
 +
===== merge =====
 +
 +
 +
<!-- code start-->
 +
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">
 +
bb = physics.BB:merge(other)
 +
</pre><!-- code end-->
 +
 +
 +
<!-- table start -->
 +
{| border=1  width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable"
 +
<!-- header row start -->
 +
! Parameter !! Type !! Description
 +
<!-- header row end -->
 +
|-
 +
|  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
 +
|}<!-- table end -->
 +
 +
<br/>
 +
Returns the bounding box that contains both ''self'' and the ''other'' bounding box.
 +
 +
Introduced in platform.apiLevel = '2.0'
 +
 +
----
 +
===== setb =====
 +
 +
 +
<!-- code start-->
 +
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">
 +
self = physics.BB:setb(bottom)
 +
</pre><!-- code end-->
 +
 +
 +
<!-- table start -->
 +
{| border=1  width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable"
 +
<!-- header row start -->
 +
! Parameter !! Type !! Description
 +
<!-- header row end -->
 +
|-
 +
|  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
 +
|}<!-- table end -->
 +
 +
<br/>
 +
Sets the bottom edge of the bounding box to a new ''value''. Returns ''self''.
 +
 +
Introduced in platform.apiLevel = '2.0'
 +
 +
----
 +
===== r =====
 +
 +
 +
<!-- code start-->
 +
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">
 +
right = physics.BB:r()
 +
</pre><!-- code end-->
 +
 +
 +
<!-- table start -->
 +
{| border=1  width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable"
 +
<!-- header row start -->
 +
! Parameter !! Type !! Description
 +
<!-- header row end -->
 +
|-
 +
|  self
 +
|  '''in''' physics.BB
 +
|  The input bounding box
 +
|-
 +
|  right
 +
|  '''out''' number
 +
|  The right edge of the bounding box
 +
|}<!-- table end -->
 +
 +
<br/>
 +
Returns the right edge of the bounding box.
 +
 +
Introduced in platform.apiLevel = '2.0'
 +
 +
----
 +
===== setl =====
 +
 +
 +
<!-- code start-->
 +
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">
 +
self = physics.BB:setl(left)
 +
</pre><!-- code end-->
 +
 +
 +
<!-- table start -->
 +
{| border=1  width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable"
 +
<!-- header row start -->
 +
! Parameter !! Type !! Description
 +
<!-- header row end -->
 +
|-
 +
|  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
 +
|}<!-- table end -->
 +
 +
<br/>
 +
Sets the left edge of the bounding box to a new ''value''. Returns ''self''.
 +
 +
Introduced in platform.apiLevel = '2.0'
 +
 +
----
 +
===== setr =====
 +
 +
 +
<!-- code start-->
 +
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">
 +
self = physics.BB:setr(right)
 +
</pre><!-- code end-->
 +
 +
 +
<!-- table start -->
 +
{| border=1  width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable"
 +
<!-- header row start -->
 +
! Parameter !! Type !! Description
 +
<!-- header row end -->
 +
|-
 +
|  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
 +
|}<!-- table end -->
 +
 +
<br/>
 +
Sets the right edge of the bounding box to a new ''value''. Returns ''self''.
 +
 +
Introduced in platform.apiLevel = '2.0'
 +
 +
----
 +
===== sett =====
 +
 +
 +
<!-- code start-->
 +
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">
 +
self = physics.BB:sett(top)
 +
</pre><!-- code end-->
 +
 +
 +
<!-- table start -->
 +
{| border=1  width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable"
 +
<!-- header row start -->
 +
! Parameter !! Type !! Description
 +
<!-- header row end -->
 +
|-
 +
|  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
 +
|}<!-- table end -->
 +
 +
<br/>
 +
Sets the top edge of the bounding box to a new ''value''. Returns ''self''.
 +
 +
Introduced in platform.apiLevel = '2.0'
 +
 +
----
 +
===== t =====
 +
 +
 +
<!-- code start-->
 +
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">
 +
top = physics.BB:t()
 +
</pre><!-- code end-->
 +
 +
 +
<!-- table start -->
 +
{| border=1  width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable"
 +
<!-- header row start -->
 +
! Parameter !! Type !! Description
 +
<!-- header row end -->
 +
|-
 +
|  self
 +
|  '''in''' physics.BB
 +
|  The input bounding box
 +
|-
 +
|  top
 +
|  '''out''' number
 +
|  The top edge of the bounding box
 +
|}<!-- table end -->
 +
 +
<br/>
 +
Returns the top edge of the bounding box.
 +
 +
Introduced in platform.apiLevel = '2.0'
 +
 +
----
 +
===== wrapVect =====
 +
 +
 +
<!-- code start-->
 +
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">
 +
wvec = physics.BB:wrapVect(vec)
 +
</pre><!-- code end-->
 +
 +
 +
<!-- table start -->
 +
{| border=1  width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable"
 +
<!-- header row start -->
 +
! Parameter !! Type !! Description
 +
<!-- header row end -->
 +
|-
 +
|  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
 +
|}<!-- table end -->
 +
 +
<br/>
 +
Returns a copy of ''vec'' wrapped to the bounding box.
 +
 +
Introduced in platform.apiLevel = '2.0'
  
Its type is TI.cpBB.
 
  
 
[[Category:Physics_Engine]]
 
[[Category:Physics_Engine]]

Revision as of 10:37, 18 July 2012

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.