Class: CP::PivotJoint

Inherits:
Object
  • Object
show all
Defined in:
lib/chipmunk-ffi/constraints/pivot_joint.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(a_body, b_body, anchr_one, anchr_two = nil) ⇒ PivotJoint

Returns a new instance of PivotJoint.



20
21
22
23
24
25
26
27
28
# File 'lib/chipmunk-ffi/constraints/pivot_joint.rb', line 20

def initialize(a_body, b_body, anchr_one, anchr_two=nil)
  @struct = if anchr_two.nil?
    PivotJointStruct.new(CP.cpPivotJointNew(
      a_body.struct.pointer,b_body.struct.pointer,anchr_one.struct))
  else
    PivotJointStruct.new(CP.cpPivotJointNew2(
      a_body.struct.pointer,b_body.struct.pointer,anchr_one.struct,anchr_two.struct))
  end
end

Instance Attribute Details

#structObject (readonly)

Returns the value of attribute struct.



19
20
21
# File 'lib/chipmunk-ffi/constraints/pivot_joint.rb', line 19

def struct
  @struct
end