Line 1: |
Line 1: |
| A CircleShape is a subclass of [[:Category:Physics Engine/Shapes|Shape]]. Its type is TI.cpCircleShape. | | A CircleShape is a subclass of [[:Category:Physics Engine/Shapes|Shape]]. Its type is TI.cpCircleShape. |
| | | |
− | | + | ---- |
− | [[Category:Physics Engine/Shapes]] | + | ===== CircleShape ===== |
| + | |
| + | |
| + | <!-- code start--> |
| + | <pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd"> |
| + | cs = physics.CircleShape(body, radius, offset) |
| + | </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 --> |
| + | |- |
| + | | body |
| + | | '''in''' physics.Body |
| + | | A Body or nil |
| + | |- |
| + | | radius |
| + | | '''in''' number |
| + | | The radius of the circle |
| + | |- |
| + | | offset |
| + | | '''in''' physics.Vect |
| + | | The offset of the circle from the Body |
| + | |- |
| + | | cs |
| + | | '''out''' physics.CircleShape |
| + | | A new CircleShape |
| + | |}<!-- table end --> |
| + | |
| + | <br/> |
| + | Returns a new CircleShape with the given [[#Body|body]], radius, and offset [[#vector|vector]] from the body's center of gravity in body-local coordinates. Specify nil for the body to use the space's static body. |
| + | |
| + | Introduced in platform.apiLevel = '2.0' |
| + | |
| + | ---- |
| + | ===== offset ===== |
| + | |
| + | |
| + | <!-- code start--> |
| + | <pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd"> |
| + | ovec = physics.CircleShape:offset() |
| + | </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.CircleShape |
| + | | The input CircleShape |
| + | |- |
| + | | ovec |
| + | | '''out''' physics.Vect |
| + | | The offset of the shape from the Body |
| + | |}<!-- table end --> |
| + | |
| + | <br/> |
| + | Returns the offset [[#vector|vector]] of the shape from the [[#Body|body]]'s center of gravity. |
| + | |
| + | Introduced in platform.apiLevel = '2.0' |
| + | |
| + | ---- |
| + | ===== radius ===== |
| + | |
| + | |
| + | <!-- code start--> |
| + | <pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd"> |
| + | r = physics.CircleShape:radius() |
| + | </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.CircleShape |
| + | | The input CircleShape |
| + | |- |
| + | | r |
| + | | '''out''' number |
| + | | The radius of the shape |
| + | |}<!-- table end --> |
| + | |
| + | <br/> |
| + | Returns the radius of the shape. |
| + | |
| + | Introduced in platform.apiLevel = '2.0' |
| + | |
| + | |
| + | [[Category:Physics_Engine/Shapes]] |
| [[Category:Physics_Engine]] | | [[Category:Physics_Engine]] |