Difference between revisions of "Category:Physics Engine/Circle Shapes"

From Inspired-Lua Wiki
Jump to navigation Jump to search
 
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]]

Latest revision as of 07:28, 31 July 2012

A CircleShape is a subclass of Shape. Its type is TI.cpCircleShape.


CircleShape
cs = physics.CircleShape(body, radius, offset)


Parameter Type Description
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


Returns a new CircleShape with the given body, radius, and offset 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
ovec = physics.CircleShape:offset()


Parameter Type Description
self in physics.CircleShape The input CircleShape
ovec out physics.Vect The offset of the shape from the Body


Returns the offset vector of the shape from the body's center of gravity.

Introduced in platform.apiLevel = '2.0'


radius
r = physics.CircleShape:radius()


Parameter Type Description
self in physics.CircleShape The input CircleShape
r out number The radius of the shape


Returns the radius of the shape.

Introduced in platform.apiLevel = '2.0'

This category currently contains no pages or media.