Difference between revisions of "Category:Physics Engine/Misc"
(Created page with " Category:Physics_Engine") |
|||
| (5 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| + | ==== INFINITY ==== | ||
| − | [[Category:Physics_Engine]] | + | <!-- code start--> |
| + | <pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">infinity = physics.misc.INFINITY() | ||
| + | </pre><!-- code end--> <!-- table start --> | ||
| + | {| border="1" width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable sortable" | ||
| + | |- | ||
| + | ! Parameter | ||
| + | ! Type | ||
| + | ! Description <!-- header row end --> | ||
| + | |- | ||
| + | | infinity | ||
| + | | '''out''' number | ||
| + | | Infinity | ||
| + | |} | ||
| + | <!-- table end --> | ||
| + | <br> Returns a number representing infinity in the physics engine. | ||
| + | |||
| + | Introduced in platform.apiLevel = '2.0' | ||
| + | |||
| + | ---- | ||
| + | |||
| + | <br> | ||
| + | |||
| + | ==== momentForBox ==== | ||
| + | |||
| + | <!-- code start--> | ||
| + | <pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">inertia = physics.misc.momentForBox(mass, width, height) | ||
| + | </pre><!-- code end--> <!-- table start --> | ||
| + | {| border="1" width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable sortable" | ||
| + | |- | ||
| + | ! Parameter | ||
| + | ! Type | ||
| + | ! Description <!-- header row end --> | ||
| + | |- | ||
| + | | mass | ||
| + | | '''in''' number | ||
| + | | The mass of the box | ||
| + | |- | ||
| + | | width | ||
| + | | '''in''' number | ||
| + | | The width of the box | ||
| + | |- | ||
| + | | height | ||
| + | | '''in''' number | ||
| + | | The height of the box | ||
| + | |- | ||
| + | | inertia | ||
| + | | '''out''' number | ||
| + | | The inertia of the box | ||
| + | |} | ||
| + | <!-- table end --> | ||
| + | <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. | ||
| + | |||
| + | Introduced in platform.apiLevel = '2.0' | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== momentForCircle ==== | ||
| + | |||
| + | <!-- code start--> | ||
| + | <pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">inertia = physics.misc.momentForCircle(mass, innerRadius, outerRadius, offBody) | ||
| + | </pre><!-- code end--> <!-- table start --> | ||
| + | {| border="1" width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable sortable" | ||
| + | |- | ||
| + | ! Parameter | ||
| + | ! Type | ||
| + | ! Description <!-- header row end --> | ||
| + | |- | ||
| + | | mass | ||
| + | | '''in''' number | ||
| + | | The mass of the circle | ||
| + | |- | ||
| + | | innerRadius | ||
| + | | '''in''' number | ||
| + | | The inner radius of the circle | ||
| + | |- | ||
| + | | outerRadius | ||
| + | | '''in''' number | ||
| + | | The outer radius of the circle | ||
| + | |- | ||
| + | | offset | ||
| + | | '''in''' physics.Vect | ||
| + | | The offset of the circle from the center of gravity | ||
| + | |- | ||
| + | | inertia | ||
| + | | '''out''' number | ||
| + | | The inertia of the circle | ||
| + | |} | ||
| + | <!-- 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. | ||
| + | |||
| + | Introduced in platform.apiLevel = '2.0' | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== momentForPoly ==== | ||
| + | |||
| + | <!-- code start--> | ||
| + | <pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">inertia = physics.misc.momentForPoly(mass, vertices, offset) | ||
| + | </pre><!-- code end--> <!-- table start --> | ||
| + | {| border="1" width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable" | ||
| + | |- | ||
| + | ! Parameter | ||
| + | ! Type | ||
| + | ! Description <!-- header row end --> | ||
| + | |- | ||
| + | | mass | ||
| + | | '''in''' number | ||
| + | | The mass of the polygon | ||
| + | |- | ||
| + | | vertices | ||
| + | | '''in''' physics.Vect | ||
| + | | A list of vertices defining the shape of the polygon | ||
| + | |- | ||
| + | | offset | ||
| + | | '''in''' physics.Vect | ||
| + | | The offset of the polygon from the center of gravity | ||
| + | |- | ||
| + | | inertia | ||
| + | | '''out''' number | ||
| + | | The inertia of the polygon | ||
| + | |} | ||
| + | <!-- table end --> | ||
| + | <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. | ||
| + | |||
| + | Introduced in platform.apiLevel = '2.0' | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== momentForSegment ==== | ||
| + | |||
| + | <!-- code start--> | ||
| + | <pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">inertia = physics.misc.momentForSegment(mass, endPointA, endPointB) | ||
| + | </pre><!-- code end--> <!-- table start --> | ||
| + | {| border="1" width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable sortable" | ||
| + | |- | ||
| + | ! Parameter | ||
| + | ! Type | ||
| + | ! Description <!-- header row end --> | ||
| + | |- | ||
| + | | mass | ||
| + | | '''in''' number | ||
| + | | The mass of the segment | ||
| + | |- | ||
| + | | endPointA | ||
| + | | '''in''' physics.Vect | ||
| + | | The point defining one end of the segment | ||
| + | |- | ||
| + | | endPointB | ||
| + | | '''in''' physics.Vect | ||
| + | | The point defining the other end of the segment | ||
| + | |- | ||
| + | | inertia | ||
| + | | '''out''' number | ||
| + | | The inertia of the segment | ||
| + | |} | ||
| + | <!-- 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. | ||
| + | |||
| + | Introduced in platform.apiLevel = '2.0' | ||
| + | |||
| + | [[Category:Physics_Engine]] | ||
Latest revision as of 07:00, 18 July 2012
INFINITY
infinity = physics.misc.INFINITY()
| Parameter | Type | Description |
|---|---|---|
| infinity | out number | Infinity |
Returns a number representing infinity in the physics engine.
Introduced in platform.apiLevel = '2.0'
momentForBox
inertia = physics.misc.momentForBox(mass, width, height)
| Parameter | Type | Description |
|---|---|---|
| mass | in number | The mass of the box |
| width | in number | The width of the box |
| height | in number | The height of the box |
| inertia | out number | The inertia of the box |
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.
Introduced in platform.apiLevel = '2.0'
momentForCircle
inertia = physics.misc.momentForCircle(mass, innerRadius, outerRadius, offBody)
| Parameter | Type | Description |
|---|---|---|
| mass | in number | The mass of the circle |
| innerRadius | in number | The inner radius of the circle |
| outerRadius | in number | The outer radius of the circle |
| offset | in physics.Vect | The offset of the circle from the center of gravity |
| inertia | out number | The inertia of the circle |
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.
Introduced in platform.apiLevel = '2.0'
momentForPoly
inertia = physics.misc.momentForPoly(mass, vertices, offset)
| Parameter | Type | Description |
|---|---|---|
| mass | in number | The mass of the polygon |
| vertices | in physics.Vect | A list of vertices defining the shape of the polygon |
| offset | in physics.Vect | The offset of the polygon from the center of gravity |
| inertia | out number | The inertia of the polygon |
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.
Introduced in platform.apiLevel = '2.0'
momentForSegment
inertia = physics.misc.momentForSegment(mass, endPointA, endPointB)
| Parameter | Type | Description |
|---|---|---|
| mass | in number | The mass of the segment |
| endPointA | in physics.Vect | The point defining one end of the segment |
| endPointB | in physics.Vect | The point defining the other end of the segment |
| inertia | out number | The inertia of the segment |
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.
Introduced in platform.apiLevel = '2.0'
This category currently contains no pages or media.