开发者

Coordinate CCSprite with b2Fixture

开发者 https://www.devze.com 2023-04-04 03:30 出处:网络
I have created a single body in box2D, which consists of 2 fixtures. I have a CCSprite userData for each fixture, but i don\'t know how to set the sprite position and rotation to match the fixture sha

I have created a single body in box2D, which consists of 2 fixtures. I have a CCSprite userData for each fixture, but i don't know how to set the sprite position and rotation to match the fixture shape...i can't find shape.position开发者_如何转开发 or fixture.position in the docs.

What i'm missing ?

Thanks!


I am not an expert at cocos2d and box2d myself and I am just learning both at the moment, but is there any reason why you can't just create a separate body for each fixture and then fix them together with a joint of some sort then assign the CCSprite userdata to each body?

0

精彩评论

暂无评论...
验证码 换一张
取 消