Class: CP::Shape::Circle

Inherits:
Object
  • Object
show all
Includes:
CP::Shape
Defined in:
lib/chipmunk-ffi/shape.rb

Instance Attribute Summary

Attributes included from CP::Shape

#struct

Instance Method Summary collapse

Methods included from CP::Shape

#bb, #body, #body=, #cache_bb, #collision_type, #collision_type=, #data, #data=, #e, #e=, #group, #group=, #layers, #layers=, reset_id_counter, #set_data_pointer, #surface_v, #surface_v=, #u, #u=

Constructor Details

#initialize(body, rad, offset_vec) ⇒ Circle

Returns a new instance of Circle.



141
142
143
144
145
146
# File 'lib/chipmunk-ffi/shape.rb', line 141

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