Module: CP::Constraint

Includes:
Object
Defined in:
lib/chipmunk.rb,
ext/chipmunk/rb_cpConstraint.c

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#body_aObject (readonly)

#body_bObject (readonly)

Instance Method Details

#add_to_space(space) ⇒ Object


81
82
83
# File 'lib/chipmunk.rb', line 81

def add_to_space(space)
  space.add_constraint(self)
end

#chipmunk_objectsObject


77
78
79
# File 'lib/chipmunk.rb', line 77

def chipmunk_objects
  [self]
end

#error_biasObject

#error_bias=Object

#impulseObject


255
256
257
258
# File 'ext/chipmunk/rb_cpConstraint.c', line 255

static VALUE
rb_cpConstraintGetImpulse(VALUE self) {
  return rb_float_new(cpConstraintGetImpulse(CONSTRAINT(self)));
}

#max_biasObject

#max_bias=Object

#max_forceObject

#max_force=Object

#post_solveObject


339
340
341
342
343
344
345
346
347
348
# File 'ext/chipmunk/rb_cpConstraint.c', line 339

static VALUE
rb_cpConstraintSetPostSolve(int argc, VALUE * argv, VALUE self) {
  VALUE callback_block;
  rb_scan_args(argc, argv, "0&", &callback_block);
  rb_iv_set(self, "@_cp_post_solve", callback_block);

  cpConstraintSetPostSolveFunc(CONSTRAINT(self), rb_cpConstraintPostSolveFunc);

  return Qnil;
}

#pre_solveObject


328
329
330
331
332
333
334
335
336
337
# File 'ext/chipmunk/rb_cpConstraint.c', line 328

static VALUE
rb_cpConstraintSetPreSolve(int argc, VALUE * argv, VALUE self) {
  VALUE callback_block;
  rb_scan_args(argc, argv, "0&", &callback_block);
  rb_iv_set(self, "@_cp_pre_solve", callback_block);

  cpConstraintSetPreSolveFunc(CONSTRAINT(self), rb_cpConstraintPreSolveFunc);

  return Qnil;
}

#remove_from_space(space) ⇒ Object


85
86
87
# File 'lib/chipmunk.rb', line 85

def remove_from_space(space)
  space.remove_constraint(self)
end