Moscrif API Docs for: 2012q3
Show:

b2CircleShape Class

Library: box2d

This class creates shape for circular physical bodies.

Item Index

Methods

Methods

this

(
  • radius
)
B2CircleShape

Creates new instance of b2CircleShape with required radius.

Parameters:

  • radius Float

    Body radius.

Returns:

B2CircleShape: New instance of b2CircleShape class.

Example:

//create new circular shape with radius 10
this.radius = 10;
var shape = new b2CircleShape(this.radius);

//create new Body. Position is set to 50, 20.
var body = this.world.createBody(shape, #dynamic, 1, 1, 1, 50, 20);