Mekanimo to Cocos2D

77 views
Skip to first unread message

howcr

unread,
Aug 16, 2010, 1:13:48 PM8/16/10
to Mekanimo
Hi,

I am using the recent version of Mekanimo (just downloaded it from
Mekanimo.net yesterday) and I have exported the code of the worms
example, placed it in my Box2D / Cocos2D project.

When I run the project I can see the worms but they do not move. There
is something that I am not doing correctly on my end, basically I did
a copy / paste of the code generated by Mekanimo using the following
command:

system.createBox2DCpp ('my directory', version=202)

Then I added the relevant data to testentries.cpp.

If anyone has an example of going from Mekanimo with an object that
has movement into Box2D / Cocos2D I'd like to take a look at it. This
seems like a really decent pipeline and would even work well with
Ricardo's Level SVG.

Regards,
howcr

Fahri

unread,
Aug 16, 2010, 1:46:22 PM8/16/10
to Mekanimo
The reason translated files may not behave like it did in Mekanimo is
this: Box2D solver does not have spring or torsional spring
elements. People create springs by modifying distance joints but I am
not aware of any way to simulate torsional springs in the solver
without adding external torque to the appropriate rigid bodies at each
time step. If anybody knows how to do this please let me know so that
we can add that capability too. Since the default solver is missing
these element types, Mekanimo cannot translate elements like spring,
chain, gap, torsional spring etc. After the release, we will create
an option in the createBox2DCpp function to create distance joints to
simulate springs. But this will not address the issue of using
springs to move objects (like muscles).

Adding these capabilities to Mekanimo was simple for me, thanks to
pyBox2D. If anybody is interested I can publish a tutorial explaining
how to do this. Mekanimo's springs and torsional springs have
frequency, amplitude, and phase angle properties to make animal like
motion easy. If Cocos2D includes these modifications to the solver,
exporting code for the modified solver would be fairly easy from
Mekanimo.

Please note that the latest version has an Export menu button under
the File menu that allows you to export the current model
automatically (it uses the current model's name for the path). If you
need a different name then you can keep using it the same way you did
before.

Generating output files specifically for Cocos2D is in our to do
list. We are planning to do this after we release the Mac version.

Fahri

Matt Sephton

unread,
Aug 16, 2010, 2:03:36 PM8/16/10
to meka...@googlegroups.com
It might be a simple change to output comments/notes in the code to
say which items were not able to be imported

> --
> You received this message because you are subscribed to the Google Groups "Mekanimo" group.
> To post to this group, send email to meka...@googlegroups.com.
> To unsubscribe from this group, send email to mekanimo+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mekanimo?hl=en.
>
>

Fahri

unread,
Aug 16, 2010, 3:15:16 PM8/16/10
to Mekanimo
This is a good idea.

On Aug 16, 2:03 pm, Matt Sephton <matt.seph...@gmail.com> wrote:
> It might be a simple change to output comments/notes in the code to
> say which items were not able to be imported
>

indy2005

unread,
Aug 16, 2010, 7:06:48 PM8/16/10
to Mekanimo
I have just downloaded the new beta to test with Cocos2D, and I am
getting this when I export?

Traceback (most recent call last):
File "mainframe.pyo", line 3672, in _onExportCPP202
File "system.pyo", line 3224, in __getattr__
AttributeError: createBox2dCpp

Fahreddın Basegmez

unread,
Aug 16, 2010, 9:36:40 PM8/16/10
to meka...@googlegroups.com
It is a bug and I am fixing it.  If you type

system.createBox2dCpp = system.createBox2DCpp

in the interpreter then it should work.

Fahri

unread,
Aug 16, 2010, 9:44:02 PM8/16/10
to Mekanimo
On second thought, please do not do the

system.createBox2dCpp = system.createBox2DCpp trick.

This causes some other problems.
> > mekanimo+u...@googlegroups.com<mekanimo%2Bunsu...@googlegroups.com>
> > .
> > > > > For more options, visit this group athttp://
> > groups.google.com/group/mekanimo?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Mekanimo" group.
> > To post to this group, send email to meka...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > mekanimo+u...@googlegroups.com<mekanimo%2Bunsu...@googlegroups.com>
> > .

Fahri

unread,
Aug 17, 2010, 6:54:38 AM8/17/10
to Mekanimo
I have fixed this bug. You can download it from
http://mekanimodownload.s3.amazonaws.com/mekanimo_setup_1.54.exe

Thank you for your feedback.

bad...@gmail.com

unread,
Apr 15, 2011, 4:13:41 PM4/15/11
to meka...@googlegroups.com
Hi there! I'm looking around to a Box2D editor for cocos2D iOS, and come to this! I already have the LevelSVG, but i want to do some more things, and come to this!
I want to know, what i must do to join in the beta version of cocos2D? I must buy a license? How much is for a small company!? I'ts just me and one designer? 

Thanks ;)

Fahreddın Basegmez

unread,
Apr 18, 2011, 10:50:10 AM4/18/11
to meka...@googlegroups.com, bad...@gmail.com
Thank you for your interest in Mekanimo. You can purchase it from
http://www.mekanimo.net/downloads/
for $199.95. I am not sure if I understood what you meant by "beta
version of cocos2D". Can you elaborate on this?

Regards,

Fahri Basegmez

Bruno André Mikoski

unread,
Apr 18, 2011, 2:35:07 PM4/18/11
to meka...@googlegroups.com, bad...@gmail.com
Sry, what i want to say, is beta exporter for C++!

so we can use it in cocos2D :D

Gerakl

unread,
Jun 6, 2011, 3:35:02 AM6/6/11
to Mekanimo
Is there some way to change grid size in mecanimo ?
Changing dimensions of system bod does not affect grid size.

Fahri

unread,
Jun 6, 2011, 5:27:31 AM6/6/11
to Mekanimo
Grid size can be changed from the interpreter. The default size is 10
pixels.

>>> defaults[GRIDSPACING] = 20

You may also want to change number of nodes per grid square, The
default is 4.

>>> defaults[GRIDNODES] = 2
Reply all
Reply to author
Forward
0 new messages