Class: Chipmunk::Shape::Segment

Inherits:
Object
  • Object
show all
Includes:
Chipmunk::Shape
Defined in:
ext/chipmunk/rb_cpShape.c

Instance Attribute Summary

Attributes included from Chipmunk::Shape

#obj

Instance Method Summary collapse

Methods included from Chipmunk::Shape

#bb, #body, #body=, #cache_bb, #collision_type, #collision_type=, #data, #e, #e=, #group, #group=, #layers, #layers=, #nearest_point_query, #object, #object=, #point_query, #raw_bb, reset_id_counter, #segment_query, #sensor=, #sensor?, #surface_v, #surface_v=, #u, #u=

Constructor Details

#initializeObject


254
255
256
257
258
259
260
261
262
263
264
265
# File 'ext/chipmunk/rb_cpShape.c', line 254

static VALUE
rb_cpSegmentInitialize(VALUE self, VALUE body, VALUE a, VALUE b, VALUE r) {
  cpSegmentShape *seg = (cpSegmentShape *)SHAPE(self);

  cpSegmentShapeInit(seg, BODY(body), *VGET(a), *VGET(b), NUM2DBL(r));
  seg->shape.data           = (void *)self;
  seg->shape.collision_type = Qnil;

  rb_ivar_set(self, id_body, body);

  return self;
}

Instance Method Details

#aObject


354
355
356
357
# File 'ext/chipmunk/rb_cpShape.c', line 354

static VALUE
rb_cpSegmentShapeGetA(VALUE self) {
  return VNEW(cpSegmentShapeGetA(SHAPE(self)));
}

#bObject


359
360
361
362
# File 'ext/chipmunk/rb_cpShape.c', line 359

static VALUE
rb_cpSegmentShapeGetB(VALUE self) {
  return VNEW(cpSegmentShapeGetB(SHAPE(self)));
}

#nObject


369
370
371
372
# File 'ext/chipmunk/rb_cpShape.c', line 369

static VALUE
rb_cpSegmentShapeGetNormal(VALUE self) {
  return VNEW(cpSegmentShapeGetNormal(SHAPE(self)));
}

#normalObject


369
370
371
372
# File 'ext/chipmunk/rb_cpShape.c', line 369

static VALUE
rb_cpSegmentShapeGetNormal(VALUE self) {
  return VNEW(cpSegmentShapeGetNormal(SHAPE(self)));
}

#rObject


364
365
366
367
# File 'ext/chipmunk/rb_cpShape.c', line 364

static VALUE
rb_cpSegmentShapeGetRadius(VALUE self) {
  return rb_float_new(cpSegmentShapeGetRadius(SHAPE(self)));
}

#radiusObject


364
365
366
367
# File 'ext/chipmunk/rb_cpShape.c', line 364

static VALUE
rb_cpSegmentShapeGetRadius(VALUE self) {
  return rb_float_new(cpSegmentShapeGetRadius(SHAPE(self)));
}

#set_endpoints!Object


403
404
405
406
407
# File 'ext/chipmunk/rb_cpShape.c', line 403

static VALUE
rb_cpSegmentShapeSetEndpoints(VALUE self, VALUE a, VALUE b) {
  cpSegmentShapeSetEndpoints(SHAPE(self), *VGET(a), *VGET(b));
  return self;
}

#set_neighbors!Object


415
416
417
418
419
# File 'ext/chipmunk/rb_cpShape.c', line 415

static VALUE
rb_cpSegmentShapeSetNeighbors(VALUE self, VALUE prev, VALUE next) {
  cpSegmentShapeSetNeighbors(SHAPE(self), *VGET(prev), *VGET(next));
  return self;
}

#set_radius!Object


409
410
411
412
413
# File 'ext/chipmunk/rb_cpShape.c', line 409

static VALUE
rb_cpSegmentShapeSetRadius(VALUE self, VALUE radius) {
  cpSegmentShapeSetRadius(SHAPE(self), NUM2DBL(radius));
  return self;
}