Class: CP::Shape::Segment
- Inherits:
-
Object
- Object
- CP::Shape::Segment
show all
- Includes:
- CP::Shape
- Defined in:
- ext/chipmunk/rb_cpShape.c
Instance Attribute Summary
Attributes included from CP::Shape
#obj
Instance Method Summary
collapse
Methods included from CP::Shape
#add_to_space, #bb, #body, #body=, #cache_bb, #chipmunk_objects, #collision_type, #collision_type=, #data, #e, #e=, #group, #group=, #layers, #layers=, #nearest_point_query, #object, #object=, #point_query, #raw_bb, #remove_from_space, reset_id_counter, #segment_query, #sensor=, #sensor?, #surface_v, #surface_v=, #u, #u=
Methods included from Object
#chipmunk_objects
Constructor Details
#initialize(body, a, b, r) ⇒ Object
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
354
355
356
357
|
# File 'ext/chipmunk/rb_cpShape.c', line 354
static VALUE
rb_cpSegmentShapeGetA(VALUE self) {
return VNEW(cpSegmentShapeGetA(SHAPE(self)));
}
|
359
360
361
362
|
# File 'ext/chipmunk/rb_cpShape.c', line 359
static VALUE
rb_cpSegmentShapeGetB(VALUE self) {
return VNEW(cpSegmentShapeGetB(SHAPE(self)));
}
|
369
370
371
372
|
# File 'ext/chipmunk/rb_cpShape.c', line 369
static VALUE
rb_cpSegmentShapeGetNormal(VALUE self) {
return VNEW(cpSegmentShapeGetNormal(SHAPE(self)));
}
|
369
370
371
372
|
# File 'ext/chipmunk/rb_cpShape.c', line 369
static VALUE
rb_cpSegmentShapeGetNormal(VALUE self) {
return VNEW(cpSegmentShapeGetNormal(SHAPE(self)));
}
|
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)));
}
|
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!(a, b) ⇒ 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!(prev, next) ⇒ 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!(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;
}
|