Category:Physics Engine/Circle Shapes

From Inspired-Lua Wiki
Jump to navigation Jump to search

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.