<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>cocos2d for iPhone &#187; Tag: chipmunk - Recent Posts</title>
		<link>http://www.cocos2d-iphone.org/forum/tags/chipmunk</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Sat, 31 Jul 2010 07:35:12 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.cocos2d-iphone.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.cocos2d-iphone.org/forum/rss/tags/chipmunk" rel="self" type="application/rss+xml" />

		<item>
			<title>max9xs on "Chipmunk Logo Smash effect...how to create bitmap image ?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/7833#post-48515</link>
			<pubDate>Sat, 31 Jul 2010 07:19:33 +0000</pubDate>
			<dc:creator>max9xs</dc:creator>
			<guid isPermaLink="false">48515@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;Any links,, or names ? I found nothing till now.. confused totally...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mobilebros on "Chipmunk collision offset?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8165#post-48100</link>
			<pubDate>Wed, 28 Jul 2010 05:08:30 +0000</pubDate>
			<dc:creator>mobilebros</dc:creator>
			<guid isPermaLink="false">48100@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;A chipmunk rect produced by SpaceManager is also created &#34;outward&#34; from the position of the node (default is center), so usually things line up, if you can tell that there is some offset tho, you can use the spacemanager function: &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;-(void) offsetShape:(cpShape*)shape offset:(cpVect)offset;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;That will offset the shape from the center by whatever point you pass it.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Jack Here on "Chipmunk collision offset?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8165#post-48074</link>
			<pubDate>Wed, 28 Jul 2010 00:45:14 +0000</pubDate>
			<dc:creator>Jack Here</dc:creator>
			<guid isPermaLink="false">48074@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;Ok I added a cpShapeNode to see what is going on.  I think the problem is each collision_tile is being drawn from the center point of the tile from the tilegid.  So then the collision_tile looks like it is sitting down and to the left.  Anyway to change this?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Jack Here on "How to make a hero class for chipmunk?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8189#post-47959</link>
			<pubDate>Tue, 27 Jul 2010 03:23:07 +0000</pubDate>
			<dc:creator>Jack Here</dc:creator>
			<guid isPermaLink="false">47959@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;oh sweet! thanks a lot, that was becoming a big headache.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mobilebros on "How to make a hero class for chipmunk?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8189#post-47954</link>
			<pubDate>Tue, 27 Jul 2010 03:04:32 +0000</pubDate>
			<dc:creator>mobilebros</dc:creator>
			<guid isPermaLink="false">47954@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;Wow ok that was trickier than I thought, I'll try to explain. cpCCSprite does not actually override initWithFile (it actually probably should, so thank you for that). Since it does not it does not initialize things properly. Sooo to get your class to work I had to do this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;#&#60;a href='http://www.cocos2d-iphone.org/forum/tags/import'&#62;import&#60;/a&#62; &#38;quot;Hero.h&#38;quot;

@implementation Hero

