A circle shape defined by a radius
This is the fastest and simplest collision shape
Constructors
new(body :
Body |
Nil, radius :
Number, offset :
Vect =
CP::Vect.new(0, 0))
The parameters are: the body to attach the circle to; the offset from the
body's center of gravity in body local coordinates.
SourceClass methods
Calculate area of a hollow circle.
r1 and r2 are the inner and outer diameters. A solid circle has an inner diameter of 0.
SourceCalculate the moment of inertia for a circle.
r1 and r2 are the inner and outer diameters. A solid circle has an inner diameter of 0.
SourceInstance methods
offset
Get the offset of a circle shape.
Sourceoffset=(offset : Vect)
Unsafe. Set the offset of a circle shape.
This change is only picked up as a change to the position
of the shape's surface, but not its velocity. Changing it will
not result in realistic physical behavior. Only use if you know
what you are doing!
Sourceradius
Get the radius of a circle shape.
SourceUnsafe. Set the radius of a circle shape.
This change is only picked up as a change to the position
of the shape's surface, but not its velocity. Changing it will
not result in realistic physical behavior. Only use if you know
what you are doing!
Source