Box2D Forums

It is currently Thu May 23, 2013 7:54 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sun Jan 16, 2011 9:33 am 
Offline

Joined: Sun Jan 16, 2011 9:30 am
Posts: 2
Hello,

I'm attempting to create a "U" shape (in Cocos2d) by joining 3 rectangles like so: |_|

It sounds like joints are not the correct solution here since I don't want any movement so I have created a main body which is the middle bit and 2 fixtures for the sides. I've added the two sides to the middle bit like this:

Code:
mainBody->CreateFixture(&leftFixtureDef);
mainBody->CreateFixture(&rightFixtureDef);


This works, however both side fixtures get added to the center of the mainBody. I can't seem to work out how to position the fixtures relative to the main body. Attaching a sprite/node to the fixture and changing the position doesn't seem to make a difference.

Any ideas?

Many thanks.


Top
 Profile  
 
PostPosted: Sun Jan 16, 2011 12:51 pm 
Offline

Joined: Sun Jan 16, 2011 9:30 am
Posts: 2
In case anyone was wondering, here's the answer: http://stackoverflow.com/questions/4706 ... ositioning


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group