ChipmunkPolyShape Box Offset

Discuss new features and future development.
Post Reply
cocojoe
Posts: 13
Joined: Thu Mar 08, 2012 8:56 am
Contact:

ChipmunkPolyShape Box Offset

Post by cocojoe »

Maybe this is a stupid question however I wondered why there is no convenience offset param for:

Code: Select all

/// Create an autoreleased box shape centered on the center of gravity.
+ (id)boxWithBody:(ChipmunkBody *)body width:(cpFloat)width height:(cpFloat)height;
As ChipmunkCirlceShape has an offset param for the equivalent method.

Code: Select all

/// Create an autoreleased circle shape with the given radius and offset from the center of gravity.
+ (id)circleWithBody:(ChipmunkBody *)body radius:(cpFloat)radius offset:(cpVect)offset;
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: ChipmunkPolyShape Box Offset

Post by slembcke »

There is an alternate version that allows you to specify a bounding body instead of just width/height. It wasn't there originally because the box creation method was just a convenience method to create a four sided polygon for you. Creating a centered box was the most common usage, so I did that first.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests