Class: CP::DampedSpring

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(a_body, b_body, anchr_one, anchr_two, rest_length, stiffness, damping) ⇒ DampedSpring

Returns a new instance of DampedSpring.



23
24
25
26
27
28
# File 'lib/chipmunk-ffi/constraints/damped_spring.rb', line 23

def initialize(a_body, b_body, anchr_one, anchr_two, 
               rest_length, stiffness, damping)
  @struct = DampedSpringStruct.new(CP.cpDampedSpringNew(
    a_body.struct.pointer,b_body.struct.pointer,anchr_one.struct,anchr_two.struct,
    rest_length, stiffness, damping))
end

Instance Attribute Details

#structObject (readonly)

Returns the value of attribute struct.



22
23
24
# File 'lib/chipmunk-ffi/constraints/damped_spring.rb', line 22

def struct
  @struct
end