Line 1: |
Line 1: |
− | ----
| + | ==== INFINITY ==== |
− | ----
| |
− | === Miscellaneous routines === | |
| | | |
− | ----
| + | <!-- code start--> |
− | | + | <pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">infinity = physics.misc.INFINITY() |
− | | + | </pre><!-- code end--> <!-- table start --> |
− | ===== INFINITY =====
| + | {| border="1" width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable sortable" |
− | | + | |- |
− | | + | ! Parameter |
− | <!-- code start--> | + | ! Type |
− | <pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd"> | + | ! Description <!-- header row end --> |
− | infinity = physics.misc.INFINITY() | |
− | </pre><!-- code end--> | |
− | | |
− | | |
− | <!-- table start --> | |
− | {| border=1 width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable sortable" | |
− | <!-- header row start -->
| |
− | ! Parameter !! Type !! Description | |
− | <!-- header row end --> | |
| |- | | |- |
− | | infinity | + | | infinity |
− | | '''out''' number | + | | '''out''' number |
− | | Infinity | + | | Infinity |
− | |}<!-- table end --> | + | |} |
| + | <!-- table end --> |
| + | <br> Returns a number representing infinity in the physics engine. |
| | | |
− | <br/>
| + | Introduced in platform.apiLevel = '2.0' |
− | Returns a number representing infinity in the physics engine.
| |
− | | |
− | Introduced in platform.apiLevel = '2.0' | |
| | | |
| ---- | | ---- |
| | | |
| + | <br> |
| | | |
− | ===== momentForBox =====
| + | ==== momentForBox ==== |
| | | |
− | | + | <!-- code start--> |
− | <!-- code start--> | + | <pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">inertia = physics.misc.momentForBox(mass, width, height) |
− | <pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd"> | + | </pre><!-- code end--> <!-- table start --> |
− | inertia = physics.misc.momentForBox(mass, width, height) | + | {| border="1" width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable sortable" |
− | </pre><!-- code end--> | + | |- |
− | | + | ! Parameter |
− | | + | ! Type |
− | <!-- table start --> | + | ! Description <!-- header row end --> |
− | {| border=1 width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable sortable" | |
− | <!-- header row start -->
| |
− | ! Parameter !! Type !! Description | |
− | <!-- header row end --> | |
| |- | | |- |
− | | mass | + | | mass |
− | | '''in''' number | + | | '''in''' number |
− | | The mass of the box | + | | The mass of the box |
| |- | | |- |
− | | width | + | | width |
− | | '''in''' number | + | | '''in''' number |
− | | The width of the box | + | | The width of the box |
| |- | | |- |
− | | height | + | | height |
− | | '''in''' number | + | | '''in''' number |
− | | The height of the box | + | | The height of the box |
| |- | | |- |
− | | inertia | + | | inertia |
− | | '''out''' number | + | | '''out''' number |
− | | The inertia of the box | + | | The inertia of the box |
− | |}<!-- table end --> | + | |} |
− | | + | <!-- table end --> |
− | <br/> | + | <br> This routine computes the moment of inertia for a solid box. This is a useful helper routine for computing the moment of inertia as an input to the physics.Body(...) constructor. |
− | This routine computes the moment of inertia for a solid box. This is a useful helper routine for computing the moment of inertia as an input to the [[#BodyCall|physics.Body(...) constructor]]. | |
| | | |
− | Introduced in platform.apiLevel = '2.0' | + | Introduced in platform.apiLevel = '2.0' |
| | | |
| ---- | | ---- |
− | ===== momentForCircle =====
| |
| | | |
| + | ==== momentForCircle ==== |
| | | |
− | <!-- 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">inertia = physics.misc.momentForCircle(mass, innerRadius, outerRadius, offBody) |
− | inertia = physics.misc.momentForCircle(mass, innerRadius, outerRadius, offBody) | + | </pre><!-- code end--> <!-- table start --> |
− | </pre><!-- code end--> | + | {| border="1" width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable sortable" |
− | | + | |- |
− | | + | ! Parameter |
− | <!-- table start --> | + | ! Type |
− | {| border=1 width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable sortable" | + | ! Description <!-- header row end --> |
− | <!-- header row start -->
| |
− | ! Parameter !! Type !! Description | |
− | <!-- header row end --> | |
| |- | | |- |
− | | mass | + | | mass |
− | | '''in''' number | + | | '''in''' number |
− | | The mass of the circle | + | | The mass of the circle |
| |- | | |- |
− | | innerRadius | + | | innerRadius |
− | | '''in''' number | + | | '''in''' number |
− | | The inner radius of the circle | + | | The inner radius of the circle |
| |- | | |- |
− | | outerRadius | + | | outerRadius |
− | | '''in''' number | + | | '''in''' number |
− | | The outer radius of the circle | + | | The outer radius of the circle |
| |- | | |- |
− | | offset | + | | offset |
− | | '''in''' physics.Vect | + | | '''in''' physics.Vect |
− | | The offset of the circle from the center of gravity | + | | The offset of the circle from the center of gravity |
| |- | | |- |
− | | inertia | + | | inertia |
− | | '''out''' number | + | | '''out''' number |
− | | The inertia of the circle | + | | The inertia of the circle |
− | |}<!-- table end --> | + | |} |
| + | <!-- table end --> |
| + | <br> This routine computes the moment of inertia for a circle. A solid circle has an inner radius of 0. This is a useful helper routine for computing the moment of inertia as an input to the physics.Body(...) constructor. |
| | | |
− | <br/>
| + | Introduced in platform.apiLevel = '2.0' |
− | This routine computes the moment of inertia for a [[#circle|circle]]. A solid circle has an inner radius of 0. This is a useful helper routine for computing the moment of inertia as an input to the [[#BodyCall|physics.Body(...) constructor]].
| |
− | | |
− | Introduced in platform.apiLevel = '2.0' | |
| | | |
| ---- | | ---- |
− | ===== momentForPoly =====
| |
| | | |
| + | ==== momentForPoly ==== |
| | | |
− | <!-- 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">inertia = physics.misc.momentForPoly(mass, vertices, offset) |
− | inertia = physics.misc.momentForPoly(mass, vertices, offset) | + | </pre><!-- code end--> <!-- table start --> |
− | </pre><!-- code end--> | + | {| border="1" width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable" |
− | | + | |- |
− | | + | ! Parameter |
− | <!-- table start --> | + | ! Type |
− | {| border=1 width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable sortable" | + | ! Description <!-- header row end --> |
− | <!-- header row start -->
| |
− | ! Parameter !! Type !! Description | |
− | <!-- header row end --> | |
| |- | | |- |
− | | mass | + | | mass |
− | | '''in''' number | + | | '''in''' number |
− | | The mass of the polygon | + | | The mass of the polygon |
| |- | | |- |
− | | vertices '''in''' <nowiki>{</nowiki>physics.Vect<nowiki>}</nowiki> | + | | vertices |
− | | A list of vertices defining the shape of the polygon | + | | '''in''' physics.Vect |
| + | | A list of vertices defining the shape of the polygon |
| |- | | |- |
− | | offset | + | | offset |
− | | '''in''' physics.Vect | + | | '''in''' physics.Vect |
− | | The offset of the polygon from the center of gravity | + | | The offset of the polygon from the center of gravity |
| |- | | |- |
− | | inertia | + | | inertia |
− | | '''out''' number | + | | '''out''' number |
− | | The inertia of the polygon | + | | The inertia of the polygon |
− | |}<!-- table end --> | + | |} |
− | | + | <!-- table end --> |
− | <br/> | + | <br> This routine computes the moment of inertia for a polygon. This is a useful helper routine for computing the moment of inertia as an input to the physics.Body(...) constructor. |
− | This routine computes the moment of inertia for a [[#polygon|polygon]]. This is a useful helper routine for computing the moment of inertia as an input to the [[#BodyCall|physics.Body(...) constructor]]. | |
| | | |
− | Introduced in platform.apiLevel = '2.0' | + | Introduced in platform.apiLevel = '2.0' |
| | | |
| ---- | | ---- |
− | ===== momentForSegment =====
| |
| | | |
| + | ==== momentForSegment ==== |
| | | |
− | <!-- 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">inertia = physics.misc.momentForSegment(mass, endPointA, endPointB) |
− | inertia = physics.misc.momentForSegment(mass, endPointA, endPointB) | + | </pre><!-- code end--> <!-- table start --> |
− | </pre><!-- code end--> | + | {| border="1" width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable sortable" |
− | | + | |- |
− | | + | ! Parameter |
− | <!-- table start --> | + | ! Type |
− | {| border=1 width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable sortable" | + | ! Description <!-- header row end --> |
− | <!-- header row start -->
| |
− | ! Parameter !! Type !! Description | |
− | <!-- header row end --> | |
| |- | | |- |
− | | mass | + | | mass |
− | | '''in''' number | + | | '''in''' number |
− | | The mass of the segment | + | | The mass of the segment |
| |- | | |- |
− | | endPointA | + | | endPointA |
− | | '''in''' physics.Vect | + | | '''in''' physics.Vect |
− | | The point defining one end of the segment | + | | The point defining one end of the segment |
| |- | | |- |
− | | endPointB | + | | endPointB |
− | | '''in''' physics.Vect | + | | '''in''' physics.Vect |
− | | The point defining the other end of the segment | + | | The point defining the other end of the segment |
| |- | | |- |
− | | inertia | + | | inertia |
− | | '''out''' number | + | | '''out''' number |
− | | The inertia of the segment | + | | The inertia of the segment |
− | |}<!-- table end --> | + | |} |
| + | <!-- table end --> |
| + | <br> This routine computes the moment of inertia for a segment. The end points can be in either world or local coordinates. This is a useful helper routine for computing the moment of inertia as an input to the physics.Body(...) constructor. |
| | | |
− | <br/>
| + | Introduced in platform.apiLevel = '2.0' |
− | This routine computes the moment of inertia for a [[#segment|segment]]. The end points can be in either world or local coordinates. This is a useful helper routine for computing the moment of inertia as an input to the [[#BodyCall|physics.Body(...) constructor]].
| |
| | | |
− | Introduced in platform.apiLevel = '2.0'
| + | [[Category:Physics_Engine]] |