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