+ (id)hero {
	NSLog(@&#38;quot;inside hero class method&#38;quot;);
	return [[self alloc] initHero];
}

- (id) initHero {
	self = [super initWithFile:@&#38;quot;gear.png&#38;quot;];
	if(self != nil)
	{
		cpBody *body = cpBodyNew(250.0f, INFINITY);
		body-&#38;gt;p = cpv(250, 160);

		cpShape *shape = cpCircleShapeNew(body, 29.0f, cpvzero);

		CPCCNODE_MEM_VARS_INIT(shape)

		shape-&#38;gt;e = 0.8;
		shape-&#38;gt;u = 0.7;
		shape-&#38;gt;collision_type = 2;

	}
	return self;
}

@end&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Basically I create the shape separately but then hand it off to that handy macro that will expand and properly initialize everything, it will automatically add self to shape-&#38;gt;data so I removed your line that did so. I did a quick test and everything checks out, good luck.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Jack Here on "How to make a hero class for chipmunk?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8189#post-47951</link>
			<pubDate>Tue, 27 Jul 2010 02:33:41 +0000</pubDate>
			<dc:creator>Jack Here</dc:creator>
			<guid isPermaLink="false">47951@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;This is the h file:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;#&#60;a href='http://www.cocos2d-iphone.org/forum/tags/import'&#62;import&#60;/a&#62; &#38;lt;Foundation/Foundation.h&#38;gt;
#&#60;a href='http://www.cocos2d-iphone.org/forum/tags/import'&#62;import&#60;/a&#62; &#38;quot;cocos2d.h&#38;quot;
#&#60;a href='http://www.cocos2d-iphone.org/forum/tags/import'&#62;import&#60;/a&#62; &#38;quot;SpaceManager.h&#38;quot;
#&#60;a href='http://www.cocos2d-iphone.org/forum/tags/import'&#62;import&#60;/a&#62; &#38;quot;chipmunk.h&#38;quot;
#&#60;a href='http://www.cocos2d-iphone.org/forum/tags/import'&#62;import&#60;/a&#62; &#38;quot;cpCCSprite.h&#38;quot;
#&#60;a href='http://www.cocos2d-iphone.org/forum/tags/import'&#62;import&#60;/a&#62; &#38;quot;cpBody.h&#38;quot;
#&#60;a href='http://www.cocos2d-iphone.org/forum/tags/import'&#62;import&#60;/a&#62; &#38;quot;cpShape.h&#38;quot;
#&#60;a href='http://www.cocos2d-iphone.org/forum/tags/import'&#62;import&#60;/a&#62; &#38;quot;cpShapeNode.h&#38;quot;

@interface Hero: cpCCSprite {

}
+(id)hero;
-(id)initHero;

@end&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;and the m file:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;#&#60;a href='http://www.cocos2d-iphone.org/forum/tags/import'&#62;import&#60;/a&#62; &#38;quot;Hero.h&#38;quot;

@implementation Hero

+ (id)hero {
	NSLog(@&#38;quot;inside hero class method&#38;quot;);
	return [[self alloc] initHero];
}

- (id) initHero {
	self = [super initWithFile:@&#38;quot;ball.png&#38;quot;];
	if(self != nil) {

		cpBody *body = cpBodyNew(250.0f, INFINITY);
		body-&#38;gt;p = cpv(250, 160);

		self.shape = cpCircleShapeNew(body, 29.0f, cpvzero);
		self.shape-&#38;gt;data = self;
		self.shape-&#38;gt;e = 0.8;
		self.shape-&#38;gt;u = 0.7;
		self.shape-&#38;gt;collision_type = 2;

	}
	return self;
}

@end&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;and then Im using it in my gamelayer with this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;ball = [Hero hero];
		[smgr addShape:ball.shape];
		[self addChild:ball];&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;ship is cpCCSprite *ball; in header.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mobilebros on "How to make a hero class for chipmunk?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8189#post-47941</link>
			<pubDate>Tue, 27 Jul 2010 01:00:32 +0000</pubDate>
			<dc:creator>mobilebros</dc:creator>
			<guid isPermaLink="false">47941@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;hmmm i'm not sure what the issue is, I'd have to see both your files; theoretically what you're doing should be ok.... of course if the CCSprite version works for you thats fine too. &#60;a href=&#34;mailto:support@mobile-bros.com&#34;&#62;support@mobile-bros.com&#60;/a&#62; if you want to share your files, or I guess even post them here...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Jack Here on "How to make a hero class for chipmunk?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8189#post-47880</link>
			<pubDate>Mon, 26 Jul 2010 18:25:10 +0000</pubDate>
			<dc:creator>Jack Here</dc:creator>
			<guid isPermaLink="false">47880@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;when i do this with ccCCSprite it crashes, but if i do it with CCSprite it works.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;@interface Hero: CCSprite {

}
+(id)hero;
-(id)initHero;

@end

@implementation Hero

+ (id)hero {
	NSLog(@&#38;quot;inside hero class method&#38;quot;);
	return [[self alloc] initHero];
}

- (id) initHero {
	self = [super initWithFile:@&#38;quot;ball.png&#38;quot;];
	if(self != nil) {
		/*
		cpBody *body = cpBodyNew(250.0f, INFINITY);
		body-&#38;gt;p = self.position;

		self.shape = cpCircleShapeNew(body, 29.0f, cpvzero);
		self.shape-&#38;gt;data = self;
		self.shape-&#38;gt;e = 0.8;
		self.shape-&#38;gt;u = 0.7;
		self.shape-&#38;gt;collision_type = 2;
		 */
	}
	return self;
}

@end&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;works...but&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;@interface Hero: CCSprite {....&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;does not, is this not allowed with ccCCSprite?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mobilebros on "Chipmunk/Spacemanager constraints."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8161#post-47760</link>
			<pubDate>Sun, 25 Jul 2010 21:17:47 +0000</pubDate>
			<dc:creator>mobilebros</dc:creator>
			<guid isPermaLink="false">47760@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;Haha no problem, and actually we're in the U.S., New Hampshire to be precise, but I appreciate the offer :) That rotation inwards still sounds like a side effect of the gear I think...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mobilebros on "How to make a hero class for chipmunk?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8189#post-47759</link>
			<pubDate>Sun, 25 Jul 2010 21:15:38 +0000</pubDate>
			<dc:creator>mobilebros</dc:creator>
			<guid isPermaLink="false">47759@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;If hero is a sub-class of cpCCSprite you already have a &#34;shape&#34; property, no sense in defining another one; access it with &#34;self.shape&#34;.&#60;/p&#62;
&#60;p&#62;The second problem is that you're not adding it to the space, if using SpaceManager try:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;ball = [Hero hero];

//This line is neeeded
[smgr addShape:hero.shape];

[self addChild:ball];&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>paule on "Chipmunk: How to remove shape and body?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8190#post-47747</link>
			<pubDate>Sun, 25 Jul 2010 18:32:26 +0000</pubDate>
			<dc:creator>paule</dc:creator>
			<guid isPermaLink="false">47747@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;I can't help you with the touch detection problem. I think there was a method to check if there is a body at that (converted) position but I don't remember how, sorry.&#60;/p&#62;
&#60;p&#62;If you have scheduled &#60;code&#62;cpSpaceStep()&#60;/code&#62; you should use SpaceManager and the function &#60;code&#62;cpSpaceAddPostStepCallback()&#60;/code&#62;.&#60;/p&#62;
&#60;p&#62;This snippet shows how to remove shape (shape) and body (shape-&#38;gt;body) from the space (space):&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;cpSpaceRemoveBody(space, shape-&#38;gt;body);
cpSpaceRemoveShape(space, shape);
cpBodyFree(shape-&#38;gt;body);
cpShapeFree(shape);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Be sure to use it with the above explained function otherwise you might get the error 'EXC_BAD_ACCESS'.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>paule on "How to make a hero class for chipmunk?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8189#post-47745</link>
			<pubDate>Sun, 25 Jul 2010 18:26:00 +0000</pubDate>
			<dc:creator>paule</dc:creator>
			<guid isPermaLink="false">47745@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;I can't assess it. I used the way to create them without SpaceManager. There's a nice a tutorial which may will help: &#60;a href=&#34;http://www.alexandre-gomes.com/articles/chipmunk/&#34;&#62;http://www.alexandre-gomes.com/articles/chipmunk/&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Jack Here on "How to make a hero class for chipmunk?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8189#post-47740</link>
			<pubDate>Sun, 25 Jul 2010 17:11:26 +0000</pubDate>
			<dc:creator>Jack Here</dc:creator>
			<guid isPermaLink="false">47740@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;Now this code is crashing on me, so I cant even check. Maybe this is not the best way to do create this?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>paule on "How to make a hero class for chipmunk?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8189#post-47710</link>
			<pubDate>Sun, 25 Jul 2010 12:53:21 +0000</pubDate>
			<dc:creator>paule</dc:creator>
			<guid isPermaLink="false">47710@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;Do you checked if cpSpace contains the ball?&#60;br /&#62;
Does cpSpace get updated?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Xenetrix on "Chipmunk: How to remove shape and body?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8190#post-47661</link>
			<pubDate>Sun, 25 Jul 2010 07:06:21 +0000</pubDate>
			<dc:creator>Xenetrix</dc:creator>
			<guid isPermaLink="false">47661@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;First, sorry for my English, im not an American. My question is how can I remove the shape and body from the space, this isn't related with collision detection. Im triying to do this with a touch event, specifically I'm trying to clear a ball Touching it (I have a lot of balls in the space), but I have no idea how to do it, I have been looking on Internet and cannot find any help regarding how to do it, all relates to the collisions and that's not what I need.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Jack Here on "How to make a hero class for chipmunk?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8189#post-47658</link>
			<pubDate>Sun, 25 Jul 2010 06:14:42 +0000</pubDate>
			<dc:creator>Jack Here</dc:creator>
			<guid isPermaLink="false">47658@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;Im trying to make a hero class for chipmunk.  So far I have this in my header:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;@interface Hero: cpCCSprite {
	cpShape *shape;
	cpSpace *space;
}
+(id)hero;
-(id)initHero;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;and this in my m file:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;@implementation Hero

+ (id)hero {
	NSLog(@&#38;quot;inside hero class method&#38;quot;);
	return [[self alloc] initHero];
}

- (id) initHero {
	self = [super initWithFile:@&#38;quot;ball.png&#38;quot;];
	if(self != nil) {
		cpBody *body = cpBodyNew(250.0f, INFINITY);
		body-&#38;gt;p = self.position;

		shape = cpCircleShapeNew(body, 29.0f, cpvzero);
		shape-&#38;gt;data = self;
		shape-&#38;gt;e = 0.8;
		shape-&#38;gt;u = 0.7;
		shape-&#38;gt;collision_type = 2;
	}
	return self;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;then i init it in my gamescreen with:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;ball = [Hero hero];
		[self addChild:ball];&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;However, it does not react in the gamescreen...it should fall to the bottom.  How do I get my hero class to react to the spacemanager?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mrTortex on "Chipmunk/Spacemanager constraints."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8161#post-47600</link>
			<pubDate>Sat, 24 Jul 2010 17:44:45 +0000</pubDate>
			<dc:creator>mrTortex</dc:creator>
			<guid isPermaLink="false">47600@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;:)  Of course.  You based in the UK?  I think I owe you a beer.&#60;/p&#62;
&#60;p&#62;One odd thing I noted, the legs don't rotate outwards when they receive the weight of the body above them, they rotate inwards and push the body upwards!  Some odd stuff going on again.  Gotta love physics, they make everything so much more confusing. :)&#60;/p&#62;
&#60;p&#62;Now back to figuring out my parallax issue...&#60;/p&#62;
&#60;p&#62;Thanks again.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mobilebros on "Chipmunk/Spacemanager constraints."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8161#post-47593</link>
			<pubDate>Sat, 24 Jul 2010 16:31:52 +0000</pubDate>
			<dc:creator>mobilebros</dc:creator>
			<guid isPermaLink="false">47593@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;You're on the right track its phase you want to play with; make sure it's in radians...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mrTortex on "Chipmunk/Spacemanager constraints."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8161#post-47564</link>
			<pubDate>Sat, 24 Jul 2010 08:08:03 +0000</pubDate>
			<dc:creator>mrTortex</dc:creator>
			<guid isPermaLink="false">47564@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;Hello.&#60;/p&#62;
&#60;p&#62;Thanks for the code.  It turned out the way I was dealing with impulses and moving the main body around was causing odd things to occur, so I re-wrote that section and it's now working. :)  However, my legs need to point out at 45 degrees, which they do to start with, but the gear brings them into alignment with the body.  Is there a rotational offset available?  I've tried using phase but it rotates around itself constantly, which looks kinda cool but isn't the desired effect! :)&#60;/p&#62;
&#60;p&#62;Thanks.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mobilebros on "Chipmunk/Spacemanager constraints."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8161#post-47549</link>
			<pubDate>Sat, 24 Jul 2010 02:25:30 +0000</pubDate>
			<dc:creator>mobilebros</dc:creator>
			<guid isPermaLink="false">47549@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;pre&#62;&#60;code&#62;CGPoint pt = [wherever you want it];

	_torso = [smgr addRectAt:ccpAdd(pt,ccp(0,8)) mass:12 width:12 height:24 rotation:0];
	_lleg = [smgr addRectAt:ccpAdd(pt,ccp(-6,-23)) mass:4 width:4 height:26 rotation:CC_DEGREES_TO_RADIANS(-5)];
	_rleg = [smgr addRectAt:ccpAdd(pt,ccp(6,-23)) mass:4 width:4 height:26 rotation:CC_DEGREES_TO_RADIANS(5)];

	[smgr addPivotToBody:_torso-&#38;gt;body fromBody:_lleg-&#38;gt;body worldAnchor:cpvadd(pt, cpv(-5, -6))];
	[smgr addPivotToBody:_torso-&#38;gt;body fromBody:_rleg-&#38;gt;body worldAnchor:cpvadd(pt, cpv(5, -6))];

	cpConstraint *gear = [smgr addGearToBody:_torso-&#38;gt;body fromBody:_lleg-&#38;gt;body ratio:1];
	gear-&#38;gt;maxForce = 3000;
	gear = [smgr addGearToBody:_torso-&#38;gt;body fromBody:_rleg-&#38;gt;body ratio:1];
	gear-&#38;gt;maxForce = 3000;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;That's literally what I do to create a rectangular torso with 2 stiff straight rectangle legs.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mrTortex on "Chipmunk/Spacemanager constraints."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8161#post-47525</link>
			<pubDate>Fri, 23 Jul 2010 20:44:47 +0000</pubDate>
			<dc:creator>mrTortex</dc:creator>
			<guid isPermaLink="false">47525@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;Hello.  I created a constraint between the body and leg, I'm getting very odd results.  Would you mind posting a code snippet?  Understand if not,&#60;/p&#62;
&#60;p&#62;Would it possibly be anything to do with applying impulses to the body which cause it to rotate?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mobilebros on "Chipmunk collision offset?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8165#post-47520</link>
			<pubDate>Fri, 23 Jul 2010 20:07:25 +0000</pubDate>
			<dc:creator>mobilebros</dc:creator>
			<guid isPermaLink="false">47520@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;There shouldn't be any weird offset, perhaps [collision positionAt:ccp(x,y)] is returning the wrong position?&#60;/p&#62;
&#60;p&#62;Maybe attach a cpShapeNode to that cpShape for the tile just for debugging purposes to see if its the right position?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mobilebros on "Chipmunk/Spacemanager constraints."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8161#post-47517</link>
			<pubDate>Fri, 23 Jul 2010 19:57:08 +0000</pubDate>
			<dc:creator>mobilebros</dc:creator>
			<guid isPermaLink="false">47517@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;You need a pin/pivot for sure, I used a pivot. I just checked my code and I have 1 for the ratio and maxForce = 3000.&#60;/p&#62;
&#60;p&#62;The overall effect looks pretty good I'd say, legs are somewhat &#34;springy&#34; like they should be.&#60;/p&#62;
&#60;p&#62;[Edit] Reading your first post again, I'd think the rotary springs would work too, did you connect the contraint between the body and leg or between the leg and some other object?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Jack Here on "Chipmunk collision offset?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8165#post-47514</link>
			<pubDate>Fri, 23 Jul 2010 19:41:34 +0000</pubDate>
			<dc:creator>Jack Here</dc:creator>
			<guid isPermaLink="false">47514@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;I have a character that is 32 by 50.  And I have tiles that are 32 by 32.  I am creating the character like so:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;cpShape *square = [smgr addRectAt:cpv(240,160) mass: 3.0 width:32 height:50 rotation:0];
		character = [cpCCSprite spriteWithShape:square file:@&#38;quot;character_.png&#38;quot;];

cpCCSprite *character; //in header&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Then after loading my tilemap I do this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;for(int x = 0; x &#38;lt; [collision layerSize].width; x++)
	{
		for(int y = 0; y &#38;lt; [collision layerSize].height; y++)
		{
			unsigned int tmpgid = [collision tileGIDAt:ccp(x,y)];

			if(tmpgid == 34)
			{
				cpShape *collision_tile = [sm addRectAt:[collision positionAt:ccp(x,y)] mass:STATIC_MASS width:32 height:32 rotation:0];
				//NSLog(@&#38;quot;gid: %i&#38;quot;,tmpgid);
				//NSLog(@&#38;quot;x: %f, y: %f &#38;quot;,tmp.x, tmp.y);
			}

		}
	}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;To add a cpShape that acts as a collidable object (ground or wall).  The problem is the my character seems to sit below the ground or stops before he hits a wall.  I was wondering if chipmunk needs some sort of offet to correct this problem?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mrTortex on "Chipmunk/Spacemanager constraints."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8161#post-47502</link>
			<pubDate>Fri, 23 Jul 2010 18:02:14 +0000</pubDate>
			<dc:creator>mrTortex</dc:creator>
			<guid isPermaLink="false">47502@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;With a gear do you also need a pin, or pivot?  The reason I ask is with a gear alone it flies off.  Also, it doesn't rotate with the main body.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mobilebros on "Chipmunk/Spacemanager constraints."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8161#post-47498</link>
			<pubDate>Fri, 23 Jul 2010 17:32:42 +0000</pubDate>
			<dc:creator>mobilebros</dc:creator>
			<guid isPermaLink="false">47498@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;Use a gear constraint between the leg and body, set the gear constraint maxForce to something like 3000, maybe lower.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mrTortex on "Chipmunk/Spacemanager constraints."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8161#post-47497</link>
			<pubDate>Fri, 23 Jul 2010 17:17:40 +0000</pubDate>
			<dc:creator>mrTortex</dc:creator>
			<guid isPermaLink="false">47497@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;Hello.&#60;/p&#62;
&#60;p&#62;Me again!  I'll go away soon ;)&#60;/p&#62;
&#60;p&#62;I want to have a ball with two little legs sticking out of it.  The ball should fall, land on it's legs, which rotate with the impact, then spring to a settled position.&#60;/p&#62;
&#60;p&#62;So, I have my ball body, two leg bodies, two pin constraints and two rotation spring constraints.  Should work yes?  Well, it doesn't because the legs don't rotate with the body, so if the body is upside down, the legs are still pointing at the floor.&#60;/p&#62;
&#60;p&#62;I need a way to have the child bodies inherit the rotation from the parent.  Any ideas?&#60;/p&#62;
&#60;p&#62;Thanks.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mrTortex on "Knowing where to position constraints."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8159#post-47484</link>
			<pubDate>Fri, 23 Jul 2010 16:17:48 +0000</pubDate>
			<dc:creator>mrTortex</dc:creator>
			<guid isPermaLink="false">47484@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;Hello.&#60;/p&#62;
&#60;p&#62;I'm having a hard time figuring out where to place Chipmunk constraints.  Is it based on the local or screen space of the shape?  For example:&#60;/p&#62;
&#60;p&#62;&#60;img  alt=&#34;&#34; /&#62;&#60;/p&#62;
&#60;p&#62;To pin the stick to the circle, is the stick the to or the from body?  Would I give the sticks local x and y coords or it's current position in screen space to position the stick?  If the stick is 80 pixels long and 10 high for example, and I wanted it pinned like above would I give x as 5 and y as 5 (roughly)?  Because, if I do, the stick isn't pinned as shown above.&#60;/p&#62;
&#60;p&#62;I've read the docs and checked the example, but just can't get this working.  I want to pin the stick and have it rotate only a specific amount, for which I was going to use a rotate limit.&#60;/p&#62;
&#60;p&#62;Any help would be great, thanks.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mobilebros on "How do you change the window size with SpaceManager?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8158#post-47478</link>
			<pubDate>Fri, 23 Jul 2010 15:33:40 +0000</pubDate>
			<dc:creator>mobilebros</dc:creator>
			<guid isPermaLink="false">47478@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;Well if its just a matter of &#34;padding&#34; you can specify horiz. and vert. padding with the inset parameter. If its a question of width and height you can use this alternate function:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;-(void) addWindowContainmentWithFriction:(cpFloat)friction elasticity:(cpFloat)elasticity size:(CGSize)wins inset:(cpVect)inset radius:(cpFloat)radius&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Sadly this still assumes you're starting at point 0,0 I'm thinking that maybe there should be another method now that takes a CGRect so you can actually specify the containment rect directly..... hmmm hope that helps.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Jack Here on "How do you change the window size with SpaceManager?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8158#post-47475</link>
			<pubDate>Fri, 23 Jul 2010 15:05:06 +0000</pubDate>
			<dc:creator>Jack Here</dc:creator>
			<guid isPermaLink="false">47475@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;Im using chipmunk and spacemanager.  I was wondering how you change the the window containment size?  I have a tile map and want the containment size to be the same as the tilemap. I know how to get the tilemap size but not sure how to manipulate the containment size.  Any suggestions?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
