• Runtimes
  • Adding spine bounding boxes to physicsNode (cocos2d)

Hi,

I am new to spine and have successfully loaded my animation into my cocos2d-iphone project. However, I am having some difficultly understanding how to apply the bounding boxes (defined in spine) as a CCPhysicsBody to my games physicsNode for collision detection (I am using the integrated chipmunk physics engine).

The examples provided in the runtime are great for showing how to load, mix, and track the animations in cocos2d, but are there any examples, documentation or tutorials which explain how to apply the bounding boxes created in spine to a physics world (preferably chipmunk)? A lot of other posts are related to box2d, which I find unusual because chipmunk is the official physics engine for cocos2d.

P.s I did have a look at a similar question here: http://esotericsoftware.com/forum/viewtopic.php?f=11&t=2159&p=10656&hilit=find+bounding+box , but that was posted 8 months ago and may be out of date.

Any help is greatly appreciated.

Related Discussions
...
  • Изменено

Sorry, I don't have an example for how to drive physics bodies from a skeleton. The thread you linked is about using bounding boxes for hit detection. There are a few other threads about physics, but basically you create a physics body and set its translation, rotation, and scale to match a bone in a skeleton. When you animation the skeleton, the physics body is updated to match.

There is this slightly outdated Java code:
https://github.com/EsotericSoftware/spi ... Box2D.java

There is this thread:
viewtopic.php?f=7&t=3001&p=17544

You could also look at spine-unity and how it can drive physics from the skeleton bones, and also skeleton bones from physics.