KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm attempting to create a "U" shape in Box2d (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: 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.
Tags (comma-separated)
Save Edits
Cancel