Method: CP::Space#initialize

Defined in:
ext/chipmunk/rb_cpSpace.c

#initializeObject



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'ext/chipmunk/rb_cpSpace.c', line 58

static VALUE
rb_cpSpaceInitialize(VALUE self) {
  cpSpace *space = SPACE(self);
  cpSpaceInit(space);

  // These might as well be in one shared hash.
  rb_iv_set(self, "@static_shapes", rb_ary_new());
  rb_iv_set(self, "@active_shapes", rb_ary_new());
  rb_iv_set(self, "@bodies", rb_ary_new());
  rb_iv_set(self, "@constraints", rb_ary_new());
  rb_iv_set(self, "@blocks", rb_hash_new());
  rb_iv_set(self, "@post_step_blocks", rb_hash_new());

  return self;
}