cpBB confusion (CGRect relationship)

Official forum for the Chipmunk2D Physics Library.
Post Reply
dugbug
Posts: 20
Joined: Fri Jan 06, 2012 10:08 am
Contact:

cpBB confusion (CGRect relationship)

Post by dugbug »

Hi, with v7 objective-chipmunk users have to use cpbb instead of cgrect when using [space addSpace] but cpbb is not explained very well. It takes four arguments but what they reference is not clear: left, bottom, right, and top.

I get a single field called .... 'left'? what is left, distance from the center? For some reason I landed on this combination that seems to work but would appreciate confirmation from anybody that has done this.

cpbb.l = bounds.origin.x;
cpbb.b = bounds.origin.y;
cpbb.r = bounds.size.width;
cpbb.t = bounds.size.height;


thanks!
Post Reply

Who is online

Users browsing this forum: Heise IT-Markt [Crawler] and 15 guests