Class: CP::Shape::Circle
- Inherits:
-
Object
- Object
- CP::Shape::Circle
- Includes:
- CP::Shape
- Defined in:
- lib/chipmunk-ffi/shape.rb,
lib/chipmunk-ffi/unsafe.rb
Instance Attribute Summary
Attributes included from CP::Shape
Instance Method Summary collapse
-
#initialize(body, rad, offset_vec) ⇒ Circle
constructor
A new instance of Circle.
- #offset=(new_offset) ⇒ Object
- #radius=(new_radius) ⇒ Object
Methods included from CP::Shape
#bb, #body, #body=, #cache_bb, #collision_type, #collision_type=, #data, #data=, #e, #e=, #group, #group=, #layers, #layers=, #point_query, reset_id_counter, #segment_query, #sensor=, #sensor?, #set_data_pointer, #surface_v, #surface_v=, #u, #u=
Constructor Details
#initialize(body, rad, offset_vec) ⇒ Circle
Returns a new instance of Circle.
184 185 186 187 188 189 |
# File 'lib/chipmunk-ffi/shape.rb', line 184 def initialize(body, rad, offset_vec) @body = body ptr = CP.cpCircleShapeNew body.struct.pointer, rad, offset_vec.struct @struct = ShapeStruct.new ptr set_data_pointer end |
Instance Method Details
#offset=(new_offset) ⇒ Object
17 18 19 |
# File 'lib/chipmunk-ffi/unsafe.rb', line 17 def offset=(new_offset) CP.cpCircleShapeSetOffset(@struct, new_offset.struct) end |
#radius=(new_radius) ⇒ Object
14 15 16 |
# File 'lib/chipmunk-ffi/unsafe.rb', line 14 def radius=(new_radius) CP.cpCircleShapeSetRadius(@struct, new_radius) end |